diff --git a/.travis.yml b/.travis.yml index 016a3fbcfad..931bf1b492b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,8 @@ before_script: - export CC=mpicc - export FC=mpif90 - export CPPFLAGS='-I/usr/include' - - wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz - - tar -xzvf pnetcdf-1.12.1.tar.gz + - wget https://parallel-netcdf.github.io/Release/pnetcdf-1.12.1.tar.gz &> /dev/null + - tar -xzf pnetcdf-1.12.1.tar.gz - pushd pnetcdf-1.12.1 - ./configure --prefix=/usr --enable-shared --disable-cxx - make @@ -41,9 +41,9 @@ env: script: - nc-config --all - autoreconf -i - - export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror' - - export FFLAGS='-fsanitize=address -fno-omit-frame-pointer' - - export FCFLAGS='-fsanitize=address -fno-omit-frame-pointer -Werror' + - export CFLAGS='-g -std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror' + - export FFLAGS='-g -fsanitize=address -fno-omit-frame-pointer' + - export FCFLAGS='-g -fsanitize=address -fno-omit-frame-pointer -Werror' - export DISTCHECK_CONFIGURE_FLAGS='--enable-fortran' - ./configure --enable-fortran --enable-developer-docs - make -j distcheck diff --git a/Makefile.am b/Makefile.am index faa7feb3f4e..8d6fc16db28 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,5 +14,5 @@ endif SUBDIRS = src tests examples ${DOC} scripts cmake # Add these files to the distribution. -EXTRA_DIST = CMakeLists.txt set_flags.am COPYRIGHT cmake_config.h.in \ +EXTRA_DIST = CMakeLists.txt COPYRIGHT cmake_config.h.in \ libpio.settings.in diff --git a/cmake_config.h.in b/cmake_config.h.in index c641cddfcf6..fa5cc87c273 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -5,8 +5,6 @@ */ #ifndef _PIO_CONFIG_ #define _PIO_CONFIG_ -/* Set to avoid warning in intel19 compiler wrt strnlen */ -#define _GNU_SOURCE /** The major part of the version number. */ #define PIO_VERSION_MAJOR @VERSION_MAJOR@ @@ -35,4 +33,9 @@ #cmakedefine HAVE_PAR_FILTERS #cmakedefine NETCDF_INTEGRATION +#cmakedefine HAVE_PAR_FILTERS +#cmakedefine NETCDF_INTEGRATION +#cmakedefine _NETCDF4 +#cmakedefine _PNETCDF + #endif /* _PIO_CONFIG_ */ diff --git a/configure.ac b/configure.ac index 5d6eecae15e..da60e1afe21 100644 --- a/configure.ac +++ b/configure.ac @@ -117,6 +117,7 @@ test "x$enable_timing" = xyes || enable_timing=no AC_MSG_RESULT([$enable_timing]) if test "x$enable_timing" = xyes; then AC_DEFINE([TIMING], 1, [If true, use GPTL timing library.]) + AC_DEFINE([HAVE_MPI], [1], [required by GPTL timing library]) fi AM_CONDITIONAL(USE_GPTL, [test "x$enable_timing" = xyes]) @@ -224,24 +225,7 @@ if test "x$enable_docs" = xyes; then AC_CONFIG_FILES([doc/Doxyfile]) fi -AC_MSG_NOTICE([setting flags]) -# NetCDF (at least classic) is required for PIO to build. -AC_DEFINE([_NETCDF], [1], [netCDF classic library available]) - -# ???? -AC_DEFINE([CPRGNU], [1], [defined by CMake build]) - -# We must have MPI to build PIO. -AC_DEFINE([HAVE_MPI], [1], [defined by CMake build]) - -# ??? -AC_DEFINE([INCLUDE_CMAKE_FCI], [1], [defined by CMake build]) - -# All builds are on LINUX. -AC_DEFINE([LINUX], [1], [defined by CMake build]) - -# Define to solve intel compiler warning. -AC_DEFINE([_GNU_SOURCE], [1], [solve strnlen declared implicitly warning on intel compiler]) +AC_MSG_NOTICE([finding libraries]) # Check for netCDF library. AC_CHECK_LIB([netcdf], [nc_create], [], [AC_MSG_ERROR([Can't find or link to the netcdf library.])]) diff --git a/examples/basic/gdecomp_mod.F90 b/examples/basic/gdecomp_mod.F90 index e4f1921452e..b5b41407ad3 100644 --- a/examples/basic/gdecomp_mod.F90 +++ b/examples/basic/gdecomp_mod.F90 @@ -300,9 +300,7 @@ end subroutine gdecomp_print !================================================================== subroutine gdecomp_DOF(gdecomp,my_task,DOF,start,count,write_decomp,test) -#ifdef _NETCDF use netcdf ! _EXTERNAL -#endif implicit none @@ -712,7 +710,6 @@ subroutine gdecomp_DOF(gdecomp,my_task,DOF,start,count,write_decomp,test) ! --- write out arrays --- -#ifdef _NETCDF if (wdecomp) then write(6,*) ' ' write(6,*) trim(subname),' writing decomp info to file ',trim(ncname) @@ -738,7 +735,6 @@ subroutine gdecomp_DOF(gdecomp,my_task,DOF,start,count,write_decomp,test) rcode = nf90_put_var(ncid,varid(2),tskid) rcode = nf90_close(ncid) endif -#endif endif ! testonly diff --git a/examples/basic/testpio.F90 b/examples/basic/testpio.F90 index 2a6e62e427a..d93d4e27521 100644 --- a/examples/basic/testpio.F90 +++ b/examples/basic/testpio.F90 @@ -770,11 +770,7 @@ program testpio ! print *, __FILE__,__LINE__,'>',fname_r8,'<' ! print *, __FILE__,__LINE__,'>',fname_i4,'<' ! print *, __FILE__,__LINE__,'>',fname_r4,'<' -#if defined(_NETCDF) || defined(_PNETCDF) mode = pio_64bit_offset -#else - mode = 0 -#endif if(writePhase) then if(TestCombo) then diff --git a/examples/f03/CMakeLists.txt b/examples/f03/CMakeLists.txt index a299c7cde8c..1073fda1a94 100644 --- a/examples/f03/CMakeLists.txt +++ b/examples/f03/CMakeLists.txt @@ -15,6 +15,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") if(${PIO_BUILD_TIMING}) SET(TIMING_LINK_LIB timing) endif() -SET(SRC examplePio.f90) +SET(SRC examplePio.F90) ADD_EXECUTABLE(examplePio_f90 ${SRC}) TARGET_LINK_LIBRARIES(examplePio_f90 piof pioc ${TIMING_LINK_LIB}) diff --git a/examples/f03/Makefile.am b/examples/f03/Makefile.am index 9a8781d20ad..6f995163fda 100644 --- a/examples/f03/Makefile.am +++ b/examples/f03/Makefile.am @@ -3,8 +3,8 @@ # Ed Hartnett 7/17/19 -# Put together AM_CPPFLAGS and AM_LDFLAGS. -include $(top_srcdir)/set_flags.am +# Find the pio.mod file. +AM_CPPFLAGS = -I$(top_srcdir)/src/flib AM_FCFLAGS = -I$(top_srcdir)/src/flib @@ -14,7 +14,7 @@ ${top_builddir}/src/clib/libpioc.la # Build the test for make check. check_PROGRAMS = examplePio -examplePio_SOURCES = examplePio.f90 +examplePio_SOURCES = examplePio.F90 if RUN_TESTS # Tests will run from a bash script. diff --git a/examples/f03/examplePio.f90 b/examples/f03/examplePio.F90 similarity index 99% rename from examples/f03/examplePio.f90 rename to examples/f03/examplePio.F90 index d2baddf2096..88804b7acab 100644 --- a/examples/f03/examplePio.f90 +++ b/examples/f03/examplePio.F90 @@ -1,3 +1,4 @@ +#include "config.h" !> @file !! A simple Fortran example for the ParallelIO Library. module pioExample diff --git a/libpio.settings.in b/libpio.settings.in index 44785afd6a5..d6e42ff72cf 100644 --- a/libpio.settings.in +++ b/libpio.settings.in @@ -22,7 +22,7 @@ Extra libraries: @LIBS@ Fortran Compiler: @FC_VERSION@ FFLAGS: @FFLAGS@ FCFLAGS: @FCFLAGS@ -FPPFLAGS: @FPPFLAGS@ +More Fortran Flags: @FPPFLAGS@ # Features -------- diff --git a/set_flags.am b/set_flags.am deleted file mode 100644 index 08efa30db22..00000000000 --- a/set_flags.am +++ /dev/null @@ -1,18 +0,0 @@ -# This is part of the PIO package. -# -# Assemble the CPPFLAGS and for PIO Fortran tests. -# -# Ed Hartnett 3/26/19 - -# Set the CPPFLAGS. -AM_CPPFLAGS = -I$(top_srcdir)/src/flib -D_NETCDF - -# Is the user building with pnetcdf? -if BUILD_PNETCDF -AM_CPPFLAGS += -D_PNETCDF -endif - -# Is the user building with netCDF-4 parallel I/O? -if BUILD_NETCDF4 -AM_CPPFLAGS += -D_NETCDF4 -endif diff --git a/src/flib/Makefile.am b/src/flib/Makefile.am index 27ec676c097..758b1aba8cc 100644 --- a/src/flib/Makefile.am +++ b/src/flib/Makefile.am @@ -7,8 +7,6 @@ # The library we are building. lib_LTLIBRARIES = libpiof.la -AM_CPPFLAGS = -D_NETCDF -D_NETCDF4 -D_PNETCDF - # These linker flags specify libtool version info. # See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning # for information regarding incrementing `-version-info`. @@ -97,15 +95,15 @@ if BUILD_DOCS BUILT_SOURCES += piodarray.f90 piolib_mod.f90 pionfatt_mod.f90 pionfget_mod.f90 \ pionfput_mod.f90 pionfatt_mod_2.f90 pionfget_mod_2.f90 piodarray.f90: piodarray.F90 - $(CC) -E $< > $@ + $(CC) -I../.. $(AM_CPPFLAGS) -E $< > $@ piolib_mod.f90: piolib_mod.F90 $(CC) -I../.. $(AM_CPPFLAGS) -E $< > $@ pionfatt_mod.f90: pionfatt_mod.F90 - $(CC) -E $< > $@ + $(CC) -I../.. $(AM_CPPFLAGS) -E $< > $@ pionfget_mod.f90: pionfget_mod.F90 - $(CC) -E $< > $@ + $(CC) -I../.. $(AM_CPPFLAGS) -E $< > $@ pionfput_mod.f90: pionfput_mod.F90 - $(CC) -E $< > $@ + $(CC) -I../.. $(AM_CPPFLAGS) -E $< > $@ # Unfortunately the genf90.pl script which generates these fortran # files has no way of handling doxygen documentation. So use sed to diff --git a/src/flib/pio.F90 b/src/flib/pio.F90 index a14a8af9912..d0e9e71d2bf 100644 --- a/src/flib/pio.F90 +++ b/src/flib/pio.F90 @@ -39,9 +39,7 @@ module pio pio_iotype_pnetcdf,pio_iotype_netcdf, & pio_global, pio_char, pio_write, pio_nowrite, pio_clobber, pio_noclobber, & pio_max_name, pio_max_var_dims, pio_rearr_subset, pio_rearr_box, & -#if defined(_NETCDF) || defined(_PNETCDF) pio_nofill, pio_unlimited, pio_fill_int, pio_fill_double, pio_fill_float, & -#endif pio_64bit_offset, pio_64bit_data, & pio_internal_error, pio_bcast_error, pio_return_error, pio_default diff --git a/src/flib/pio_kinds.F90 b/src/flib/pio_kinds.F90 index c5074c1f850..f9de9a185aa 100644 --- a/src/flib/pio_kinds.F90 +++ b/src/flib/pio_kinds.F90 @@ -4,6 +4,7 @@ !! types like integer, character, logical, real4 and real8. !! !< +#include "config.h" module pio_kinds ! uses mpi if available diff --git a/src/flib/pio_nf.F90 b/src/flib/pio_nf.F90 index b40b7b71356..a8352b294b2 100644 --- a/src/flib/pio_nf.F90 +++ b/src/flib/pio_nf.F90 @@ -1,3 +1,4 @@ +#include "config.h" !> !! @file !! Code to implement the classic netCDF Fortran API in PIO. diff --git a/src/flib/pio_support.F90 b/src/flib/pio_support.F90 index ae212d1bbdc..686da26fed2 100644 --- a/src/flib/pio_support.F90 +++ b/src/flib/pio_support.F90 @@ -1,3 +1,4 @@ +#include "config.h" !> !! @file !! Internal code for compiler workarounds, aborts and debug functions. diff --git a/src/flib/pio_types.F90 b/src/flib/pio_types.F90 index 970c2c83402..844514f6171 100644 --- a/src/flib/pio_types.F90 +++ b/src/flib/pio_types.F90 @@ -1,3 +1,4 @@ +#include "config.h" !> !! @file !! Derived datatypes and constants for PIO Fortran API. diff --git a/src/flib/piodarray.F90.in b/src/flib/piodarray.F90.in index dfd2b5339a2..e9b5252a5ed 100644 --- a/src/flib/piodarray.F90.in +++ b/src/flib/piodarray.F90.in @@ -1,4 +1,5 @@ #define __PIO_FILE__ 'piodarray' +#include "config.h" !> !! @file !! Read and write routines for decomposed data. diff --git a/src/flib/pionfatt_mod.F90.in b/src/flib/pionfatt_mod.F90.in index cc4a3cd409d..da4e91d7c59 100644 --- a/src/flib/pionfatt_mod.F90.in +++ b/src/flib/pionfatt_mod.F90.in @@ -1,4 +1,5 @@ #define __PIO_FILE__ "pionfatt_mod.F90" +#include "config.h" !> !! @file !! @brief NetCDF attribute interface to PIO diff --git a/src/flib/pionfget_mod.F90.in b/src/flib/pionfget_mod.F90.in index 3fe5462d95a..fd98155e9b5 100644 --- a/src/flib/pionfget_mod.F90.in +++ b/src/flib/pionfget_mod.F90.in @@ -1,4 +1,5 @@ #define __PIO_FILE__ "pionfget_mod.F90" +#include "config.h" !> !! @file !! @brief Read Routines for non-decomposed NetCDF data. diff --git a/src/flib/pionfput_mod.F90.in b/src/flib/pionfput_mod.F90.in index 727c7d0dbcd..33024fd963e 100644 --- a/src/flib/pionfput_mod.F90.in +++ b/src/flib/pionfput_mod.F90.in @@ -1,4 +1,5 @@ #define __PIO_FILE__ "pionfput_mod.F90" +#include "config.h" !> !! @file !! @brief Write routines for non-decomposed NetCDF data. diff --git a/tests/cunit/test_common.c b/tests/cunit/test_common.c index df5d5997504..e6a2b615824 100644 --- a/tests/cunit/test_common.c +++ b/tests/cunit/test_common.c @@ -137,10 +137,9 @@ get_iotypes(int *num_flavors, int *flavors) num++; format[fmtidx++] = PIO_IOTYPE_PNETCDF; #endif -#ifdef _NETCDF + /* NetCDF is always present. */ num++; format[fmtidx++] = PIO_IOTYPE_NETCDF; -#endif #ifdef _NETCDF4 num += 2; format[fmtidx++] = PIO_IOTYPE_NETCDF4C; diff --git a/tests/cunit/test_darray_frame.c b/tests/cunit/test_darray_frame.c index 949e90ebfb4..41f43452360 100644 --- a/tests/cunit/test_darray_frame.c +++ b/tests/cunit/test_darray_frame.c @@ -192,7 +192,7 @@ int main(int argc, char **argv) /* Initialize test. */ if ((ret = pio_test_init2(argc, argv, &my_rank, &ntasks, MIN_NTASKS, - MIN_NTASKS, 3, &test_comm))) + MIN_NTASKS, -1, &test_comm))) ERR(ERR_INIT); if ((ret = PIOc_set_iosystem_error_handling(PIO_DEFAULT, PIO_RETURN_ERROR, NULL))) diff --git a/tests/cunit/test_iosystem3.c b/tests/cunit/test_iosystem3.c index 1c91b00c5c4..e63c7e38c67 100644 --- a/tests/cunit/test_iosystem3.c +++ b/tests/cunit/test_iosystem3.c @@ -56,7 +56,7 @@ int create_file(MPI_Comm comm, int iosysid, int format, char *filename, return ret; /* Write an attribute. */ - if ((ret = PIOc_put_att_text(ncid, varid, attname, strnlen(filename, PIO_TF_MAX_STR_LEN), + if ((ret = PIOc_put_att_text(ncid, varid, attname, strlen(filename), filename))) return ret; @@ -94,11 +94,11 @@ int check_file(MPI_Comm comm, int iosysid, int format, int ncid, char *filename, /* Check the attribute. Null terminating byte deliberately ignored * to match fortran code. */ - if (!(att_data = malloc(strnlen(filename, PIO_TF_MAX_STR_LEN) * sizeof(char)))) + if (!(att_data = malloc(strlen(filename) * sizeof(char)))) return PIO_ENOMEM; if ((ret = PIOc_get_att(ncid, varid, attname, att_data))) return ret; - if (strncmp(att_data, filename, strnlen(filename, PIO_TF_MAX_STR_LEN))) + if (strncmp(att_data, filename, strlen(filename))) return ERR_WRONG; free(att_data); diff --git a/tests/fncint/Makefile.am b/tests/fncint/Makefile.am index f45c1ca5810..086b11ebaf7 100644 --- a/tests/fncint/Makefile.am +++ b/tests/fncint/Makefile.am @@ -3,8 +3,8 @@ # Ed Hartnett 7/3/19 -# Put together AM_CPPFLAGS and AM_LDFLAGS. -include $(top_srcdir)/set_flags.am +# Find the pio.mod file. +AM_CPPFLAGS = -I$(top_srcdir)/src/flib # Link to the PIO Fortran and C libraries. LDADD = ${top_builddir}/src/flib/libpiof.la ${top_builddir}/src/clib/libpioc.la diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 68ece2cd2fd..35779ca5b7a 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -6,11 +6,11 @@ # Parallel builds don't currently work in this directory. .NOTPARALLEL: -# Put together AM_CPPFLAGS and AM_LDFLAGS. -include $(top_srcdir)/set_flags.am +# Find the pio.mod file. +AM_CPPFLAGS = -I$(top_srcdir)/src/flib -LDADD = libpio_tutil.la \ -${top_builddir}/src/flib/libpiof.la \ +# Link to our test, fortran, and C libraries. +LDADD = libpio_tutil.la ${top_builddir}/src/flib/libpiof.la \ ${top_builddir}/src/clib/libpioc.la # There is a test utility mod file in this subdir which must be built. diff --git a/tests/general/ncdf_fail.F90.in b/tests/general/ncdf_fail.F90.in index dfc09148a49..eed98aad6fa 100644 --- a/tests/general/ncdf_fail.F90.in +++ b/tests/general/ncdf_fail.F90.in @@ -1,3 +1,4 @@ +#include "config.h" MODULE ncdf_fail_tgv use pio_tutil implicit none diff --git a/tests/general/ncdf_get_put.F90.in b/tests/general/ncdf_get_put.F90.in index 7453fe32ede..2d00474cd00 100644 --- a/tests/general/ncdf_get_put.F90.in +++ b/tests/general/ncdf_get_put.F90.in @@ -1,3 +1,4 @@ +#include "config.h" PIO_TF_TEMPLATE PIO_TF_AUTO_TEST_SUB_BEGIN test_put_1datt Implicit none diff --git a/tests/general/ncdf_inq.F90.in b/tests/general/ncdf_inq.F90.in index 51586d7df27..9745bd1b8e2 100644 --- a/tests/general/ncdf_inq.F90.in +++ b/tests/general/ncdf_inq.F90.in @@ -1,3 +1,4 @@ +#include "config.h" MODULE ncdf_inq_tests_tgv use pio_tutil character(len=PIO_TF_MAX_STR_LEN), parameter :: tgv_fname = "pio_ncdf_inq_test_file.nc" diff --git a/tests/general/ncdf_simple_tests.F90.in b/tests/general/ncdf_simple_tests.F90.in index 272997d0a1c..12368f13000 100644 --- a/tests/general/ncdf_simple_tests.F90.in +++ b/tests/general/ncdf_simple_tests.F90.in @@ -1,3 +1,4 @@ +#include "config.h" MODULE ncdf_simple_tests_tgv use pio_tutil ! tgv in prefix corresponds to module name (ncdf_simple_tests_tgv) diff --git a/tests/general/pio_decomp_fillval.F90.in b/tests/general/pio_decomp_fillval.F90.in index 432adbfbfe3..1b67382e669 100644 --- a/tests/general/pio_decomp_fillval.F90.in +++ b/tests/general/pio_decomp_fillval.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! nc write 1d array with fillvalues (the holes are explicitly specified) PIO_TF_TEMPLATE PIO_TF_AUTO_TEST_SUB_BEGIN nc_write_1d_explicit_fval diff --git a/tests/general/pio_decomp_frame_tests.F90.in b/tests/general/pio_decomp_frame_tests.F90.in index 791d748052b..70edaf6fbbd 100644 --- a/tests/general/pio_decomp_frame_tests.F90.in +++ b/tests/general/pio_decomp_frame_tests.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Get a 3D column decomposition ! If force_rearrange is FALSE, the decomposition is such that ! # All even procs have VEC_HGT_SZ blocks of diff --git a/tests/general/pio_decomp_tests.F90.in b/tests/general/pio_decomp_tests.F90.in index b6d7f06d0a4..cb6f9398691 100644 --- a/tests/general/pio_decomp_tests.F90.in +++ b/tests/general/pio_decomp_tests.F90.in @@ -1,3 +1,4 @@ +#include "config.h" PIO_TF_AUTO_TEST_SUB_BEGIN init_decomp_1d_get_loc_sz implicit none integer, parameter :: VEC_LOCAL_SZ = 7 diff --git a/tests/general/pio_decomp_tests_1d.F90.in b/tests/general/pio_decomp_tests_1d.F90.in index 866be4c4a8f..52acc3eb4c9 100644 --- a/tests/general/pio_decomp_tests_1d.F90.in +++ b/tests/general/pio_decomp_tests_1d.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Get a block cyclic decomposition ! If force_rearrange is FALSE, the decomposition is such that ! # All even procs have VEC_LOCAL_SZ elements diff --git a/tests/general/pio_decomp_tests_2d.F90.in b/tests/general/pio_decomp_tests_2d.F90.in index 5cd711294f7..25b2a488432 100644 --- a/tests/general/pio_decomp_tests_2d.F90.in +++ b/tests/general/pio_decomp_tests_2d.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Get a 2D column decomposition ! If force_rearrange is FALSE, the decomposition is such that ! # All even procs have VEC_COL_SZ rows of VEC_ROW_SZ elements diff --git a/tests/general/pio_decomp_tests_3d.F90.in b/tests/general/pio_decomp_tests_3d.F90.in index 79569dbaa4e..17a20b2d0e7 100644 --- a/tests/general/pio_decomp_tests_3d.F90.in +++ b/tests/general/pio_decomp_tests_3d.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Get a 3D column decomposition ! If force_rearrange is FALSE, the decomposition is such that ! # All even procs have VEC_HGT_SZ blocks of diff --git a/tests/general/pio_fail.F90.in b/tests/general/pio_fail.F90.in index 464fc5c5d2a..796670bd87f 100644 --- a/tests/general/pio_fail.F90.in +++ b/tests/general/pio_fail.F90.in @@ -1,3 +1,4 @@ +#include "config.h" PIO_TF_AUTO_TEST_SUB_BEGIN fail_rank_even LOGICAL cond ! Even procs fail diff --git a/tests/general/pio_file_fail.F90.in b/tests/general/pio_file_fail.F90.in index a4b99acb43c..8ef10631809 100644 --- a/tests/general/pio_file_fail.F90.in +++ b/tests/general/pio_file_fail.F90.in @@ -1,3 +1,4 @@ +#include "config.h" PIO_TF_TEST_SUB_BEGIN create_file_always_fail(iotype, filename) implicit none integer, intent(in) :: iotype diff --git a/tests/general/pio_file_simple_tests.F90.in b/tests/general/pio_file_simple_tests.F90.in index af5604b1798..9fc177ec42a 100644 --- a/tests/general/pio_file_simple_tests.F90.in +++ b/tests/general/pio_file_simple_tests.F90.in @@ -1,3 +1,4 @@ +#include "config.h" PIO_TF_TEST_SUB_BEGIN create_file_no_opts(iotype, filename) implicit none integer, intent(in) :: iotype diff --git a/tests/general/pio_init_finalize.F90.in b/tests/general/pio_init_finalize.F90.in index ab36f00b6f2..27e03f8ea76 100644 --- a/tests/general/pio_init_finalize.F90.in +++ b/tests/general/pio_init_finalize.F90.in @@ -1,3 +1,4 @@ +#include "config.h" PIO_TF_AUTO_TEST_SUB_BEGIN init_finalize ! The default test driver should initialize and finalize PIO PRINT *, "Hello world" diff --git a/tests/general/pio_iosystem_tests.F90.in b/tests/general/pio_iosystem_tests.F90.in index c5610c5b0ad..2bbf399ec16 100644 --- a/tests/general/pio_iosystem_tests.F90.in +++ b/tests/general/pio_iosystem_tests.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Split comm world into two comms (one with even procs and the other ! with odd procs SUBROUTINE split_world_odd_even(new_comm, new_rank, new_size, is_even) diff --git a/tests/general/pio_iosystem_tests2.F90.in b/tests/general/pio_iosystem_tests2.F90.in index 50a900b4a3d..6d900b73336 100644 --- a/tests/general/pio_iosystem_tests2.F90.in +++ b/tests/general/pio_iosystem_tests2.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Split comm world into two comms (one with even procs and the other ! with odd procs SUBROUTINE split_world_odd_even(new_comm, new_rank, new_size, is_even) diff --git a/tests/general/pio_iosystem_tests3.F90.in b/tests/general/pio_iosystem_tests3.F90.in index fad87a4beb5..6477e05b067 100644 --- a/tests/general/pio_iosystem_tests3.F90.in +++ b/tests/general/pio_iosystem_tests3.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Split comm world into two comms (even procs and odd procs) and ! rank == overlapped_rank included in both comms SUBROUTINE split_world_two_with_overlap(new_comms, new_ranks, new_sizes, overlapped_rank) diff --git a/tests/general/pio_rearr.F90.in b/tests/general/pio_rearr.F90.in index 1cddf87707a..202ad109585 100644 --- a/tests/general/pio_rearr.F90.in +++ b/tests/general/pio_rearr.F90.in @@ -1,3 +1,4 @@ +#include "config.h" ! Create a file with a global attribute (filename) SUBROUTINE create_file(comm, iosys, iotype, fname, attname, dimname, ret) use pio_tutil diff --git a/tests/general/pio_rearr_opts.F90.in b/tests/general/pio_rearr_opts.F90.in index a47695cb752..d209860c2f7 100644 --- a/tests/general/pio_rearr_opts.F90.in +++ b/tests/general/pio_rearr_opts.F90.in @@ -1,3 +1,4 @@ +#include "config.h" MODULE pio_rearr_opts_tgv use pio_tutil character(len=PIO_TF_MAX_STR_LEN), parameter ::tgv_fname ="pio_rearr_opts_test.nc" diff --git a/tests/general/pio_rearr_opts2.F90.in b/tests/general/pio_rearr_opts2.F90.in index a46565b5e59..0d6a48c8a83 100644 --- a/tests/general/pio_rearr_opts2.F90.in +++ b/tests/general/pio_rearr_opts2.F90.in @@ -1,3 +1,4 @@ +#include "config.h" MODULE pio_rearr_opts_tgv use pio_tutil character(len=PIO_TF_MAX_STR_LEN), parameter ::tgv_fname ="pio_rearr_opts2_test.nc" diff --git a/tests/general/util/pio_tutil.F90 b/tests/general/util/pio_tutil.F90 index 181c897f88d..971f10fe055 100644 --- a/tests/general/util/pio_tutil.F90 +++ b/tests/general/util/pio_tutil.F90 @@ -295,11 +295,9 @@ SUBROUTINE PIO_TF_Get_nc_iotypes(iotypes, iotype_descs, num_iotypes) ! netcdf, netcdf4p, netcdf4c num_iotypes = num_iotypes + 3 #else -#ifdef _NETCDF - ! netcdf + ! netcdf is always present. num_iotypes = num_iotypes + 1 #endif -#endif #ifdef _PNETCDF ! pnetcdf num_iotypes = num_iotypes + 1 @@ -328,12 +326,10 @@ SUBROUTINE PIO_TF_Get_nc_iotypes(iotypes, iotype_descs, num_iotypes) iotype_descs(i) = "NETCDF4P" i = i + 1 #else -#ifdef _NETCDF - ! netcdf + ! netcdf is always present. iotypes(i) = PIO_iotype_netcdf iotype_descs(i) = "NETCDF" i = i + 1 -#endif #endif END SUBROUTINE @@ -355,14 +351,6 @@ SUBROUTINE PIO_TF_Get_undef_nc_iotypes(iotypes, iotype_descs, num_iotypes) num_iotypes = 0 ! First find the number of io types -#ifndef _NETCDF - ! netcdf - num_iotypes = num_iotypes + 1 -#ifndef _NETCDF4 - ! netcdf4p, netcdf4c - num_iotypes = num_iotypes + 2 -#endif -#endif #ifndef _PNETCDF ! pnetcdf num_iotypes = num_iotypes + 1 @@ -378,21 +366,6 @@ SUBROUTINE PIO_TF_Get_undef_nc_iotypes(iotypes, iotype_descs, num_iotypes) iotypes(i) = PIO_iotype_pnetcdf iotype_descs(i) = "PNETCDF" i = i + 1 -#endif -#ifndef _NETCDF - ! netcdf - iotypes(i) = PIO_iotype_netcdf - iotype_descs(i) = "NETCDF" - i = i + 1 -#ifndef _NETCDF4 - ! netcdf4p, netcdf4c - iotypes(i) = PIO_iotype_netcdf4c - iotype_descs(i) = "NETCDF4C" - i = i + 1 - iotypes(i) = PIO_iotype_netcdf4p - iotype_descs(i) = "NETCDF4P" - i = i + 1 -#endif #endif END SUBROUTINE @@ -416,11 +389,9 @@ SUBROUTINE PIO_TF_Get_iotypes(iotypes, iotype_descs, num_iotypes) ! netcdf, netcdf4p, netcdf4c num_iotypes = num_iotypes + 3 #else -#ifdef _NETCDF - ! netcdf + ! netcdf is always present. num_iotypes = num_iotypes + 1 #endif -#endif #ifdef _PNETCDF ! pnetcdf num_iotypes = num_iotypes + 1 @@ -449,12 +420,10 @@ SUBROUTINE PIO_TF_Get_iotypes(iotypes, iotype_descs, num_iotypes) iotype_descs(i) = "NETCDF4P" i = i + 1 #else -#ifdef _NETCDF - ! netcdf + ! netcdf is always present. iotypes(i) = PIO_iotype_netcdf iotype_descs(i) = "NETCDF" i = i + 1 -#endif #endif END SUBROUTINE @@ -476,14 +445,6 @@ SUBROUTINE PIO_TF_Get_undef_iotypes(iotypes, iotype_descs, num_iotypes) ! First find the number of io types num_iotypes = 0 -#ifndef _NETCDF - ! netcdf - num_iotypes = num_iotypes + 1 -#ifndef _NETCDF4 - ! netcdf4p, netcdf4c - num_iotypes = num_iotypes + 2 -#endif -#endif #ifndef _PNETCDF ! pnetcdf num_iotypes = num_iotypes + 1 @@ -494,27 +455,6 @@ SUBROUTINE PIO_TF_Get_undef_iotypes(iotypes, iotype_descs, num_iotypes) ALLOCATE(iotype_descs(num_iotypes)) i = 1 -#ifndef _NETCDF - ! netcdf - iotypes(i) = PIO_iotype_netcdf - iotype_descs(i) = "NETCDF" - i = i + 1 -#ifndef _PNETCDF - ! pnetcdf - iotypes(i) = PIO_iotype_pnetcdf - iotype_descs(i) = "PNETCDF" - i = i + 1 -#endif -#ifndef _NETCDF4 - ! netcdf4p, netcdf4c - iotypes(i) = PIO_iotype_netcdf4c - iotype_descs(i) = "NETCDF4C" - i = i + 1 - iotypes(i) = PIO_iotype_netcdf4p - iotype_descs(i) = "NETCDF4P" - i = i + 1 -#endif -#endif END SUBROUTINE ! Returns a list of PIO base types diff --git a/tests/performance/Makefile.am b/tests/performance/Makefile.am index 751b970be92..d63c58c4b9d 100644 --- a/tests/performance/Makefile.am +++ b/tests/performance/Makefile.am @@ -6,8 +6,8 @@ # Parallel builds don't currently work in this directory. .NOTPARALLEL: -# Put together AM_CPPFLAGS and AM_LDFLAGS. -include $(top_srcdir)/set_flags.am +# Find the pio.mod file. +AM_CPPFLAGS = -I$(top_srcdir)/src/flib # Link to test util library and PIO Fortran and C libs. LDADD = $(top_builddir)/src/gptl/libperf_mod.la \ diff --git a/tests/performance/pioperformance.F90 b/tests/performance/pioperformance.F90 index cb293158740..8a5e2e732b0 100644 --- a/tests/performance/pioperformance.F90 +++ b/tests/performance/pioperformance.F90 @@ -1,3 +1,4 @@ +#include "config.h" #define VARINT 1 !#define VARREAL 1 !#define VARDOUBLE 1 diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 33264e29011..1eaea6e77b3 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -6,8 +6,8 @@ # Parallel builds don't currently work in this directory. .NOTPARALLEL: -# Put together AM_CPPFLAGS and AM_LDFLAGS. -include $(top_srcdir)/set_flags.am +# Find the pio.mod file. +AM_CPPFLAGS = -I$(top_srcdir)/src/flib # Build the test for make check. check_PROGRAMS = pio_unit_test_driver diff --git a/tests/unit/driver.F90 b/tests/unit/driver.F90 index d3f3a83fd7c..6764b875595 100644 --- a/tests/unit/driver.F90 +++ b/tests/unit/driver.F90 @@ -64,13 +64,6 @@ Program pio_unit_test_driver ! Ignore namelist values if PIO not built with correct options ! (i.e. don't test pnetcdf if not built with pnetcdf) -#ifndef _NETCDF - if (ltest_netcdf) then - write(*,"(A,1x,A)") "WARNING: can not test netcdf files because PIO", & - "was not compiled with -D_NETCDF" - ltest_netcdf = .false. - end if -#endif #ifndef _NETCDF4 if (ltest_netcdf4p) then write(*,"(A,1x,A)") "WARNING: can not test netcdf4p files because PIO", &