Skip to content

Commit

Permalink
getting netcdf integration working in fortran
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 11, 2019
1 parent e12d55a commit 946c2fc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/flib/pio.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
!>
!! @defgroup PIO_set_blocksize Box Rearranger Settings
!! Set the box rearranger blocksize in Fortran.
#include "config.h"

module pio
! Package all exposed variables and functions under one roof
Expand All @@ -21,7 +22,10 @@ module pio
pio_freedecomp, pio_syncfile, &
pio_finalize, pio_set_hint, pio_getnumiotasks, pio_file_is_open, &
PIO_deletefile, PIO_get_numiotasks, PIO_iotype_available, &
pio_set_rearr_opts, nf_init_intracom
!#ifdef NETCDF_INTEGRATION
nf_init_intracom, &
!#endif
pio_set_rearr_opts

use pio_types, only : io_desc_t, file_desc_t, var_desc_t, iosystem_desc_t, &
pio_rearr_opt_t, pio_rearr_comm_fc_opt_t, pio_rearr_comm_fc_2d_enable,&
Expand Down
9 changes: 7 additions & 2 deletions src/flib/piolib_mod.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define __PIO_FILE__ "piolib_mod.f90"
#include "config.h"
!>
!! @file
!! Initialization Routines for PIO.
Expand Down Expand Up @@ -97,8 +98,8 @@ module piolib_mod
PIO_deletefile, &
PIO_get_numiotasks, &
PIO_iotype_available, &
PIO_set_rearr_opts, &
nf_init_intracom
nf_init_intracom, &
PIO_set_rearr_opts

!-----------------------------------------------------------------------
!
Expand Down Expand Up @@ -134,9 +135,11 @@ module piolib_mod
module procedure setframe
end interface PIO_setframe

!#ifdef NETCDF_INTEGRATION
interface nf_init_intracom
module procedure nf_init_intracom
end interface nf_init_intracom
!#endif

!>
!! Increment the record number for a future read/write of distributed
Expand Down Expand Up @@ -976,6 +979,7 @@ end function PIOc_Init_Intracomm_from_F90
#endif
end subroutine init_intracom

!#ifdef NETCDF_INTEGRATION
!>
!! @public
!! @ingroup PIO_init
Expand Down Expand Up @@ -1026,6 +1030,7 @@ end function nc_set_iosystem
ierr = nc_set_iosystem(iosystem%iosysid)

end subroutine nf_init_intracom
!#endif

!! @public
!! @ingroup PIO_init
Expand Down
4 changes: 2 additions & 2 deletions tests/fncint/ftst_pio.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ program ftst_pio
call MPI_Comm_rank(MPI_COMM_WORLD, myRank, ierr)
call MPI_Comm_size(MPI_COMM_WORLD, ntasks, ierr)

! ierr = pio_set_log_level(2)
! ierr = nf_set_log_level(2)
ierr = pio_set_log_level(2)
ierr = nf_set_log_level(2)
call nf_init_intracom(myRank, MPI_COMM_WORLD, niotasks, numAggregator, &
stride, PIO_rearr_subset, ioSystem, base)

Expand Down

0 comments on commit 946c2fc

Please sign in to comment.