From 934e19343da974b92b4d30b92e545f01d9dd66f3 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Fri, 19 Jul 2019 04:03:09 -0600 Subject: [PATCH] now use decompid in nf_def_decomp --- src/flib/ncint_mod.F90 | 7 +++++-- tests/fncint/ftst_pio.f90 | 8 +++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/flib/ncint_mod.F90 b/src/flib/ncint_mod.F90 index 6d271164ec0..a374e27b274 100644 --- a/src/flib/ncint_mod.F90 +++ b/src/flib/ncint_mod.F90 @@ -173,18 +173,21 @@ end function nf_free_decomp !! @author Jim Edwards !< function nf_def_decomp(iosystem, basepiotype, dims, compdof, & - iodesc, rearr, iostart, iocount) result(status) + decompid, rearr, iostart, iocount) result(status) type (iosystem_desc_t), intent(in) :: iosystem integer(i4), intent(in) :: basepiotype integer(i4), intent(in) :: dims(:) integer (PIO_OFFSET_KIND), intent(in) :: compdof(:) integer, optional, target :: rearr integer (PIO_OFFSET_KIND), optional :: iostart(:), iocount(:) - type (io_desc_t), intent(inout) :: iodesc + integer(i4), intent(inout) :: decompid + type (io_desc_t) :: iodesc integer :: status call PIO_initdecomp(iosystem, basepiotype, dims, compdof, & iodesc, rearr, iostart, iocount) + decompid = iodesc%ioid + status = 0 end function nf_def_decomp diff --git a/tests/fncint/ftst_pio.f90 b/tests/fncint/ftst_pio.f90 index b91dbabaf61..33017692713 100644 --- a/tests/fncint/ftst_pio.f90 +++ b/tests/fncint/ftst_pio.f90 @@ -1,5 +1,5 @@ - !> This is a test program for the Fortran API use of the netCDF - !! integration layer. +!> This is a test program for the Fortran API use of the netCDF +!! integration layer. program ftst_pio use pio @@ -15,7 +15,6 @@ program ftst_pio parameter (FILE_NAME='ftst_pio.nc') integer(kind=PIO_OFFSET_KIND), dimension(3) :: data_buffer, compdof integer, dimension(1) :: dims - type(io_desc_t) :: iodesc integer :: decompid integer :: ierr @@ -35,8 +34,7 @@ program ftst_pio ! Define a decomposition. dims(1) = 3 * ntasks compdof = 3 * myRank + (/1, 2, 3/) ! Where in the global array each task writes - ierr = nf_def_decomp(ioSystem, PIO_int, dims, compdof, iodesc) - decompid = iodesc%ioid + ierr = nf_def_decomp(ioSystem, PIO_int, dims, compdof, decompid) ! Create a file. ierr = nf_create(FILE_NAME, 64, ncid)