Skip to content

Commit

Permalink
better handling of nf_free_iosystem
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 14, 2019
1 parent f71c1e9 commit ec594c3
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/flib/ncint_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,28 @@ end subroutine nf_init_intracom
!! @retval ierr @copydoc error_return
!! @author Ed Hartnett
!<
subroutine nf_free_iosystem(iosystem, ierr)
type (iosystem_desc_t), intent(inout) :: iosystem
integer(i4), intent(out) :: ierr
call PIO_finalize(iosystem, ierr)
subroutine nf_free_iosystem()
integer(i4) :: ierr
integer(i4) :: iosysid = 0;

interface
integer(C_INT) function nc_get_iosystem(iosysid) &
bind(C, name="nc_get_iosystem")
use iso_c_binding
integer(C_INT), intent(in), value :: iosysid
end function nc_get_iosystem
end interface

interface
integer(C_INT) function PIOc_finalize(iosysid) &
bind(C, name="PIOc_finalize")
use iso_c_binding
integer(C_INT), intent(in), value :: iosysid
end function PIOc_finalize
end interface

ierr = nc_get_iosystem(iosysid)
ierr = PIOc_finalize(iosysid)
end subroutine nf_free_iosystem

end module ncint_mod

0 comments on commit ec594c3

Please sign in to comment.