From 804aac23e9e17f1732262c6c8faf4e2cfe1aa051 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sat, 13 Jul 2019 16:25:33 -0600 Subject: [PATCH] adding nf_free_iosystem --- src/flib/ncint_mod.F90 | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/flib/ncint_mod.F90 b/src/flib/ncint_mod.F90 index 9bd5151a32b..25e4a1fd8f3 100644 --- a/src/flib/ncint_mod.F90 +++ b/src/flib/ncint_mod.F90 @@ -1,8 +1,11 @@ #include "config.h" !> !! @file -!! Initialization Routines for PIO. +!! These are the extra functions added to support netCDF +!! integration. In most cases these functions are wrappers for +!! existing PIO_ functions, but with names that start with nf_. !! +!! @author Ed Hartnett !< !> @@ -20,12 +23,9 @@ module ncint_mod !-------------- use pio_support, only : piodie, debug, debugio, debugasync, checkmpireturn use pio_nf, only : pio_set_log_level - use piolib_mod, only : pio_init + use piolib_mod, only : pio_init, pio_finalize ! -#ifdef TIMING - use perf_mod, only : t_startf, t_stopf ! _EXTERNAL -#endif #ifndef NO_MPIMOD use mpi ! _EXTERNAL #endif @@ -36,12 +36,19 @@ module ncint_mod #endif ! !public member functions: - public :: nf_init_intracom + public :: nf_init_intracom, nf_free_iosystem interface nf_init_intracom module procedure nf_init_intracom end interface nf_init_intracom + !> + !! Shuts down an IOSystem and associated resources. + !< + interface nf_free_iosystem + module procedure nf_free_iosystem + end interface nf_free_iosystem + contains !> @@ -95,4 +102,19 @@ end function nc_set_iosystem end subroutine nf_init_intracom + !> + !! @public + !! @ingroup PIO_finalize + !! Finalizes an IO System. This is a collective call. + !! + !! @param iosystem @copydoc io_desc_t + !! @retval ierr @copydoc error_return + !! @author Jim Edwards + !< + subroutine nf_free_iosystem(iosystem, ierr) + type (iosystem_desc_t), intent(inout) :: iosystem + integer(i4), intent(out) :: ierr + call PIO_finalize(iosystem, ierr) + end subroutine nf_free_iosystem + end module ncint_mod