MA_ALLOCATE_HEAP


     NAME
	  MA_allocate_heap - allocate a	heap block

     C SYNOPSIS
	  #include "macdecls.h"

	  Boolean MA_allocate_heap(datatype, nelem, name, memhandle)
	      Integer	  datatype;	  /* read-only */
	      Integer	  nelem;	  /* read-only */
	      char	  *name;	  /* read-only */
	      Integer	  *memhandle;	  /* write-only	*/

     FORTRAN SYNOPSIS
	  #include "mafdecls.h"

	  logical function MA_allocate_heap(datatype, nelem, name,
	  memhandle)
	      integer	  datatype
	      integer	  nelem
	      character*(*) name
	      integer	  memhandle

     DESCRIPTION
	  MA_allocate_heap() allocates a heap block large enough to
	  hold nelem elements of type datatype and associates name
	  with the block for debugging purposes. A handle for the
	  block	is returned in memhandle.

     DIAGNOSTICS
	  block	'%s', MA not yet initialized
	       MA_init() must be called	before this routine is called.
	  block	'%s', invalid datatype:	%d
	       datatype	must be	one of those listed in macdecls.h or
	       mafdecls.h.
	  block	'%s', invalid nelem: %d
	       nelem must be greater than zero.
	  block	'%s', not enough space to allocate %d bytes
	       Recovery	may be attempted by deallocating unneeded
	       blocks and resubmitting the request, or the application
	       may be rewritten	to request more	memory initially in
	       the call	to MA_init().

     RETURN VALUE
	  C: MA_TRUE upon success, MA_FALSE upon failure.
	  FORTRAN: .true. upon success,	.false.	upon failure.

     SEE ALSO
	  MA(3), MA_alloc_get(3), MA_free_heap(3), MA_get_index(3),
	  MA_get_pointer(3), MA_inquire_avail(3), MA_inquire_heap(3)

     AUTHOR
	  Gregory S. Thomas, Pacific Northwest Laboratory