! This file was automatically generated by SWIG (https://www.swig.org).
! Version 4.2.0
!
! Do not make changes to this file unless you know what you are doing - modify
! the SWIG interface file instead.

! TASMANIAN project, https://github.com/ORNL/TASMANIAN
! Copyright (c) 2020 Oak Ridge National Laboratory, UT-Battelle, LLC.
! Distributed under an MIT open source license: see LICENSE for details.

module tasmanian_mpi_swig
 use, intrinsic :: ISO_C_BINDING
 use tasmanian_swig
 implicit none
 private

 ! DECLARATION CONSTRUCTS

 integer, parameter :: swig_cmem_own_bit = 0
 integer, parameter :: swig_cmem_rvalue_bit = 1
 type, bind(C) :: SwigClassWrapper
  type(C_PTR), public :: cptr = C_NULL_PTR
  integer(C_INT), public :: cmemflags = 0
 end type
 public :: tsgMPIGridSend
 public :: tsgMPIGridBcast
 public :: tsgMPIGridScatterOutputs
 interface tsgMPIGridRecv
  module procedure swigf_tsgMPIGridRecv__SWIG_1
 end interface
 public :: tsgMPIGridRecv

! WRAPPER DECLARATIONS
interface
function swigc_tsgMPIGridSend(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_tsgMPIGridSend") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(SwigClassWrapper), intent(in) :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT), intent(in) :: farg3
integer(C_INT), intent(in) :: farg4
integer(C_INT) :: fresult
end function

function swigc_tsgMPIGridRecv__SWIG_1(farg1, farg2, farg3, farg4) &
bind(C, name="_wrap_tsgMPIGridRecv__SWIG_1") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(SwigClassWrapper), intent(in) :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT), intent(in) :: farg3
integer(C_INT), intent(in) :: farg4
integer(C_INT) :: fresult
end function

function swigc_tsgMPIGridBcast(farg1, farg2, farg3) &
bind(C, name="_wrap_tsgMPIGridBcast") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(SwigClassWrapper), intent(in) :: farg1
integer(C_INT), intent(in) :: farg2
integer(C_INT), intent(in) :: farg3
integer(C_INT) :: fresult
end function

function swigc_tsgMPIGridScatterOutputs(farg1, farg2, farg3, farg4, farg5) &
bind(C, name="_wrap_tsgMPIGridScatterOutputs") &
result(fresult)
use, intrinsic :: ISO_C_BINDING
import :: swigclasswrapper
type(SwigClassWrapper), intent(in) :: farg1
type(SwigClassWrapper), intent(in) :: farg2
integer(C_INT), intent(in) :: farg3
integer(C_INT), intent(in) :: farg4
integer(C_INT), intent(in) :: farg5
integer(C_INT) :: fresult
end function

end interface


contains
 ! MODULE SUBPROGRAMS
function tsgMPIGridSend(grid, destination, tag, comm) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
class(TasmanianSparseGrid), intent(in) :: grid
integer(C_INT), intent(in) :: destination
integer(C_INT), intent(in) :: tag
integer :: comm
integer(C_INT) :: fresult 
type(SwigClassWrapper) :: farg1 
integer(C_INT) :: farg2 
integer(C_INT) :: farg3 
integer(C_INT) :: farg4 

farg1 = grid%swigdata
farg2 = destination
farg3 = tag
farg4 = int(comm, C_INT)
fresult = swigc_tsgMPIGridSend(farg1, farg2, farg3, farg4)
swig_result = fresult
end function

function swigf_tsgMPIGridRecv__SWIG_1(grid, source, tag, comm) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
class(TasmanianSparseGrid), intent(in) :: grid
integer(C_INT), intent(in) :: source
integer(C_INT), intent(in) :: tag
integer :: comm
integer(C_INT) :: fresult 
type(SwigClassWrapper) :: farg1 
integer(C_INT) :: farg2 
integer(C_INT) :: farg3 
integer(C_INT) :: farg4 

farg1 = grid%swigdata
farg2 = source
farg3 = tag
farg4 = int(comm, C_INT)
fresult = swigc_tsgMPIGridRecv__SWIG_1(farg1, farg2, farg3, farg4)
swig_result = fresult
end function

function tsgMPIGridBcast(grid, root, comm) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
class(TasmanianSparseGrid), intent(in) :: grid
integer(C_INT), intent(in) :: root
integer :: comm
integer(C_INT) :: fresult 
type(SwigClassWrapper) :: farg1 
integer(C_INT) :: farg2 
integer(C_INT) :: farg3 

farg1 = grid%swigdata
farg2 = root
farg3 = int(comm, C_INT)
fresult = swigc_tsgMPIGridBcast(farg1, farg2, farg3)
swig_result = fresult
end function

function tsgMPIGridScatterOutputs(source, destination, root, tag, comm) &
result(swig_result)
use, intrinsic :: ISO_C_BINDING
integer(C_INT) :: swig_result
class(TasmanianSparseGrid), intent(in) :: source
class(TasmanianSparseGrid), intent(in) :: destination
integer(C_INT), intent(in) :: root
integer(C_INT), intent(in) :: tag
integer :: comm
integer(C_INT) :: fresult 
type(SwigClassWrapper) :: farg1 
type(SwigClassWrapper) :: farg2 
integer(C_INT) :: farg3 
integer(C_INT) :: farg4 
integer(C_INT) :: farg5 

farg1 = source%swigdata
farg2 = destination%swigdata
farg3 = root
farg4 = tag
farg5 = int(comm, C_INT)
fresult = swigc_tsgMPIGridScatterOutputs(farg1, farg2, farg3, farg4, farg5)
swig_result = fresult
end function


end module
