allocate-GMRES.inc


#ifndef use_allocatable
# if defined(mms)
      memerr = .false.
# endif
# include "pointer_init-GMRES.inc"
#endif
#ifdef use_allocatable
      allocate(w(ia(_JT_nrows_)), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('w-GMRES', '-GMRES',
     &     ipw, (ia(_JT_nrows_)), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('w-GMRES', (ia(_JT_nrows_)), ipw, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      ipw = MALLOC (bytes_per_real*(ia(_JT_nrows_)))
      if (ipw .eq. 0) then
# elif defined(aix)
      ipw = MALLOC (%val(bytes_per_real*(ia(_JT_nrows_))))
      if (ipw .eq. 0) then
# elif defined(cray)
      call HPALLOC (ipw, (ia(_JT_nrows_)), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(c(iparm(_JT_nold_)+1), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('c-GMRES', '-GMRES',
     &     ipc, (iparm(_JT_nold_)+1), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('c-GMRES', (iparm(_JT_nold_)+1), ipc, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      ipc = MALLOC (bytes_per_real*(iparm(_JT_nold_)+1))
      if (ipc .eq. 0) then
# elif defined(aix)
      ipc = MALLOC (%val(bytes_per_real*(iparm(_JT_nold_)+1)))
      if (ipc .eq. 0) then
# elif defined(cray)
      call HPALLOC (ipc, (iparm(_JT_nold_)+1), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(s(iparm(_JT_nold_)+1), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('s-GMRES', '-GMRES',
     &     ips, (iparm(_JT_nold_)+1), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('s-GMRES', (iparm(_JT_nold_)+1), ips, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      ips = MALLOC (bytes_per_real*(iparm(_JT_nold_)+1))
      if (ips .eq. 0) then
# elif defined(aix)
      ips = MALLOC (%val(bytes_per_real*(iparm(_JT_nold_)+1)))
      if (ips .eq. 0) then
# elif defined(cray)
      call HPALLOC (ips, (iparm(_JT_nold_)+1), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(r(iparm(_JT_nold_)+1), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('r-GMRES', '-GMRES',
     &     ipr, (iparm(_JT_nold_)+1), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('r-GMRES', (iparm(_JT_nold_)+1), ipr, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      ipr = MALLOC (bytes_per_real*(iparm(_JT_nold_)+1))
      if (ipr .eq. 0) then
# elif defined(aix)
      ipr = MALLOC (%val(bytes_per_real*(iparm(_JT_nold_)+1)))
      if (ipr .eq. 0) then
# elif defined(cray)
      call HPALLOC (ipr, (iparm(_JT_nold_)+1), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(rt(iparm(_JT_nold_)+1), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('rt-GMRES', '-GMRES',
     &     iprt, (iparm(_JT_nold_)+1), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('rt-GMRES', (iparm(_JT_nold_)+1), iprt, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      iprt = MALLOC (bytes_per_real*(iparm(_JT_nold_)+1))
      if (iprt .eq. 0) then
# elif defined(aix)
      iprt = MALLOC (%val(bytes_per_real*(iparm(_JT_nold_)+1)))
      if (iprt .eq. 0) then
# elif defined(cray)
      call HPALLOC (iprt, (iparm(_JT_nold_)+1), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(h(iparm(_JT_nold_)+1,iparm(_JT_nold_)+1), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('h-GMRES', '-GMRES',
     &     iph, (iparm(_JT_nold_)+1)*(iparm(_JT_nold_)+1), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('h-GMRES', (iparm(_JT_nold_)+1)*(iparm(_JT_nold_)+1), iph, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      iph = MALLOC (bytes_per_real*(iparm(_JT_nold_)+1)*(iparm(_JT_nold_)+1))
      if (iph .eq. 0) then
# elif defined(aix)
      iph = MALLOC (%val(bytes_per_real*(iparm(_JT_nold_)+1)*(iparm(_JT_nold_)+1)))
      if (iph .eq. 0) then
# elif defined(cray)
      call HPALLOC (iph, (iparm(_JT_nold_)+1)*(iparm(_JT_nold_)+1), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(v(ia(_JT_nrows_),iparm(_JT_nold_)+1), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('v-GMRES', '-GMRES',
     &     ipv, (ia(_JT_nrows_))*(iparm(_JT_nold_)+1), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('v-GMRES', (ia(_JT_nrows_))*(iparm(_JT_nold_)+1), ipv, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      ipv = MALLOC (bytes_per_real*(ia(_JT_nrows_))*(iparm(_JT_nold_)+1))
      if (ipv .eq. 0) then
# elif defined(aix)
      ipv = MALLOC (%val(bytes_per_real*(ia(_JT_nrows_))*(iparm(_JT_nold_)+1)))
      if (ipv .eq. 0) then
# elif defined(cray)
      call HPALLOC (ipv, (ia(_JT_nrows_))*(iparm(_JT_nold_)+1), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(xold(ia(_JT_nrows_)), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('xold-GMR', '-GMRES',
     &     ipxold, (ia(_JT_nrows_)), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('xold-GMR', (ia(_JT_nrows_)), ipxold, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      ipxold = MALLOC (bytes_per_real*(ia(_JT_nrows_)))
      if (ipxold .eq. 0) then
# elif defined(aix)
      ipxold = MALLOC (%val(bytes_per_real*(ia(_JT_nrows_))))
      if (ipxold .eq. 0) then
# elif defined(cray)
      call HPALLOC (ipxold, (ia(_JT_nrows_)), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif
#ifdef use_allocatable
      allocate(xt(ia(_JT_nrows_)), stat=memerr)
      if (memerr .ne. 0) then
#else
# if defined(mmsl)
      call MMGETBLK ('xt-GMRES', '-GMRES',
     &     ipxt, (ia(_JT_nrows_)), 1, memerr)
      if (memerr .ne. 0) then
# elif defined(mms)
      call CGETVAR ('xt-GMRES', (ia(_JT_nrows_)), ipxt, memerr)
      if (memerr) then
# elif defined(sun) || defined(hpux) || defined(irix) || defined(osf1)
      ipxt = MALLOC (bytes_per_real*(ia(_JT_nrows_)))
      if (ipxt .eq. 0) then
# elif defined(aix)
      ipxt = MALLOC (%val(bytes_per_real*(ia(_JT_nrows_))))
      if (ipxt .eq. 0) then
# elif defined(cray)
      call HPALLOC (ipxt, (ia(_JT_nrows_)), memerr, 0)
      if (memerr .ne. 0) then
# endif
#endif
       status = -2
       goto 9999
      endif