mp_win_create_dv Subroutine

private subroutine mp_win_create_dv(base, comm, win)

Window initialization function for vector data

Arguments

TypeIntentOptionalAttributesName
real(kind=real_8), CONTIGUOUS, DIMENSION(:):: base
integer, intent(in) :: comm
integer, intent(inout) :: win

Contents

Source Code


Source Code

      SUBROUTINE mp_win_create_dv(base, comm, win)
      !! Window initialization function for vector data
      !! @note
      !! arrays can be pointers or assumed shape, but they must be contiguous!

         REAL(kind=real_8), CONTIGUOUS, DIMENSION(:) :: base
         INTEGER, INTENT(IN)            :: comm
         INTEGER, INTENT(INOUT)         :: win

         CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_win_create_dv'

         INTEGER                        :: ierr, handle
#if defined(__parallel)
         INTEGER(kind=mpi_address_kind) :: len
         REAL(kind=real_8)                      :: foo(1)
#endif

         ierr = 0
         CALL timeset(routineN, handle)

#if defined(__parallel)

         len = SIZE(base)*real_8_size
         IF (len > 0) THEN
            CALL mpi_win_create(base(1), len, real_8_size, MPI_INFO_NULL, comm, win, ierr)
         ELSE
            CALL mpi_win_create(foo, len, real_8_size, MPI_INFO_NULL, comm, win, ierr)
         END IF
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_win_create @ "//routineN)
#else
         MARK_USED(base)
         MARK_USED(comm)
         win = mp_win_null
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_win_create_dv