%N memallop %F $MIR/src/subs/mem.for
%D Allocate memory
%P rjs
%: utilities
%B
        subroutine MemAllop(pnt,size,type)

        implicit none
        ptrdiff pnt
        integer size
        character type*1

  The MemAllop routine reserves a portion of blank common for its
  caller. It returns a pointer to the index in blank common of the
  reserved portion. The caller should declare an array in blank common
  of size MAXBUF integer elements.

  NOTE: If memallop is used by any routine, then ALL routines that
  use blank common MUST go through memallop/memfrep. Otherwise
  multiple routines may overwrite blank common.

  Typical usage would be something like:

       ptrdiff ipnt,rpnt,dpnt
       include 'maxdim.h'
       integer iData(MAXBUF)
       real rData(MAXBUF)
       double precision dData(MAXBUF/2)
       common iData
       equivalence(iData,rData,dData)

       call MemAllop(ipnt,1000,'i')
       call MemAllop(rpnt,1000,'r')
       call MemAllop(dpnt,1000,'d')

  After this sequence, 1000 integers are available from iData(ipnt),
                       1000 reals    are available from rData(rpnt), and
                       1000 doubles  are available from dData(dpnt).

  Input:
    type       The data type. Possible values are:
                 'i'   Integer.
                 'r'   Real.
                 'l'   Logical.
                 'd'   Double precision.
                 'c'   Complex.
    size       The number of elements to allocate.
  Output:
    pnt        Pointer to location in blank common, where the memory is.
               This is a FORTRAN index of an array of the appropriate
               type. That is, for double precision values, it will
               be an index into a double precision array.
