diff --git a/Makefile.am b/Makefile.am
index 0ddcb5e4b4cd8a0b61af8888fb19a53447c3ee6b..89c5ac6df13d1fd0243c93f274599b937839de17 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 #
-SUBDIRS = src interfaces app examples tests
+SUBDIRS = src interfaces app examples tests pioExamples
 #
 EXTRA_DIST=config/default doc/cdi_cman.pdf doc/cdi_fman.pdf src/cfortran.doc
 #
diff --git a/Makefile.in b/Makefile.in
index 08c568792a365f5a9fa43d99da7949f0a94b00c3..e522c4a776f233a7302ef00ae2198ec572c7fa54 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -267,7 +267,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
 #
-SUBDIRS = src interfaces app examples tests
+SUBDIRS = src interfaces app examples tests pioExamples
 #
 EXTRA_DIST = config/default doc/cdi_cman.pdf doc/cdi_fman.pdf src/cfortran.doc
 #
diff --git a/configure b/configure
index e5fbc62a018d80baf44e8f59f3a2f6e8365a1e44..19dc5606047edb242f6e06e984f5af9a0ad7f5b8 100755
--- a/configure
+++ b/configure
@@ -24397,7 +24397,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings"
+ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings pioExamples/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -25692,6 +25692,7 @@ do
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
     "cdi.settings") CONFIG_FILES="$CONFIG_FILES cdi.settings" ;;
+    "pioExamples/Makefile") CONFIG_FILES="$CONFIG_FILES pioExamples/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
diff --git a/configure.ac b/configure.ac
index 5991f2f5350f5b3ced9bb8467cbcd1b90c17315d..b47d79039154b8564df7025f6ad50cb782aa9a44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,7 +180,9 @@ ACX_CHECK_CFINT([$srcdir/src/cfortran.h])
 
 AC_SUBST([CPPFLAGS])
 
-AC_OUTPUT(Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings)
+AC_OUTPUT([Makefile src/Makefile interfaces/Makefile app/Makefile \
+	tests/Makefile examples/Makefile cdi.settings \
+	pioExamples/Makefile])
 
 #  ----------------------------------------------------------------------
 #  Show configuration
diff --git a/pioExamples/pio_write.F90 b/pioExamples/pio_write.F90
index 38daa4f6611b98cfb827ada0b004dfd87b09d914..6555f758aede4488fb81d3ec712ed282545802f6 100755
--- a/pioExamples/pio_write.F90
+++ b/pioExamples/pio_write.F90
@@ -424,7 +424,7 @@ PROGRAM CDIWRITE
     WRITE ( 0, * ) '------------------------------------------------------------------'
   END IF
 
-  CALL FLUSH ( 0 )
+  FLUSH ( 0 )
   
   CALL MPI_COMM_FREE ( pioComm, error )
   CALL MPI_FINALIZE ( error )
@@ -438,7 +438,7 @@ PROGRAM CDIWRITE
   WRITE ( 0, * ) 'MAIN: Close time:', sumCLOSE, 's'
   WRITE ( 0, * ) '------------------------------------------------------------------'
   
-  CALL FLUSH ( 0 )
+  FLUSH ( 0 )
 #endif