mp_deallocate_i Subroutine

private subroutine mp_deallocate_i(DATA, stat)

Deallocates special parallel memory

Arguments

TypeIntentOptionalAttributesName
integer(kind=int_4), DIMENSION(:), POINTER, CONTIGUOUS:: DATA

pointer to special memory to deallocate

integer, intent(out), optional :: stat

Contents

Source Code


Source Code

      SUBROUTINE mp_deallocate_i (DATA, stat)
      !! Deallocates special parallel memory

         INTEGER(KIND=int_4), DIMENSION(:), POINTER, CONTIGUOUS :: DATA
         !! pointer to special memory to deallocate
         INTEGER, INTENT(OUT), OPTIONAL      :: stat

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

         INTEGER                             :: ierr, handle

         CALL timeset(routineN, handle)

         ierr = 0
#if defined(__parallel)
         CALL mp_free_mem(DATA, ierr)
         IF (PRESENT(stat)) THEN
            stat = ierr
         ELSE
            IF (ierr /= 0) CALL mp_stop(ierr, "mpi_free_mem @ "//routineN)
         END IF
         NULLIFY (DATA)
#else
         DEALLOCATE (DATA)
         IF (PRESENT(stat)) stat = 0
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_deallocate_i