!! This file is automatically generated by xmp_coarray_reduction.h.sh
!!
!! RESTRICTIONS in XMP/F
!!  - Quadruple precision real and complex are not supported.
!!  - The rank (number of dimensions) cannot exceed 7.
!!

!-----------------------------------------------------------------------
      interface xmpf_co_broadcast_generic
!-----------------------------------------------------------------------

      subroutine xmpf_co_broadcast0d_i2(source, source_image)
      integer(2), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_i4(source, source_image)
      integer(4), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_i8(source, source_image)
      integer(8), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_r4(source, source_image)
      real(4), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_r8(source, source_image)
      real(8), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_z8(source, source_image)
      complex(4), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_z16(source, source_image)
      complex(8), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_l2(source, source_image)
      logical(2), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast0d_l4(source, source_image)
      logical(4), intent(inout) :: source
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_i2(source, source_image)
      integer(2), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_i4(source, source_image)
      integer(4), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_i8(source, source_image)
      integer(8), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_r4(source, source_image)
      real(4), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_r8(source, source_image)
      real(8), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_z8(source, source_image)
      complex(4), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_z16(source, source_image)
      complex(8), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_l2(source, source_image)
      logical(2), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast1d_l4(source, source_image)
      logical(4), intent(inout) :: source(:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_i2(source, source_image)
      integer(2), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_i4(source, source_image)
      integer(4), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_i8(source, source_image)
      integer(8), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_r4(source, source_image)
      real(4), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_r8(source, source_image)
      real(8), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_z8(source, source_image)
      complex(4), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_z16(source, source_image)
      complex(8), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_l2(source, source_image)
      logical(2), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast2d_l4(source, source_image)
      logical(4), intent(inout) :: source(:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_i2(source, source_image)
      integer(2), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_i4(source, source_image)
      integer(4), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_i8(source, source_image)
      integer(8), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_r4(source, source_image)
      real(4), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_r8(source, source_image)
      real(8), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_z8(source, source_image)
      complex(4), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_z16(source, source_image)
      complex(8), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_l2(source, source_image)
      logical(2), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast3d_l4(source, source_image)
      logical(4), intent(inout) :: source(:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_i2(source, source_image)
      integer(2), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_i4(source, source_image)
      integer(4), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_i8(source, source_image)
      integer(8), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_r4(source, source_image)
      real(4), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_r8(source, source_image)
      real(8), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_z8(source, source_image)
      complex(4), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_z16(source, source_image)
      complex(8), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_l2(source, source_image)
      logical(2), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast4d_l4(source, source_image)
      logical(4), intent(inout) :: source(:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_i2(source, source_image)
      integer(2), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_i4(source, source_image)
      integer(4), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_i8(source, source_image)
      integer(8), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_r4(source, source_image)
      real(4), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_r8(source, source_image)
      real(8), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_z8(source, source_image)
      complex(4), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_z16(source, source_image)
      complex(8), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_l2(source, source_image)
      logical(2), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast5d_l4(source, source_image)
      logical(4), intent(inout) :: source(:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_i2(source, source_image)
      integer(2), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_i4(source, source_image)
      integer(4), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_i8(source, source_image)
      integer(8), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_r4(source, source_image)
      real(4), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_r8(source, source_image)
      real(8), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_z8(source, source_image)
      complex(4), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_z16(source, source_image)
      complex(8), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_l2(source, source_image)
      logical(2), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast6d_l4(source, source_image)
      logical(4), intent(inout) :: source(:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_i2(source, source_image)
      integer(2), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_i4(source, source_image)
      integer(4), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_i8(source, source_image)
      integer(8), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_r4(source, source_image)
      real(4), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_r8(source, source_image)
      real(8), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_z8(source, source_image)
      complex(4), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_z16(source, source_image)
      complex(8), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_l2(source, source_image)
      logical(2), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      subroutine xmpf_co_broadcast7d_l4(source, source_image)
      logical(4), intent(inout) :: source(:,:,:,:,:,:,:)
      integer(4), intent(in) :: source_image
      end subroutine

      end interface

!-----------------------------------------------------------------------
      interface xmpf_co_sum_generic
!-----------------------------------------------------------------------

      subroutine xmpf_co_sum0d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source
      integer(2), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum0d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source
      integer(4), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum0d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source
      integer(8), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum0d_r4(source, result, result_image)
      real(4), intent(inout)  :: source
      real(4), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum0d_r8(source, result, result_image)
      real(8), intent(inout)  :: source
      real(8), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum0d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source
      complex(4), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum0d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source
      complex(8), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum1d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:)
      integer(2), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum1d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:)
      integer(4), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum1d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:)
      integer(8), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum1d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:)
      real(4), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum1d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:)
      real(8), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum1d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source(:)
      complex(4), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum1d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source(:)
      complex(8), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum2d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:)
      integer(2), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum2d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:)
      integer(4), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum2d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:)
      integer(8), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum2d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:)
      real(4), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum2d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:)
      real(8), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum2d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source(:,:)
      complex(4), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum2d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source(:,:)
      complex(8), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum3d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:)
      integer(2), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum3d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:)
      integer(4), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum3d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:)
      integer(8), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum3d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:)
      real(4), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum3d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:)
      real(8), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum3d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source(:,:,:)
      complex(4), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum3d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source(:,:,:)
      complex(8), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum4d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum4d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum4d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum4d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum4d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum4d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source(:,:,:,:)
      complex(4), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum4d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source(:,:,:,:)
      complex(8), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum5d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum5d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum5d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum5d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum5d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum5d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source(:,:,:,:,:)
      complex(4), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum5d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source(:,:,:,:,:)
      complex(8), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum6d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum6d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum6d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum6d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum6d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum6d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source(:,:,:,:,:,:)
      complex(4), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum6d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source(:,:,:,:,:,:)
      complex(8), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum7d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum7d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum7d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum7d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum7d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum7d_z8(source, result, result_image)
      complex(4), intent(inout)  :: source(:,:,:,:,:,:,:)
      complex(4), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_sum7d_z16(source, result, result_image)
      complex(8), intent(inout)  :: source(:,:,:,:,:,:,:)
      complex(8), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      end interface

!-----------------------------------------------------------------------
      interface xmpf_co_max_generic
!-----------------------------------------------------------------------

      subroutine xmpf_co_max0d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source
      integer(2), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max0d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source
      integer(4), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max0d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source
      integer(8), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max0d_r4(source, result, result_image)
      real(4), intent(inout)  :: source
      real(4), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max0d_r8(source, result, result_image)
      real(8), intent(inout)  :: source
      real(8), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max1d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:)
      integer(2), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max1d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:)
      integer(4), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max1d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:)
      integer(8), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max1d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:)
      real(4), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max1d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:)
      real(8), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max2d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:)
      integer(2), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max2d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:)
      integer(4), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max2d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:)
      integer(8), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max2d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:)
      real(4), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max2d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:)
      real(8), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max3d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:)
      integer(2), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max3d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:)
      integer(4), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max3d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:)
      integer(8), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max3d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:)
      real(4), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max3d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:)
      real(8), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max4d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max4d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max4d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max4d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max4d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max5d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max5d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max5d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max5d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max5d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max6d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max6d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max6d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max6d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max6d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max7d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max7d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max7d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max7d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_max7d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      end interface

!-----------------------------------------------------------------------
      interface xmpf_co_min_generic
!-----------------------------------------------------------------------

      subroutine xmpf_co_min0d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source
      integer(2), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min0d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source
      integer(4), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min0d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source
      integer(8), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min0d_r4(source, result, result_image)
      real(4), intent(inout)  :: source
      real(4), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min0d_r8(source, result, result_image)
      real(8), intent(inout)  :: source
      real(8), intent(out), optional :: result
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min1d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:)
      integer(2), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min1d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:)
      integer(4), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min1d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:)
      integer(8), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min1d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:)
      real(4), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min1d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:)
      real(8), intent(out), optional :: result(:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min2d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:)
      integer(2), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min2d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:)
      integer(4), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min2d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:)
      integer(8), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min2d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:)
      real(4), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min2d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:)
      real(8), intent(out), optional :: result(:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min3d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:)
      integer(2), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min3d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:)
      integer(4), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min3d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:)
      integer(8), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min3d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:)
      real(4), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min3d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:)
      real(8), intent(out), optional :: result(:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min4d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min4d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min4d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min4d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min4d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min5d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min5d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min5d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min5d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min5d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min6d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min6d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min6d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min6d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min6d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min7d_i2(source, result, result_image)
      integer(2), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(2), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min7d_i4(source, result, result_image)
      integer(4), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(4), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min7d_i8(source, result, result_image)
      integer(8), intent(inout)  :: source(:,:,:,:,:,:,:)
      integer(8), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min7d_r4(source, result, result_image)
      real(4), intent(inout)  :: source(:,:,:,:,:,:,:)
      real(4), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      subroutine xmpf_co_min7d_r8(source, result, result_image)
      real(8), intent(inout)  :: source(:,:,:,:,:,:,:)
      real(8), intent(out), optional :: result(:,:,:,:,:,:,:)
      integer(4), intent(in), optional :: result_image
      end subroutine

      end interface

