mp_allocate_z Subroutine

private subroutine mp_allocate_z(DATA, len, stat)

Allocates special parallel memory

Arguments

TypeIntentOptionalAttributesName
complex(kind=real_8), DIMENSION(:), POINTER, CONTIGUOUS:: DATA

pointer to integer array to allocate

integer, intent(in) :: len

number of integers to allocate

integer, intent(out), optional :: stat

allocation status result


Contents

Source Code


Source Code

      SUBROUTINE mp_allocate_z (DATA, len, stat)
      !! Allocates special parallel memory

         COMPLEX(kind=real_8), DIMENSION(:), POINTER, CONTIGUOUS :: DATA
         !! pointer to integer array to allocate
         INTEGER, INTENT(IN)                 :: len
         !! number of integers to allocate
         INTEGER, INTENT(OUT), OPTIONAL      :: stat
         !! allocation status result

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

         INTEGER                             :: ierr, handle

         CALL timeset(routineN, handle)

         ierr = 0
#if defined(__parallel)
         NULLIFY (DATA)
         CALL mp_alloc_mem(DATA, len, stat=ierr)
         IF (ierr /= 0 .AND. .NOT. PRESENT(stat)) &
            CALL mp_stop(ierr, "mpi_alloc_mem @ "//routineN)
#else
         ALLOCATE (DATA(len), stat=ierr)
         IF (ierr /= 0 .AND. .NOT. PRESENT(stat)) &
            CALL mp_stop(ierr, "ALLOCATE @ "//routineN)
#endif
         IF (PRESENT(stat)) stat = ierr
         CALL timestop(handle)
      END SUBROUTINE mp_allocate_z