Skip to content

Commit

Permalink
now use decompid in nf_def_decomp
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 19, 2019
1 parent fcf2f7d commit 934e193
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/flib/ncint_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions tests/fncint/ftst_pio.f90
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 934e193

Please sign in to comment.