diff options
Diffstat (limited to 'fortran/examples')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 82 | ||||
-rw-r--r-- | fortran/examples/CMakeTests.cmake | 45 | ||||
-rw-r--r-- | fortran/examples/Makefile.am | 14 | ||||
-rw-r--r-- | fortran/examples/Makefile.in | 71 | ||||
-rw-r--r-- | fortran/examples/nested_derived_type.f90 | 12 | ||||
-rw-r--r-- | fortran/examples/rwdset_fortran2003.f90 | 24 |
6 files changed, 178 insertions, 70 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 2bf0bf6..aad5f33 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -40,8 +40,8 @@ set (F2003_examples foreach (example ${examples}) add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f90_ex_${example} ${LIB_TYPE} " " " ") + TARGET_NAMING (f90_ex_${example} STATIC) + TARGET_FORTRAN_PROPERTIES (f90_ex_${example} STATIC " " " ") target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -50,32 +50,60 @@ foreach (example ${examples}) set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) + 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 " " " ") + target_link_libraries (f90_ex_${example}-shared + ${HDF5_F90_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} + ) + target_include_directories (f90_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_target_properties (f90_ex_${example}-shared PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared + ) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) 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} ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f03_ex_${example} ${LIB_TYPE} " " " ") - 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 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 " " " ") + 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} + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - endforeach (example ${F2003_examples}) -endif (HDF5_ENABLE_F2003) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +endforeach (example ${F2003_examples}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example ${LIB_TYPE} " " " ") + TARGET_NAMING (f90_ex_ph5example STATIC) + TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example STATIC " " " ") target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} @@ -85,8 +113,24 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) + 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 " " " ") + target_link_libraries (f90_ex_ph5example-shared + ${HDF5_F90_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} + ${MPI_Fortran_LIBRARIES} + ) + target_include_directories (f90_ex_ph5example-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_target_properties (f90_ex_ph5example-shared PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared + ) + 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 57aec53..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,6 +28,30 @@ 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 AND NOT SKIP_HDF5_FORTRAN_SHARED) + add_test ( + NAME f90_ex-shared-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + compound.h5 + copy1.h5 + copy2.h5 + dsetf.h5 + extend.h5 + FORTRAN.h5 + groupf.h5 + groupsf.h5 + h5_cmprss.h5 + mount1.h5 + mount2.h5 + sdsf.h5 + subset.h5 + ) + if (NOT "${last_test}" STREQUAL "") + 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 AND NOT SKIP_HDF5_FORTRAN_SHARED) foreach (example ${examples}) add_test (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>) @@ -35,6 +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 AND NOT SKIP_HDF5_FORTRAN_SHARED) + add_test (NAME f90_ex-shared_${example} COMMAND $<TARGET_FILE:f90_ex_${example}-shared>) + 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 AND NOT SKIP_HDF5_FORTRAN_SHARED) endforeach (example ${examples}) if (HDF5_ENABLE_F2003) @@ -44,9 +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 AND NOT SKIP_HDF5_FORTRAN_SHARED) + add_test (NAME f03_ex-shared_${example} COMMAND $<TARGET_FILE:f03_ex_${example}-shared>) + 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 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} $<TARGET_FILE:f90_ex_ph5example>) + 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} $<TARGET_FILE:f90_ex_ph5example>) + endif (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index caaa08c..5a3b09e 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 +include $(top_srcdir)/config/conclude_fc.am diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index c894b75..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,18 +104,11 @@ 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 \ $(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 +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_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 +402,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 +426,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,9 +473,20 @@ 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@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -619,17 +634,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) @@ -648,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., @@ -671,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*) \ @@ -693,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 @@ -1067,10 +1088,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): @@ -1141,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/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. ! |