forked from ESMCI/cime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ESMCI#1573 from NCAR/ejh_example
got fortran example working in autotools build
- Loading branch information
Showing
4 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,8 @@ | |
|
||
# Ed Hartnett | ||
|
||
SUBDIRS = c | ||
if BUILD_FORTRAN | ||
F03 = f03 | ||
endif # BUILD_FORTRAN | ||
|
||
SUBDIRS = c ${F03} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## This is the automake file for building the Fortran examples | ||
## for the PIO library. | ||
|
||
# Ed Hartnett 7/17/19 | ||
|
||
# Put together AM_CPPFLAGS and AM_LDFLAGS. | ||
include $(top_srcdir)/set_flags.am | ||
|
||
AM_FCFLAGS = -I$(top_srcdir)/src/flib | ||
|
||
LDADD = ${top_builddir}/src/flib/libpiof.la \ | ||
${top_builddir}/src/clib/libpioc.la | ||
|
||
# Build the test for make check. | ||
check_PROGRAMS = examplePio | ||
|
||
examplePio_SOURCES = examplePio.f90 | ||
|
||
if RUN_TESTS | ||
# Tests will run from a bash script. | ||
TESTS = run_tests.sh | ||
endif # RUN_TESTS | ||
|
||
# Distribute the test script. | ||
EXTRA_DIST = CMakeLists.txt run_tests.sh | ||
|
||
# Clean up files produced during testing. | ||
CLEANFILES = *.nc *.log *.mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
# This is a test script for PIO for tests/general directory. | ||
# Ed Hartnett 7/22/19 | ||
|
||
# Stop execution of script if error is returned. | ||
set -e | ||
|
||
# Stop loop if ctrl-c is pressed. | ||
trap exit INT TERM | ||
|
||
printf 'running PIO Fortran examples...\n' | ||
|
||
PIO_TESTS='examplePio ' | ||
# pio_rearr_opts pio_rearr_opts2 | ||
|
||
success1=true | ||
for TEST in $PIO_TESTS | ||
do | ||
success1=false | ||
echo "running ${TEST}" | ||
mpiexec -n 4 ./${TEST} && success1=true | ||
if test $success1 = false; then | ||
break | ||
fi | ||
done | ||
|
||
# Did we succeed? | ||
if test x$success1 = xtrue; then | ||
exit 0 | ||
fi | ||
exit 1 |