mp_deallocate_d Subroutine

private subroutine mp_deallocate_d(DATA, stat)

Deallocates special parallel memory

Arguments

Type IntentOptional Attributes Name
real(kind=real_8), DIMENSION(:), POINTER, CONTIGUOUS :: DATA

pointer to special memory to deallocate

integer, intent(out), optional :: stat

Source Code

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

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

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

         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_d