Skip to content

Commit

Permalink
Merge pull request ESMCI#1722 from NCAR/ejh_next_7
Browse files Browse the repository at this point in the history
cleanup of flag use in src/flib
  • Loading branch information
edwardhartnett authored Aug 18, 2020
2 parents 4f80a53 + a1a04ef commit a59a55b
Show file tree
Hide file tree
Showing 41 changed files with 55 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions cmake_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@

#define HAVE_PAR_FILTERS @HAVE_PAR_FILTERS@

#cmakedefine HAVE_PAR_FILTERS
#cmakedefine NETCDF_INTEGRATION
#cmakedefine _NETCDF4
#cmakedefine _PNETCDF

#endif /* _PIO_CONFIG_ */
2 changes: 1 addition & 1 deletion examples/f03/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
6 changes: 3 additions & 3 deletions examples/f03/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
!> @file
!! A simple Fortran example for the ParallelIO Library.
module pioExample
Expand Down
18 changes: 0 additions & 18 deletions set_flags.am

This file was deleted.

10 changes: 4 additions & 6 deletions src/flib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# The library we are building.
lib_LTLIBRARIES = libpiof.la

AM_CPPFLAGS = -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`.
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/flib/pio_kinds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
!! types like integer, character, logical, real4 and real8.
!!
!<
#include "config.h"
module pio_kinds

! uses mpi if available
Expand Down
1 change: 1 addition & 0 deletions src/flib/pio_nf.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
!>
!! @file
!! Code to implement the classic netCDF Fortran API in PIO.
Expand Down
1 change: 1 addition & 0 deletions src/flib/pio_support.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
!>
!! @file
!! Internal code for compiler workarounds, aborts and debug functions.
Expand Down
1 change: 1 addition & 0 deletions src/flib/pio_types.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
!>
!! @file
!! Derived datatypes and constants for PIO Fortran API.
Expand Down
1 change: 1 addition & 0 deletions src/flib/piodarray.F90.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define __PIO_FILE__ 'piodarray'
#include "config.h"
!>
!! @file
!! Read and write routines for decomposed data.
Expand Down
1 change: 1 addition & 0 deletions src/flib/pionfatt_mod.F90.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define __PIO_FILE__ "pionfatt_mod.F90"
#include "config.h"
!>
!! @file
!! @brief NetCDF attribute interface to PIO
Expand Down
1 change: 1 addition & 0 deletions src/flib/pionfget_mod.F90.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define __PIO_FILE__ "pionfget_mod.F90"
#include "config.h"
!>
!! @file
!! @brief Read Routines for non-decomposed NetCDF data.
Expand Down
1 change: 1 addition & 0 deletions src/flib/pionfput_mod.F90.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define __PIO_FILE__ "pionfput_mod.F90"
#include "config.h"
!>
!! @file
!! @brief Write routines for non-decomposed NetCDF data.
Expand Down
2 changes: 1 addition & 1 deletion tests/cunit/test_darray_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
4 changes: 2 additions & 2 deletions tests/fncint/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/general/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions tests/general/ncdf_fail.F90.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
MODULE ncdf_fail_tgv
use pio_tutil
implicit none
Expand Down
1 change: 1 addition & 0 deletions tests/general/ncdf_get_put.F90.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
PIO_TF_TEMPLATE<PIO_TF_PREDEF_TYPENAME PIO_TF_DATA_TYPE, PIO_TF_PREDEF_TYPENAME PIO_TF_FC_DATA_TYPE>
PIO_TF_AUTO_TEST_SUB_BEGIN test_put_1datt
Implicit none
Expand Down
1 change: 1 addition & 0 deletions tests/general/ncdf_inq.F90.in
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions tests/general/ncdf_simple_tests.F90.in
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_decomp_fillval.F90.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
! nc write 1d array with fillvalues (the holes are explicitly specified)
PIO_TF_TEMPLATE<PIO_TF_PREDEF_TYPENAME PIO_TF_DATA_TYPE, PIO_TF_PREDEF_TYPENAME PIO_TF_FC_DATA_TYPE>
PIO_TF_AUTO_TEST_SUB_BEGIN nc_write_1d_explicit_fval
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_decomp_frame_tests.F90.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_decomp_tests.F90.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_decomp_tests_1d.F90.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_decomp_tests_2d.F90.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_decomp_tests_3d.F90.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_fail.F90.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
PIO_TF_AUTO_TEST_SUB_BEGIN fail_rank_even
LOGICAL cond
! Even procs fail
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_file_fail.F90.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
PIO_TF_TEST_SUB_BEGIN create_file_always_fail(iotype, filename)
implicit none
integer, intent(in) :: iotype
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_file_simple_tests.F90.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
PIO_TF_TEST_SUB_BEGIN create_file_no_opts(iotype, filename)
implicit none
integer, intent(in) :: iotype
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_init_finalize.F90.in
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_iosystem_tests.F90.in
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_iosystem_tests2.F90.in
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_iosystem_tests3.F90.in
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_rearr.F90.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_rearr_opts.F90.in
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions tests/general/pio_rearr_opts2.F90.in
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/performance/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions tests/performance/pioperformance.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config.h"
#define VARINT 1
!#define VARREAL 1
!#define VARDOUBLE 1
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a59a55b

Please sign in to comment.