Skip to content

Commit

Permalink
further test development
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Aug 28, 2020
1 parent cdc01a1 commit cbed988
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
9 changes: 8 additions & 1 deletion tests/unit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
# Find the pio.mod file.
AM_CPPFLAGS = -I$(top_srcdir)/src/flib

# Link to the PIO C and Fortran libraries.
LDADD = ${top_builddir}/src/flib/libpiof.la \
${top_builddir}/src/clib/libpioc.la

# Build the test for make check.
check_PROGRAMS = pio_unit_test_driver ftst_vars
pio_unit_test_driver_SOURCES = driver.F90
Expand All @@ -32,7 +36,10 @@ TESTS = run_tests.sh
endif # RUN_TESTS

# Distribute the test script.
EXTRA_DIST = CMakeLists.txt run_tests.sh input.nl not_netcdf.ieee
EXTRA_DIST = CMakeLists.txt run_tests.sh input.nl not_netcdf.ieee \
run_tests.sh.in

# Clean up files produced during testing.
CLEANFILES = *.nc *.log *.mod

DISTCLEANFILES = run_tests.sh
30 changes: 28 additions & 2 deletions tests/unit/ftst_vars.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
program ftst_vars
use mpi
use pio

type(iosystem_desc_t) :: pio_iosystem
type(file_desc_t) :: pio_file
integer :: my_rank, ntasks
integer :: niotasks = 1, stride = 1
character(len=64) :: filename = 'ftst_vars.nc'
integer :: iotype = PIO_iotype_netcdf4c
integer :: ierr

! Set up MPI
Expand All @@ -18,8 +24,28 @@ program ftst_vars

if (my_rank .eq. 0) print *,'Testing variables...'

call PIO_

! Initialize PIO.
call PIO_init(my_rank, MPI_COMM_WORLD, niotasks, 0, stride, &
PIO_rearr_subset, pio_iosystem, base=1)

! Set error handling for test.
call PIO_seterrorhandling(pio_iosystem, PIO_RETURN_ERROR)
call PIO_seterrorhandling(PIO_DEFAULT, PIO_RETURN_ERROR)

! Create a file.
ierr = PIO_createfile(pio_iosystem, pio_file, iotype, filename)
if (ierr .ne. PIO_NOERR) stop 3

! Close the file.
call PIO_closefile(pio_file)

! Open the file.



! Finalize PIO.
call PIO_finalize(pio_iosystem, ierr)

if (my_rank .eq. 0) print *,'SUCCESS!'
call MPI_Finalize(ierr)
end program ftst_vars

0 comments on commit cbed988

Please sign in to comment.