      subroutine grav()
      implicit none
      integer npr, nbl, kbl, n
      parameter (npr=2)
      parameter (nbl=2)
      parameter (kbl=32)
      parameter (n=64)
      common /pghpf_0/pghpf_0, /pghpf_1/pghpf_1, /pghpf_0c/pghpf_0c
     +, /pghpf_lineno/pghpf_lineno
      integer pghpf_0, pghpf_1, pghpf_lineno
      character*1 pghpf_0c
      common /pghpf_nbbmod$0_10/ pghpf_nbbmod$0_10a
      integer pghpf_nbbmod$0_10a(1:4)
      common /pghpf_nbbmod$0_9/ pghpf_nbbmod$0_9a
      integer pghpf_nbbmod$0_9a(1:4)
      common /pghpf_nbbmod$0_8/ pghpf_nbbmod$0_8a
      integer pghpf_nbbmod$0_8a(1:4)
      common /pghpf_nbbmod$0_7/ pghpf_nbbmod$0_7a
      integer pghpf_nbbmod$0_7a(1:4)
      common /pghpf_nbbmod$0_6/ pghpf_nbbmod$0_6a
      integer pghpf_nbbmod$0_6a(1:4)
      common /pghpf_nbbmod$0_5/ pghpf_nbbmod$0_5a
      integer pghpf_nbbmod$0_5a(1:4)
      common /pghpf_nbbmod$0_4/ pghpf_nbbmod$0_4a
      integer pghpf_nbbmod$0_4a(1:4)
      common /pghpf_nbbmod$0_3/ pghpf_nbbmod$0_3a
      integer pghpf_nbbmod$0_3a(1:4)
      common /pghpf_nbbmod$0_2/ pghpf_nbbmod$0_2a
      integer pghpf_nbbmod$0_2a(1:4)
      common /pghpf_nbbmod$0_1/ pghpf_nbbmod$0_1a
      integer pghpf_nbbmod$0_1a(1:4)
      common /pghpf_nbbmod$0_0/ nb,g
      integer nb
      real g
      integer b(1), i(1), p(1), k, lm, i$i, i$i1, i$i2, i$i3, i$i4, i$i5
     +, i$i6, procs$d(1), m1, m2, cnv$r$s(1), cnv$r$f$s(1), cnv$s(1), 
     +cnv$r$s1(1), cnv$r$f1$s(1), cnv$s1(1), cnv$tl$d(1), i$l, i$u, i$l1
     +, i$u1, i$l2, i$u2, i$l3, i$u3, i$l4, i$u4, i$l5, i$u5, i$l6, i$u6
     +, i$l7, i$u7, i$l8, i$u8, i$l9, i$u9, i$l10, i$u10, i$l11, i$u11, 
     +i$l12, i$u12, i$l13, i$u13, i$l14, i$u14, i$l15, i$u15, 
     +cnv$tl$tl$d(1), cnv$f$d(1), cnv$f$d1(1), l$b, u$b, l$b1, u$b1, 
     +l$b2, u$b2, cnv$tl$tl1$d(1), cnv$f1$d(1), cnv$f1$d1(1), l$b3, u$b3
     +, l$b4, u$b4, l$b5, u$b5, cnv$tl$tl2$d(1), cnv$r$d(1), cnv$r$d1(1)
     +, l$b6, u$b6, l$b7, u$b7, l$b8, u$b8, cnv$tl$tl3$d(1), cnv$r$f$d(1
     +), cnv$r$f$d1(1), l$b9, u$b9, l$b10, u$b10, l$b11, u$b11, 
     +cnv$tl$tl4$d(1), cnv$r1$d(1), cnv$r1$d1(1), l$b12, u$b12, l$b13, 
     +u$b13, l$b14, u$b14, cnv$tl$tl4$d1(1), cnv$d(1), p$d(1), ac$d(1), 
     +cnv$d1(1), p$d1(1), gm$d(1), ac$d1(1), l$b15, u$b15, l$b16, u$b16
     +, l$b17, u$b17, l$b18, u$b18, l$b19, u$b19, l$b20, u$b20, l$b21, 
     +u$b21, l$b22, u$b22, l$b23, u$b23, l$b24, u$b24
      real x0(1), x1(1), v0(1), v1(1), ac(1), m(1), gm(1), cnv(1), cnv$r
     +(1), cnv$r1(1), cnv$r$f(1), cnv$r$f1(1), cnv$f(1), cnv$f1(1)
      integer cp, xfer, cp1, xfer1, cp2, xfer2, cp3, xfer3
      integer x0$p, x1$p, v0$p, v1$p, ac$p, m$p, gm$p, b$p, i$p, p$p, 
     +cnv$p, procs$dp, cnv$r$p, cnv$r1$p, cnv$r$sp, cnv$r$f$p, 
     +cnv$r$f$sp, cnv$sp, cnv$r$sp1, cnv$r$f1$p, cnv$r$f1$sp, cnv$sp1, 
     +cnv$tl$dp, cnv$f$p, cnv$f1$p, cnv$tl$tl$dp, cnv$f$dp, cnv$f$dp1, 
     +cnv$tl$tl1$dp, cnv$f1$dp, cnv$f1$dp1, cnv$tl$tl2$dp, cnv$r$dp, 
     +cnv$r$dp1, cnv$tl$tl3$dp, cnv$r$f$dp, cnv$r$f$dp1, cnv$tl$tl4$dp, 
     +cnv$r1$dp, cnv$r1$dp1, cnv$tl$tl4$dp1, cnv$dp, p$dp, ac$dp, 
     +cnv$dp1, p$dp1, gm$dp, ac$dp1
      integer pghpf_comm_shift, pghpf_comm_start, pghpf_sect, 
     +pghpf_comm_copy, pghpf_newproc
      external gblock
      procs$dp = pghpf_newproc(1,2)
      call pghpf_ptr_offset(procs$dp,procs$dp,procs$d,25)
      call pghpf_template(p$dp,2,1280,procs$d(procs$dp),2,0,0,1,0,31)
      call pghpf_ptr_offset(p$dp,p$dp,p$d,25)
      call pghpf_instance(p$dp1,p$d(p$dp),25,4,2,4,4)
      call pghpf_ptr_offset(p$dp1,p$dp1,p$d1,25)
      call pghpf_common('pghpf_nbbmod$0_10',pghpf_nbbmod$0_10a,1,p$d1(
     +p$dp1))
      p$p = pghpf_nbbmod$0_10a(3)
      call pghpf_ptr_offset(p$p,p$p,p,25)
      call pghpf_allobnds(p$d1(p$dp1),l$b15,u$b15,l$b16,u$b16)
      call pghpf_common('pghpf_nbbmod$0_9',pghpf_nbbmod$0_9a,1,p$d1(
     +p$dp1))
      i$p = pghpf_nbbmod$0_9a(3)
      call pghpf_ptr_offset(i$p,i$p,i,25)
      call pghpf_common('pghpf_nbbmod$0_8',pghpf_nbbmod$0_8a,1,p$d1(
     +p$dp1))
      b$p = pghpf_nbbmod$0_8a(3)
      call pghpf_ptr_offset(b$p,b$p,b,25)
      call pghpf_instance(gm$dp,p$d(p$dp),27,4,2,4,4)
      call pghpf_ptr_offset(gm$dp,gm$dp,gm$d,25)
      call pghpf_common('pghpf_nbbmod$0_7',pghpf_nbbmod$0_7a,1,gm$d(
     +gm$dp))
      gm$p = pghpf_nbbmod$0_7a(3)
      call pghpf_ptr_offset(gm$p,gm$p,gm,27)
      call pghpf_allobnds(gm$d(gm$dp),l$b17,u$b17,l$b18,u$b18)
      call pghpf_common('pghpf_nbbmod$0_6',pghpf_nbbmod$0_6a,1,gm$d(
     +gm$dp))
      m$p = pghpf_nbbmod$0_6a(3)
      call pghpf_ptr_offset(m$p,m$p,m,27)
      call pghpf_template(ac$dp,3,1280,procs$d(procs$dp),6,0,0,1,0,31,1,
     +3)
      call pghpf_ptr_offset(ac$dp,ac$dp,ac$d,25)
      call pghpf_instance(ac$dp1,ac$d(ac$dp),27,4,6,4,4)
      call pghpf_ptr_offset(ac$dp1,ac$dp1,ac$d1,25)
      call pghpf_common('pghpf_nbbmod$0_5',pghpf_nbbmod$0_5a,1,ac$d1(
     +ac$dp1))
      ac$p = pghpf_nbbmod$0_5a(3)
      call pghpf_ptr_offset(ac$p,ac$p,ac,27)
      call pghpf_allobnds(ac$d1(ac$dp1),l$b19,u$b19,l$b20,u$b20,l$b21,
     +u$b21)
      call pghpf_common('pghpf_nbbmod$0_4',pghpf_nbbmod$0_4a,1,ac$d1(
     +ac$dp1))
      v1$p = pghpf_nbbmod$0_4a(3)
      call pghpf_ptr_offset(v1$p,v1$p,v1,27)
      call pghpf_common('pghpf_nbbmod$0_3',pghpf_nbbmod$0_3a,1,ac$d1(
     +ac$dp1))
      v0$p = pghpf_nbbmod$0_3a(3)
      call pghpf_ptr_offset(v0$p,v0$p,v0,27)
      call pghpf_common('pghpf_nbbmod$0_2',pghpf_nbbmod$0_2a,1,ac$d1(
     +ac$dp1))
      x1$p = pghpf_nbbmod$0_2a(3)
      call pghpf_ptr_offset(x1$p,x1$p,x1,27)
      call pghpf_common('pghpf_nbbmod$0_1',pghpf_nbbmod$0_1a,1,ac$d1(
     +ac$dp1))
      x0$p = pghpf_nbbmod$0_1a(3)
      call pghpf_ptr_offset(x0$p,x0$p,x0,27)
      call pghpf_template(cnv$dp,3,1280,procs$d(procs$dp),6,0,0,1,0,31,0
     +,9)
      call pghpf_ptr_offset(cnv$dp,cnv$dp,cnv$d,25)
      call pghpf_instance(cnv$dp1,cnv$d(cnv$dp),27,4,6,4,4)
      call pghpf_ptr_offset(cnv$dp1,cnv$dp1,cnv$d1,25)
      call pghpf_allobnds(cnv$d1(cnv$dp1),l$b22,u$b22,l$b23,u$b23,l$b24,
     +u$b24)
      call pgf90_alloc((u$b24-l$b24+1)*((u$b22-l$b22+1)*(u$b23-l$b23+1))
     +,27,pghpf_0,pghpf_0,cnv$p,cnv)
      call pghpf_localize_bounds(ac$d1(ac$dp1),1,0,1,1,i$l,i$u)
!     forall (i$i=1:3:1, i$i1=0:31:1, i$i2=i$l:i$u:1) ac(((i$i-l$b21)*(
!    +u$b20-l$b20+1)+i$i1-l$b20)*(u$b19-l$b19+1)+i$i2-l$b19+ac$p) = 0.0
      do i$i = 1, 3
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               ac(((i$i-l$b21)*(u$b20-l$b20+1)+i$i1-l$b20)*(u$b19-l$b19+
     +1)+i$i2-l$b19+ac$p) = 0.0
            enddo
         enddo
      enddo
!     forall (i$i=0:2:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv((u$b22-l$b22+1
!    +)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p) = 0.0
      do i$i = 0, 2
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
     +l$b23)+i$i2-l$b22+cnv$p) = 0.0
            enddo
         enddo
      enddo
!     forall (i$i=3:5:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv((u$b22-l$b22+1
!    +)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p) = x0(
!    +(u$b19-l$b19+1)*((u$b20-l$b20+1)*(i$i-2-l$b21)+i$i1-l$b20)+i$i2-
!    +l$b19+x0$p)
      do i$i = 3, 5
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
     +l$b23)+i$i2-l$b22+cnv$p) = x0((u$b19-l$b19+1)*((u$b20-l$b20+1)*(
     +i$i-2-l$b21)+i$i1-l$b20)+i$i2-l$b19+x0$p)
            enddo
         enddo
      enddo
!     forall (i$i=6:8:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv((u$b22-l$b22+1
!    +)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p) = x1(
!    +(u$b19-l$b19+1)*((u$b20-l$b20+1)*(i$i-5-l$b21)+i$i1-l$b20)+i$i2-
!    +l$b19+x1$p)
      do i$i = 6, 8
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
     +l$b23)+i$i2-l$b22+cnv$p) = x1((u$b19-l$b19+1)*((u$b20-l$b20+1)*(
     +i$i-5-l$b21)+i$i1-l$b20)+i$i2-l$b19+x1$p)
            enddo
         enddo
      enddo
!     forall (i$i=0:31:1, i$i1=i$l:i$u:1) cnv((u$b22-l$b22+1)*((u$b23-
!    +l$b23+1)*(9-l$b24)+i$i-l$b23)+i$i1-l$b22+cnv$p) = gm((i$i-l$b18)*(
!    +u$b17-l$b17+1)+i$i1-l$b17+gm$p)
      do i$i = 0, 31
         do i$i1 = i$l, i$u
            cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(9-l$b24)+i$i-l$b23)+
     +i$i1-l$b22+cnv$p) = gm((i$i-l$b18)*(u$b17-l$b17+1)+i$i1-l$b17+gm$p
     +)
         enddo
      enddo
      call gblock(cnv(cnv$p),2,2,cnv$d1(cnv$dp1),pghpf_1,pghpf_1)
      lm = 0
      cp = pghpf_comm_shift(cnv(cnv$p),cnv$d1(cnv$dp1),0,1,0,0,0,0)
      do k = 1, lm
         xfer = pghpf_comm_start(cp,cnv(cnv$p),cnv$d1(cnv$dp1),cnv(cnv$p
     +),cnv$d1(cnv$dp1))
         call pghpf_comm_finish(xfer)
         call pghpf_template(cnv$tl$tl$dp,1,1280,procs$d(procs$dp),0,0,0
     +,1)
         call pghpf_ptr_offset(cnv$tl$tl$dp,cnv$tl$tl$dp,cnv$tl$tl$d,25)
         call pghpf_template(cnv$f$dp,3,4096,cnv$tl$tl$d(cnv$tl$tl$dp),0
     +,6,1,1,0,0,0,1,0,31,0,9)
         call pghpf_ptr_offset(cnv$f$dp,cnv$f$dp,cnv$f$d,25)
         call pghpf_instance(cnv$f$dp1,cnv$f$d(cnv$f$dp),27,4,6,4,4)
         call pghpf_ptr_offset(cnv$f$dp1,cnv$f$dp1,cnv$f$d1,25)
         call pghpf_allobnds(cnv$f$d1(cnv$f$dp1),l$b,u$b,l$b1,u$b1,l$b2,
     +u$b2)
         call pgf90_alloc((u$b2-l$b2+1)*((u$b-l$b+1)*(u$b1-l$b1+1)),27,
     +pghpf_0,pghpf_0,cnv$f$p,cnv$f)
!        forall (i$i=0:9:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv$f((u$b-l$b+
!    +1)*((u$b1-l$b1+1)*(i$i-l$b2)+i$i1-l$b1)+i$i2-l$b+cnv$f$p) = cnv(
!    +i$i2-1+(u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)-
!    +l$b22+cnv$p)
         do i$i = 0, 9
            do i$i1 = 0, 31
               do i$i2 = i$l, i$u
                  cnv$f((u$b-l$b+1)*((u$b1-l$b1+1)*(i$i-l$b2)+i$i1-l$b1)
     ++i$i2-l$b+cnv$f$p) = cnv(i$i2-1+(u$b22-l$b22+1)*((u$b23-l$b23+1)*(
     +i$i-l$b24)+i$i1-l$b23)-l$b22+cnv$p)
               enddo
            enddo
         enddo
!        forall (i$i=0:9:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv((u$b22-
!    +l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p
!    +) = cnv$f((u$b-l$b+1)*((u$b1-l$b1+1)*(i$i-l$b2)+i$i1-l$b1)+i$i2-
!    +l$b+cnv$f$p)
         do i$i = 0, 9
            do i$i1 = 0, 31
               do i$i2 = i$l, i$u
                  cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
     +l$b23)+i$i2-l$b22+cnv$p) = cnv$f((u$b-l$b+1)*((u$b1-l$b1+1)*(i$i-
     +l$b2)+i$i1-l$b1)+i$i2-l$b+cnv$f$p)
               enddo
            enddo
         enddo
         call pghpf_freen(3,cnv$tl$tl$d(cnv$tl$tl$dp),cnv$f$d(cnv$f$dp),
     +cnv$f$d1(cnv$f$dp1))
         call pgf90_deallocate(cnv$f(cnv$f$p),pghpf_0)
         call gblock(cnv(cnv$p),2,1,cnv$d1(cnv$dp1),pghpf_1,pghpf_1)
      enddo
      call pghpf_comm_free(1,cp)
      cp1 = pghpf_comm_shift(cnv(cnv$p),cnv$d1(cnv$dp1),0,1,0,0,0,0)
      xfer1 = pghpf_comm_start(cp1,cnv(cnv$p),cnv$d1(cnv$dp1),cnv(cnv$p)
     +,cnv$d1(cnv$dp1))
      call pghpf_comm_finish(xfer1)
      call pghpf_template(cnv$tl$tl1$dp,1,1280,procs$d(procs$dp),0,0,0,1
     +)
      call pghpf_ptr_offset(cnv$tl$tl1$dp,cnv$tl$tl1$dp,cnv$tl$tl1$d,25)
      call pghpf_template(cnv$f1$dp,3,4096,cnv$tl$tl1$d(cnv$tl$tl1$dp),0
     +,6,1,1,0,0,0,1,0,31,0,9)
      call pghpf_ptr_offset(cnv$f1$dp,cnv$f1$dp,cnv$f1$d,25)
      call pghpf_instance(cnv$f1$dp1,cnv$f1$d(cnv$f1$dp),27,4,6,4,4)
      call pghpf_ptr_offset(cnv$f1$dp1,cnv$f1$dp1,cnv$f1$d1,25)
      call pghpf_allobnds(cnv$f1$d1(cnv$f1$dp1),l$b3,u$b3,l$b4,u$b4,l$b5
     +,u$b5)
      call pgf90_alloc((u$b5-l$b5+1)*((u$b3-l$b3+1)*(u$b4-l$b4+1)),27,
     +pghpf_0,pghpf_0,cnv$f1$p,cnv$f1)
!     forall (i$i=0:9:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv$f1((u$b3-l$b3+
!    +1)*((u$b4-l$b4+1)*(i$i-l$b5)+i$i1-l$b4)+i$i2-l$b3+cnv$f1$p) = cnv(
!    +i$i2-1+(u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)-
!    +l$b22+cnv$p)
      do i$i = 0, 9
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               cnv$f1((u$b3-l$b3+1)*((u$b4-l$b4+1)*(i$i-l$b5)+i$i1-l$b4)
     ++i$i2-l$b3+cnv$f1$p) = cnv(i$i2-1+(u$b22-l$b22+1)*((u$b23-l$b23+1)
     +*(i$i-l$b24)+i$i1-l$b23)-l$b22+cnv$p)
            enddo
         enddo
      enddo
!     forall (i$i=0:9:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv((u$b22-l$b22+1
!    +)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p) = 
!    +cnv$f1((u$b3-l$b3+1)*((u$b4-l$b4+1)*(i$i-l$b5)+i$i1-l$b4)+i$i2-
!    +l$b3+cnv$f1$p)
      do i$i = 0, 9
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
     +l$b23)+i$i2-l$b22+cnv$p) = cnv$f1((u$b3-l$b3+1)*((u$b4-l$b4+1)*(
     +i$i-l$b5)+i$i1-l$b4)+i$i2-l$b3+cnv$f1$p)
            enddo
         enddo
      enddo
      call pghpf_freen(3,cnv$tl$tl1$d(cnv$tl$tl1$dp),cnv$f1$d(cnv$f1$dp)
     +,cnv$f1$d1(cnv$f1$dp1))
      call pgf90_deallocate(cnv$f1(cnv$f1$p),pghpf_0)
      call pghpf_comm_free(1,cp1)
      lm = 1
      call gblock(cnv(cnv$p),1,1,cnv$d1(cnv$dp1),pghpf_1,pghpf_1)
      call pghpf_template(cnv$tl$tl2$dp,1,1280,procs$d(procs$dp),0,0,0,1
     +)
      call pghpf_ptr_offset(cnv$tl$tl2$dp,cnv$tl$tl2$dp,cnv$tl$tl2$d,25)
      call pghpf_template(cnv$r$dp,3,4096,cnv$tl$tl2$d(cnv$tl$tl2$dp),0,
     +6,1,1,0,0,0,1,0,31,0,9)
      call pghpf_ptr_offset(cnv$r$dp,cnv$r$dp,cnv$r$d,25)
      call pghpf_instance(cnv$r$dp1,cnv$r$d(cnv$r$dp),27,4,6,4,4)
      call pghpf_ptr_offset(cnv$r$dp1,cnv$r$dp1,cnv$r$d1,25)
      call pghpf_allobnds(cnv$r$d1(cnv$r$dp1),l$b6,u$b6,l$b7,u$b7,l$b8,
     +u$b8)
      call pgf90_alloc((u$b8-l$b8+1)*((u$b6-l$b6+1)*(u$b7-l$b7+1)),27,
     +pghpf_0,pghpf_0,cnv$r$p,cnv$r)
      m1 = mod(lm,2)
      if (m1 .lt. 0) then
         m1 = m1 + 2
      endif
      if (m1 .ne. 0) then
         cnv$r$sp = pghpf_sect(cnv$r$d1(cnv$r$dp1),0,1 - m1,1,0,31,1,0,2
     +,1,7)
         call pghpf_ptr_offset(cnv$r$sp,cnv$r$sp,cnv$r$s,25)
         call pghpf_template(cnv$tl$tl3$dp,1,1280,procs$d(procs$dp),0,0,
     +0,1)
         call pghpf_ptr_offset(cnv$tl$tl3$dp,cnv$tl$tl3$dp,cnv$tl$tl3$d,
     +25)
         call pghpf_template(cnv$r$f$dp,3,4096,cnv$tl$tl3$d(
     +cnv$tl$tl3$dp),0,6,1,1,0,0,0,1,0,31,0,9)
         call pghpf_ptr_offset(cnv$r$f$dp,cnv$r$f$dp,cnv$r$f$d,25)
         call pghpf_instance(cnv$r$f$dp1,cnv$r$f$d(cnv$r$f$dp),27,4,6,4,
     +4)
         call pghpf_ptr_offset(cnv$r$f$dp1,cnv$r$f$dp1,cnv$r$f$d1,25)
         call pghpf_allobnds(cnv$r$f$d1(cnv$r$f$dp1),l$b9,u$b9,l$b10,
     +u$b10,l$b11,u$b11)
         call pgf90_alloc((u$b11-l$b11+1)*((u$b9-l$b9+1)*(u$b10-l$b10+1)
     +),27,pghpf_0,pghpf_0,cnv$r$f$p,cnv$r$f)
         cnv$sp = pghpf_sect(cnv$d1(cnv$dp1),m1,1,1,0,31,1,0,2,1,7)
         call pghpf_ptr_offset(cnv$sp,cnv$sp,cnv$s,25)
         cp2 = pghpf_comm_copy(cnv$r(cnv$r$p),cnv(cnv$p),cnv$r$s(
     +cnv$r$sp),cnv$s(cnv$sp))
         xfer2 = pghpf_comm_start(cp2,cnv$r(cnv$r$p),cnv$r$s(cnv$r$sp),
     +cnv(cnv$p),cnv$s(cnv$sp))
         call pghpf_comm_finish(xfer2)
         call pghpf_localize_bounds(cnv$r$d1(cnv$r$dp1),1,0,1 - m1,1,
     +i$l7,i$u7)
         call pghpf_comm_free(1,cp2)
         call pghpf_free(cnv$s(cnv$sp))
         call pghpf_free(cnv$r$s(cnv$r$sp))
         cnv$r$sp1 = pghpf_sect(cnv$r$d1(cnv$r$dp1),2 - m1,1,1,0,31,1,0,
     +2,1,7)
         call pghpf_ptr_offset(cnv$r$sp1,cnv$r$sp1,cnv$r$s1,25)
         cnv$sp1 = pghpf_sect(cnv$d1(cnv$dp1),0,1 - (2 - m1),1,0,31,1,0,
     +2,1,7)
         call pghpf_ptr_offset(cnv$sp1,cnv$sp1,cnv$s1,25)
         cp3 = pghpf_comm_copy(cnv$r(cnv$r$p),cnv(cnv$p),cnv$r$s1(
     +cnv$r$sp1),cnv$s1(cnv$sp1))
         xfer3 = pghpf_comm_start(cp3,cnv$r(cnv$r$p),cnv$r$s1(cnv$r$sp1)
     +,cnv(cnv$p),cnv$s1(cnv$sp1))
         call pghpf_comm_finish(xfer3)
         call pghpf_localize_bounds(cnv$r$d1(cnv$r$dp1),1,2 - m1,1,1,
     +i$l8,i$u8)
         call pghpf_comm_free(1,cp3)
         call pghpf_free(cnv$s1(cnv$sp1))
         call pghpf_free(cnv$r$s1(cnv$r$sp1))
         call pghpf_freen(3,cnv$tl$tl3$d(cnv$tl$tl3$dp),cnv$r$f$d(
     +cnv$r$f$dp),cnv$r$f$d1(cnv$r$f$dp1))
         call pgf90_deallocate(cnv$r$f(cnv$r$f$p),pghpf_0)
      else
!        forall (i$i=0:2:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv$r((u$b6-
!    +l$b6+1)*((u$b7-l$b7+1)*(i$i-l$b8)+i$i1-l$b7)+i$i2-l$b6+cnv$r$p) = 
!    +cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-
!    +l$b22+cnv$p)
         do i$i = 0, 2
            do i$i1 = 0, 31
               do i$i2 = i$l, i$u
                  cnv$r((u$b6-l$b6+1)*((u$b7-l$b7+1)*(i$i-l$b8)+i$i1-
     +l$b7)+i$i2-l$b6+cnv$r$p) = cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(
     +i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p)
               enddo
            enddo
         enddo
      endif
!     forall (i$i=0:2:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv((u$b22-l$b22+1
!    +)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p) = 
!    +cnv$r((u$b6-l$b6+1)*((u$b7-l$b7+1)*(i$i-l$b8)+i$i1-l$b7)+i$i2-l$b6
!    ++cnv$r$p)
      do i$i = 0, 2
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
     +l$b23)+i$i2-l$b22+cnv$p) = cnv$r((u$b6-l$b6+1)*((u$b7-l$b7+1)*(i$i
     +-l$b8)+i$i1-l$b7)+i$i2-l$b6+cnv$r$p)
            enddo
         enddo
      enddo
      call pghpf_freen(3,cnv$tl$tl2$d(cnv$tl$tl2$dp),cnv$r$d(cnv$r$dp),
     +cnv$r$d1(cnv$r$dp1))
      call pgf90_deallocate(cnv$r(cnv$r$p),pghpf_0)
      call pghpf_template(cnv$tl$tl4$dp,1,1280,procs$d(procs$dp),0,0,0,1
     +)
      call pghpf_ptr_offset(cnv$tl$tl4$dp,cnv$tl$tl4$dp,cnv$tl$tl4$d,25)
      call pghpf_template(cnv$r1$dp,3,4096,cnv$tl$tl4$d(cnv$tl$tl4$dp),0
     +,6,1,1,0,0,0,1,0,31,0,9)
      call pghpf_ptr_offset(cnv$r1$dp,cnv$r1$dp,cnv$r1$d,25)
      call pghpf_instance(cnv$r1$dp1,cnv$r1$d(cnv$r1$dp),27,4,6,4,4)
      call pghpf_ptr_offset(cnv$r1$dp1,cnv$r1$dp1,cnv$r1$d1,25)
      call pghpf_allobnds(cnv$r1$d1(cnv$r1$dp1),l$b12,u$b12,l$b13,u$b13,
     +l$b14,u$b14)
      call pgf90_alloc((u$b14-l$b14+1)*((u$b12-l$b12+1)*(u$b13-l$b13+1))
     +,27,pghpf_0,pghpf_0,cnv$r1$p,cnv$r1)
      m2 = mod(16 - lm,32)
      if (m2 .lt. 0) then
         m2 = m2 + 32
      endif
      if (m2 .ne. 0) then
!        forall (i$i=0:2:1, i$i1=0:31 - m2:1, i$i2=i$l:i$u:1) cnv$r1((
!    +u$b12-l$b12+1)*((u$b13-l$b13+1)*(i$i-l$b14)+i$i1-l$b13)+i$i2-l$b12
!    ++cnv$r1$p) = cnv((u$b22-l$b22+1)*(m2+i$i1+(u$b23-l$b23+1)*(i$i-
!    +l$b24)-l$b23)+i$i2-l$b22+cnv$p)
         do i$i = 0, 2
            do i$i1 = 0, 31 - m2
               do i$i2 = i$l, i$u
                  cnv$r1((u$b12-l$b12+1)*((u$b13-l$b13+1)*(i$i-l$b14)+
     +i$i1-l$b13)+i$i2-l$b12+cnv$r1$p) = cnv((u$b22-l$b22+1)*(m2+i$i1+(
     +u$b23-l$b23+1)*(i$i-l$b24)-l$b23)+i$i2-l$b22+cnv$p)
               enddo
            enddo
         enddo
!        forall (i$i=0:2:1, i$i1=32 - m2:31:1, i$i2=i$l:i$u:1) cnv$r1((
!    +u$b12-l$b12+1)*((u$b13-l$b13+1)*(i$i-l$b14)+i$i1-l$b13)+i$i2-l$b12
!    ++cnv$r1$p) = cnv((u$b22-l$b22+1)*(i$i1-(32-m2)+(u$b23-l$b23+1)*(
!    +i$i-l$b24)-l$b23)+i$i2-l$b22+cnv$p)
         do i$i = 0, 2
            do i$i1 = 32 - m2, 31
               do i$i2 = i$l, i$u
                  cnv$r1((u$b12-l$b12+1)*((u$b13-l$b13+1)*(i$i-l$b14)+
     +i$i1-l$b13)+i$i2-l$b12+cnv$r1$p) = cnv((u$b22-l$b22+1)*(i$i1-(32-
     +m2)+(u$b23-l$b23+1)*(i$i-l$b24)-l$b23)+i$i2-l$b22+cnv$p)
               enddo
            enddo
         enddo
      else
!        forall (i$i=0:2:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv$r1((u$b12-
!    +l$b12+1)*((u$b13-l$b13+1)*(i$i-l$b14)+i$i1-l$b13)+i$i2-l$b12+
!    +cnv$r1$p) = cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
!    +l$b23)+i$i2-l$b22+cnv$p)
         do i$i = 0, 2
            do i$i1 = 0, 31
               do i$i2 = i$l, i$u
                  cnv$r1((u$b12-l$b12+1)*((u$b13-l$b13+1)*(i$i-l$b14)+
     +i$i1-l$b13)+i$i2-l$b12+cnv$r1$p) = cnv((u$b22-l$b22+1)*((u$b23-
     +l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p)
               enddo
            enddo
         enddo
      endif
!     forall (i$i=0:2:1, i$i1=0:31:1, i$i2=i$l:i$u:1) cnv((u$b22-l$b22+1
!    +)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p) = 
!    +cnv$r1((u$b12-l$b12+1)*((u$b13-l$b13+1)*(i$i-l$b14)+i$i1-l$b13)+
!    +i$i2-l$b12+cnv$r1$p)
      do i$i = 0, 2
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-
     +l$b23)+i$i2-l$b22+cnv$p) = cnv$r1((u$b12-l$b12+1)*((u$b13-l$b13+1)
     +*(i$i-l$b14)+i$i1-l$b13)+i$i2-l$b12+cnv$r1$p)
            enddo
         enddo
      enddo
      call pghpf_freen(3,cnv$tl$tl4$d(cnv$tl$tl4$dp),cnv$r1$d(cnv$r1$dp)
     +,cnv$r1$d1(cnv$r1$dp1))
      call pgf90_deallocate(cnv$r1(cnv$r1$p),pghpf_0)
!     forall (i$i=1:3:1, i$i1=0:31:1, i$i2=i$l:i$u:1) ac(((i$i-l$b21)*(
!    +u$b20-l$b20+1)+i$i1-l$b20)*(u$b19-l$b19+1)+i$i2-l$b19+ac$p) = ac((
!    +(i$i-l$b21)*(u$b20-l$b20+1)+i$i1-l$b20)*(u$b19-l$b19+1)+i$i2-l$b19
!    ++ac$p) + cnv((u$b22-l$b22+1)*((u$b23-l$b23+1)*(i$i-1-l$b24)+i$i1-
!    +l$b23)+i$i2-l$b22+cnv$p)
      do i$i = 1, 3
         do i$i1 = 0, 31
            do i$i2 = i$l, i$u
               ac(((i$i-l$b21)*(u$b20-l$b20+1)+i$i1-l$b20)*(u$b19-l$b19+
     +1)+i$i2-l$b19+ac$p) = ac(((i$i-l$b21)*(u$b20-l$b20+1)+i$i1-l$b20)*
     +(u$b19-l$b19+1)+i$i2-l$b19+ac$p) + cnv((u$b22-l$b22+1)*((u$b23-
     +l$b23+1)*(i$i-1-l$b24)+i$i1-l$b23)+i$i2-l$b22+cnv$p)
            enddo
         enddo
      enddo
99999 continue
      call pghpf_freen(8,procs$d(procs$dp),p$d(p$dp),p$d1(p$dp1),gm$d(
     +gm$dp),ac$d(ac$dp),ac$d1(ac$dp1),cnv$d(cnv$dp),cnv$d1(cnv$dp1))
      call pgf90_deallocate(cnv(cnv$p),pghpf_0)
      end
      subroutine gblock(cnv$b,ways,dist,cnv$s0,ways$s0,dist$s0)
      implicit none
      integer npr, nbl, kbl, n
      parameter (npr=2)
      parameter (nbl=2)
      parameter (kbl=32)
      parameter (n=64)
      common /pghpf_0/pghpf_0, /pghpf_1/pghpf_1, /pghpf_0c/pghpf_0c
     +, /pghpf_lineno/pghpf_lineno
      integer pghpf_0, pghpf_1, pghpf_lineno
      character*1 pghpf_0c
      common /pghpf_nbbmod$0_10/ pghpf_nbbmod$0_10a
      integer pghpf_nbbmod$0_10a(1:4)
      common /pghpf_nbbmod$0_9/ pghpf_nbbmod$0_9a
      integer pghpf_nbbmod$0_9a(1:4)
      common /pghpf_nbbmod$0_8/ pghpf_nbbmod$0_8a
      integer pghpf_nbbmod$0_8a(1:4)
      common /pghpf_nbbmod$0_7/ pghpf_nbbmod$0_7a
      integer pghpf_nbbmod$0_7a(1:4)
      common /pghpf_nbbmod$0_6/ pghpf_nbbmod$0_6a
      integer pghpf_nbbmod$0_6a(1:4)
      common /pghpf_nbbmod$0_5/ pghpf_nbbmod$0_5a
      integer pghpf_nbbmod$0_5a(1:4)
      common /pghpf_nbbmod$0_4/ pghpf_nbbmod$0_4a
      integer pghpf_nbbmod$0_4a(1:4)
      common /pghpf_nbbmod$0_3/ pghpf_nbbmod$0_3a
      integer pghpf_nbbmod$0_3a(1:4)
      common /pghpf_nbbmod$0_2/ pghpf_nbbmod$0_2a
      integer pghpf_nbbmod$0_2a(1:4)
      common /pghpf_nbbmod$0_1/ pghpf_nbbmod$0_1a
      integer pghpf_nbbmod$0_1a(1:4)
      common /pghpf_nbbmod$0_0/ nb,g
      integer nb
      real g
      integer cnv$b, ways, dist
      integer cnv$s0(1), ways$s0(1), dist$s0(1)
      integer b(1), i(1), p(1), u, k, bb, ii, cc, lm, i$i, i$i1, i$i2, 
     +i$i3, i$i4, i$i5, i$i6, procs$d(1), i$l, i$u, i$l1, i$u1, i$l2, 
     +i$u2, i$l3, i$u3, i$l4, i$u4, i$l5, i$u5, i$l6, i$u6, i$l7, i$u7, 
     +i$l8, i$u8, i$l9, i$u9, i$l10, i$u10, i$l11, i$u11, i$l12, i$u12, 
     +d0$tl$tl$d(1), d0$a$d(1), d0$a$d1(1), l$b, u$b, l$b1, u$b1, l$b2, 
     +u$b2, d0$tl$tl1$d(1), d0$a$r$d(1), d0$a$r$d1(1), l$b3, u$b3, l$b4
     +, u$b4, d1$tl$tl$d(1), d1$a$d(1), d1$a$d1(1), l$b5, u$b5, l$b6, 
     +u$b6, l$b7, u$b7, d1$tl$tl1$d(1), d1$a$r$d(1), d1$a$r$d1(1), l$b8
     +, u$b8, l$b9, u$b9, d1$tl$tl1$d1(1), r1$d(1), d1$d(1), cnv$d(1), 
     +r1$d1(1), d1$d1(1), p$d(1), gm$d(1), ac$d(1), cnv$d1(1), l$b10, 
     +u$b10, l$b11, u$b11, l$b12, u$b12, l$b13, u$b13, l$b14, u$b14, 
     +l$b15, u$b15, l$b16, u$b16, l$b17, u$b17, l$b18, u$b18, l$b19, 
     +u$b19, l$b20, u$b20, l$b21, u$b21, l$b22, u$b22, l$b23, u$b23, 
     +l$b24, u$b24
      real cnv(1), x0(1), x1(1), v0(1), v1(1), ac(1), m(1), gm(1), d0(1)
     +, d1(1), r0(1), r1(1), d0$a(1), d0$a$r(1), d1$a(1), d1$a$r(1)
      integer cnv$p, x0$p, x1$p, v0$p, v1$p, ac$p, m$p, gm$p, b$p, i$p, 
     +p$p, d0$p, d1$p, r0$p, r1$p, procs$dp, d0$a$p, d0$a$r$p, d1$a$p, 
     +d1$a$r$p, d0$tl$tl$dp, d0$a$dp, d0$a$dp1, d0$tl$tl1$dp, d0$a$r$dp
     +, d0$a$r$dp1, d1$tl$tl$dp, d1$a$dp, d1$a$dp1, d1$tl$tl1$dp, 
     +d1$a$r$dp, d1$a$r$dp1, d1$tl$tl1$dp1, r1$dp, d1$dp, cnv$dp, r1$dp1
     +, d1$dp1, p$dp, gm$dp, ac$dp, cnv$dp1
      integer pghpf_newproc
      external shiftcnv
      procs$dp = pghpf_newproc(1,2)
      call pghpf_ptr_offset(procs$dp,procs$dp,procs$d,25)
      call pghpf_template(r1$dp,2,1280,procs$d(procs$dp),2,0,0,1,0,31)
      call pghpf_ptr_offset(r1$dp,r1$dp,r1$d,25)
      call pghpf_instance(p$dp,r1$d(r1$dp),25,4,2,4,4)
      call pghpf_ptr_offset(p$dp,p$dp,p$d,25)
      call pghpf_common('pghpf_nbbmod$0_10',pghpf_nbbmod$0_10a,1,p$d(
     +p$dp))
      p$p = pghpf_nbbmod$0_10a(3)
      call pghpf_ptr_offset(p$p,p$p,p,25)
      call pghpf_allobnds(p$d(p$dp),l$b10,u$b10,l$b11,u$b11)
      call pghpf_common('pghpf_nbbmod$0_9',pghpf_nbbmod$0_9a,1,p$d(p$dp)
     +)
      i$p = pghpf_nbbmod$0_9a(3)
      call pghpf_ptr_offset(i$p,i$p,i,25)
      call pghpf_common('pghpf_nbbmod$0_8',pghpf_nbbmod$0_8a,1,p$d(p$dp)
     +)
      b$p = pghpf_nbbmod$0_8a(3)
      call pghpf_ptr_offset(b$p,b$p,b,25)
      call pghpf_instance(gm$dp,r1$d(r1$dp),27,4,2,4,4)
      call pghpf_ptr_offset(gm$dp,gm$dp,gm$d,25)
      call pghpf_common('pghpf_nbbmod$0_7',pghpf_nbbmod$0_7a,1,gm$d(
     +gm$dp))
      gm$p = pghpf_nbbmod$0_7a(3)
      call pghpf_ptr_offset(gm$p,gm$p,gm,27)
      call pghpf_allobnds(gm$d(gm$dp),l$b12,u$b12,l$b13,u$b13)
      call pghpf_common('pghpf_nbbmod$0_6',pghpf_nbbmod$0_6a,1,gm$d(
     +gm$dp))
      m$p = pghpf_nbbmod$0_6a(3)
      call pghpf_ptr_offset(m$p,m$p,m,27)
      call pghpf_template(d1$dp,3,1280,procs$d(procs$dp),6,0,0,1,0,31,1,
     +3)
      call pghpf_ptr_offset(d1$dp,d1$dp,d1$d,25)
      call pghpf_instance(ac$dp,d1$d(d1$dp),27,4,6,4,4)
      call pghpf_ptr_offset(ac$dp,ac$dp,ac$d,25)
      call pghpf_common('pghpf_nbbmod$0_5',pghpf_nbbmod$0_5a,1,ac$d(
     +ac$dp))
      ac$p = pghpf_nbbmod$0_5a(3)
      call pghpf_ptr_offset(ac$p,ac$p,ac,27)
      call pghpf_allobnds(ac$d(ac$dp),l$b14,u$b14,l$b15,u$b15,l$b16,
     +u$b16)
      call pghpf_common('pghpf_nbbmod$0_4',pghpf_nbbmod$0_4a,1,ac$d(
     +ac$dp))
      v1$p = pghpf_nbbmod$0_4a(3)
      call pghpf_ptr_offset(v1$p,v1$p,v1,27)
      call pghpf_common('pghpf_nbbmod$0_3',pghpf_nbbmod$0_3a,1,ac$d(
     +ac$dp))
      v0$p = pghpf_nbbmod$0_3a(3)
      call pghpf_ptr_offset(v0$p,v0$p,v0,27)
      call pghpf_common('pghpf_nbbmod$0_2',pghpf_nbbmod$0_2a,1,ac$d(
     +ac$dp))
      x1$p = pghpf_nbbmod$0_2a(3)
      call pghpf_ptr_offset(x1$p,x1$p,x1,27)
      call pghpf_common('pghpf_nbbmod$0_1',pghpf_nbbmod$0_1a,1,ac$d(
     +ac$dp))
      x0$p = pghpf_nbbmod$0_1a(3)
      call pghpf_ptr_offset(x0$p,x0$p,x0,27)
      call pghpf_kopy_in(cnv$p,cnv$dp1,cnv$b,cnv$s0,3,27,4,2560,procs$d(
     +procs$dp),6,0,0,1,0,31,0,9,4,4)
      call pghpf_ptr_offset(cnv$p,cnv$p,cnv,27)
      call pghpf_ptr_offset(cnv$dp1,cnv$dp1,cnv$d1,25)
      call pghpf_allobnds(cnv$d1(cnv$dp1),l$b17,u$b17,l$b18,u$b18,l$b19,
     +u$b19)
      call pghpf_instance(d1$dp1,d1$d(d1$dp),27,4,6,0,0)
      call pghpf_ptr_offset(d1$dp1,d1$dp1,d1$d1,25)
      call pghpf_instance(r1$dp1,r1$d(r1$dp),27,4,2,0,0)
      call pghpf_ptr_offset(r1$dp1,r1$dp1,r1$d1,25)
      call pghpf_allobnds(d1$d1(d1$dp1),l$b20,u$b20,l$b21,u$b21,l$b22,
     +u$b22)
      call pgf90_alloc((u$b22-l$b22+1)*((u$b20-l$b20+1)*(u$b21-l$b21+1))
     +,27,pghpf_0,pghpf_0,d0$p,d0)
      call pgf90_alloc((u$b22-l$b22+1)*((u$b20-l$b20+1)*(u$b21-l$b21+1))
     +,27,pghpf_0,pghpf_0,d1$p,d1)
      call pghpf_allobnds(r1$d1(r1$dp1),l$b23,u$b23,l$b24,u$b24)
      call pgf90_alloc((u$b23-l$b23+1)*(u$b24-l$b24+1),27,pghpf_0,
     +pghpf_0,r0$p,r0)
      call pgf90_alloc((u$b23-l$b23+1)*(u$b24-l$b24+1),27,pghpf_0,
     +pghpf_0,r1$p,r1)
      if (dist .eq. 1) then
         u = 1
         lm = 32
      else
         u = 1
         lm = 16
         call shiftcnv(cnv(cnv$p),cnv$d1(cnv$dp1))
      endif
      call pghpf_localize_bounds(d1$d1(d1$dp1),1,0,1,1,i$l,i$u)
      call pghpf_template(d0$tl$tl$dp,1,1280,procs$d(procs$dp),0,0,0,1)
      call pghpf_ptr_offset(d0$tl$tl$dp,d0$tl$tl$dp,d0$tl$tl$d,25)
      call pghpf_template(d0$a$dp,3,4096,d0$tl$tl$d(d0$tl$tl$dp),0,6,1,1
     +,0,0,0,1,0,31,1,3)
      call pghpf_ptr_offset(d0$a$dp,d0$a$dp,d0$a$d,25)
      call pghpf_instance(d0$a$dp1,d0$a$d(d0$a$dp),27,4,6,0,0)
      call pghpf_ptr_offset(d0$a$dp1,d0$a$dp1,d0$a$d1,25)
      call pghpf_allobnds(d0$a$d1(d0$a$dp1),l$b,u$b,l$b1,u$b1,l$b2,u$b2)
      call pgf90_alloc((u$b2-l$b2+1)*((u$b-l$b+1)*(u$b1-l$b1+1)),27,
     +pghpf_0,pghpf_0,d0$a$p,d0$a)
      call pghpf_template(d0$tl$tl1$dp,1,1280,procs$d(procs$dp),0,0,0,1)
      call pghpf_ptr_offset(d0$tl$tl1$dp,d0$tl$tl1$dp,d0$tl$tl1$d,25)
      call pghpf_template(d0$a$r$dp,2,4096,d0$tl$tl1$d(d0$tl$tl1$dp),0,2
     +,1,1,0,0,0,1,0,31)
      call pghpf_ptr_offset(d0$a$r$dp,d0$a$r$dp,d0$a$r$d,25)
      call pghpf_instance(d0$a$r$dp1,d0$a$r$d(d0$a$r$dp),27,4,2,0,0)
      call pghpf_ptr_offset(d0$a$r$dp1,d0$a$r$dp1,d0$a$r$d1,25)
      call pghpf_allobnds(d0$a$r$d1(d0$a$r$dp1),l$b3,u$b3,l$b4,u$b4)
      call pgf90_alloc((u$b3-l$b3+1)*(u$b4-l$b4+1),27,pghpf_0,pghpf_0,
     +d0$a$r$p,d0$a$r)
      call pghpf_template(d1$tl$tl$dp,1,1280,procs$d(procs$dp),0,0,0,1)
      call pghpf_ptr_offset(d1$tl$tl$dp,d1$tl$tl$dp,d1$tl$tl$d,25)
      call pghpf_template(d1$a$dp,3,4096,d1$tl$tl$d(d1$tl$tl$dp),0,6,1,1
     +,0,0,0,1,0,31,1,3)
      call pghpf_ptr_offset(d1$a$dp,d1$a$dp,d1$a$d,25)
      call pghpf_instance(d1$a$dp1,d1$a$d(d1$a$dp),27,4,6,0,0)
      call pghpf_ptr_offset(d1$a$dp1,d1$a$dp1,d1$a$d1,25)
      call pghpf_allobnds(d1$a$d1(d1$a$dp1),l$b5,u$b5,l$b6,u$b6,l$b7,
     +u$b7)
      call pgf90_alloc((u$b7-l$b7+1)*((u$b5-l$b5+1)*(u$b6-l$b6+1)),27,
     +pghpf_0,pghpf_0,d1$a$p,d1$a)
      call pghpf_template(d1$tl$tl1$dp,1,1280,procs$d(procs$dp),0,0,0,1)
      call pghpf_ptr_offset(d1$tl$tl1$dp,d1$tl$tl1$dp,d1$tl$tl1$d,25)
      call pghpf_template(d1$a$r$dp,2,4096,d1$tl$tl1$d(d1$tl$tl1$dp),0,2
     +,1,1,0,0,0,1,0,31)
      call pghpf_ptr_offset(d1$a$r$dp,d1$a$r$dp,d1$a$r$d,25)
      call pghpf_instance(d1$a$r$dp1,d1$a$r$d(d1$a$r$dp),27,4,2,0,0)
      call pghpf_ptr_offset(d1$a$r$dp1,d1$a$r$dp1,d1$a$r$d1,25)
      call pghpf_allobnds(d1$a$r$d1(d1$a$r$dp1),l$b8,u$b8,l$b9,u$b9)
      call pgf90_alloc((u$b8-l$b8+1)*(u$b9-l$b9+1),27,pghpf_0,pghpf_0,
     +d1$a$r$p,d1$a$r)
      do k = u, lm
!        forall (i$i=1:3:1, i$i1=0:31:1, i$i2=i$l:i$u:1) d0((u$b20-l$b20
!    ++1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) = 
!    +cnv(((i$i+2-l$b19)*(u$b18-l$b18+1)+i$i1-l$b18)*(u$b17-l$b17+1)+
!    +i$i2-l$b17+cnv$p) - x0(((i$i-l$b16)*(u$b15-l$b15+1)+i$i1-l$b15)*(
!    +u$b14-l$b14+1)+i$i2-l$b14+x0$p)
         do i$i = 1, 3
            do i$i1 = 0, 31
               do i$i2 = i$l, i$u
                  d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-
     +l$b21)+i$i2-l$b20+d0$p) = cnv(((i$i+2-l$b19)*(u$b18-l$b18+1)+i$i1-
     +l$b18)*(u$b17-l$b17+1)+i$i2-l$b17+cnv$p) - x0(((i$i-l$b16)*(u$b15-
     +l$b15+1)+i$i1-l$b15)*(u$b14-l$b14+1)+i$i2-l$b14+x0$p)
                  d1((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-
     +l$b21)+i$i2-l$b20+d1$p) = cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(
     +i$i+5-l$b19)+i$i1-l$b18)+i$i2-l$b17+cnv$p) - x1(((i$i-l$b16)*(
     +u$b15-l$b15+1)+i$i1-l$b15)*(u$b14-l$b14+1)+i$i2-l$b14+x1$p)
               enddo
            enddo
         enddo
!        forall (i$i=1:3:1, i$i1=0:31:1, i$i2=i$l:i$u:1) d0$a((u$b-l$b+1
!    +)*((u$b1-l$b1+1)*(i$i-l$b2)+i$i1-l$b1)+i$i2-l$b+d0$a$p) = d0((
!    +u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20
!    ++d0$p) * d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-
!    +l$b21)+i$i2-l$b20+d0$p)
         do i$i = 1, 3
            do i$i1 = 0, 31
               do i$i2 = i$l, i$u
                  d0$a((u$b-l$b+1)*((u$b1-l$b1+1)*(i$i-l$b2)+i$i1-l$b1)+
     +i$i2-l$b+d0$a$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)
     ++i$i1-l$b21)+i$i2-l$b20+d0$p) * d0((u$b20-l$b20+1)*((u$b21-l$b21+1
     +)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p)
                  d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-
     +l$b21)+i$i2-l$b20+d0$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i
     +-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) + d1((u$b20-l$b20+1)*((u$b21-
     +l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d1$p)
               enddo
            enddo
         enddo
         call pghpf_sum(d0$a$r(d0$a$r$p),d0$a(d0$a$p),.true.,3,d0$a$r$d1
     +(d0$a$r$dp1),d0$a$d1(d0$a$dp1),pghpf_1,pghpf_1)
!        forall (i$i=0:31:1, i$i1=i$l:i$u:1) r0((u$b23-l$b23+1)*(i$i-
!    +l$b24)+i$i1-l$b23+r0$p) = sqrt(d0$a$r((u$b3-l$b3+1)*(i$i-l$b4)+
!    +i$i1-l$b3+d0$a$r$p))
         do i$i = 0, 31
            do i$i1 = i$l, i$u
               r0((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23+r0$p) = sqrt(
     +d0$a$r((u$b3-l$b3+1)*(i$i-l$b4)+i$i1-l$b3+d0$a$r$p))
            enddo
         enddo
!        forall (i$i=1:3:1, i$i1=0:31:1, i$i2=i$l:i$u:1) d1$a((u$b5-l$b5
!    ++1)*((u$b6-l$b6+1)*(i$i-l$b7)+i$i1-l$b6)+i$i2-l$b5+d1$a$p) = d1((
!    +u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20
!    ++d1$p) * d1((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-
!    +l$b21)+i$i2-l$b20+d1$p)
         do i$i = 1, 3
            do i$i1 = 0, 31
               do i$i2 = i$l, i$u
                  d1$a((u$b5-l$b5+1)*((u$b6-l$b6+1)*(i$i-l$b7)+i$i1-l$b6
     +)+i$i2-l$b5+d1$a$p) = d1((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-
     +l$b22)+i$i1-l$b21)+i$i2-l$b20+d1$p) * d1((u$b20-l$b20+1)*((u$b21-
     +l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d1$p)
               enddo
            enddo
         enddo
         call pghpf_sum(d1$a$r(d1$a$r$p),d1$a(d1$a$p),.true.,3,d1$a$r$d1
     +(d1$a$r$dp1),d1$a$d1(d1$a$dp1),pghpf_1,pghpf_1)
!        forall (i$i=0:31:1, i$i1=i$l:i$u:1) r1((u$b23-l$b23+1)*(i$i-
!    +l$b24)+i$i1-l$b23+r1$p) = sqrt(d1$a$r((u$b8-l$b8+1)*(i$i-l$b9)+
!    +i$i1-l$b8+d1$a$r$p))
         do i$i = 0, 31
            do i$i1 = i$l, i$u
               r1((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23+r1$p) = sqrt(
     +d1$a$r((u$b8-l$b8+1)*(i$i-l$b9)+i$i1-l$b8+d1$a$r$p))
               r0((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23+r0$p) = (r0((
     +u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23+r0$p) + r1((u$b23-l$b23+1)*(
     +i$i-l$b24)+i$i1-l$b23+r1$p)) * (r0((u$b23-l$b23+1)*(i$i-l$b24)+
     +i$i1-l$b23+r0$p) * r1((u$b23-l$b23+1)*(i$i-l$b24)+i$i1-l$b23+r1$p)
     +)
            enddo
         enddo
         if ((dist .eq. 1 .or. k .lt. lm) .and. ways .eq. 2) then
!           forall (bb=0:1, ii=0:31, cc=1:3)
!           forall (i$i=1:3, i$i1=0:31, i$i2=i$l:i$u) d0((u$b20-l$b20+1)
!    +*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) = d0((
!    +u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20
!    ++d0$p) / r0((u$b23-l$b23+1)*(i$i1-l$b24)+i$i2-l$b23+r0$p)
            do i$i = 1, 3
               do i$i1 = 0, 31
                  do i$i2 = i$l, i$u
                  d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-
     +l$b21)+i$i2-l$b20+d0$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i
     +-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) / r0((u$b23-l$b23+1)*(i$i1-
     +l$b24)+i$i2-l$b23+r0$p)
                  enddo
               enddo
            enddo
!           d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc-l$b22)+ii-l$b21)+bb-
!    +l$b20+d0$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc-l$b22)+ii-
!    +l$b21)+bb-l$b20+d0$p) / r0((u$b23-l$b23+1)*(ii-l$b24)+bb-l$b23+
!    +r0$p)
!           forall (i$i=1:3, i$i1=0:31, i$i2=i$l:i$u) ac(((i$i-l$b16)*(
!    +u$b15-l$b15+1)+i$i1-l$b15)*(u$b14-l$b14+1)+i$i2-l$b14+ac$p) = d0((
!    +u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20
!    ++d0$p) * cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(9-l$b19)+i$i1-l$b18
!    +)+i$i2-l$b17+cnv$p) + ac(((i$i-l$b16)*(u$b15-l$b15+1)+i$i1-l$b15)*
!    +(u$b14-l$b14+1)+i$i2-l$b14+ac$p)
            do i$i = 1, 3
               do i$i1 = 0, 31
                  do i$i2 = i$l, i$u
                  ac(((i$i-l$b16)*(u$b15-l$b15+1)+i$i1-l$b15)*(u$b14-
     +l$b14+1)+i$i2-l$b14+ac$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(
     +i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) * cnv((u$b17-l$b17+1)*((
     +u$b18-l$b18+1)*(9-l$b19)+i$i1-l$b18)+i$i2-l$b17+cnv$p) + ac(((i$i-
     +l$b16)*(u$b15-l$b15+1)+i$i1-l$b15)*(u$b14-l$b14+1)+i$i2-l$b14+ac$p
     +)
                  enddo
               enddo
            enddo
!           ac((u$b14-l$b14+1)*((u$b15-l$b15+1)*(cc-l$b16)+ii-l$b15)+bb-
!    +l$b14+ac$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc-l$b22)+ii-
!    +l$b21)+bb-l$b20+d0$p) * cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(9-
!    +l$b19)+ii-l$b18)+bb-l$b17+cnv$p) + ac((u$b14-l$b14+1)*((u$b15-
!    +l$b15+1)*(cc-l$b16)+ii-l$b15)+bb-l$b14+ac$p)
!           forall (cc=0:2:1, ii=0:31, bb=i$l:i$u) cnv((u$b17-l$b17+1)*(
!    +(u$b18-l$b18+1)*(cc-l$b19)+ii-l$b18)+bb-l$b17+cnv$p) = cnv((u$b17-
!    +l$b17+1)*((u$b18-l$b18+1)*(cc-l$b19)+ii-l$b18)+bb-l$b17+cnv$p) - 
!    +gm((ii-l$b13)*(u$b12-l$b12+1)+bb-l$b12+gm$p) * d0((u$b20-l$b20+1)*
!    +((u$b21-l$b21+1)*(cc+1-l$b22)+ii-l$b21)+bb-l$b20+d0$p)
            do cc = 0, 2
               do ii = 0, 31
                  do bb = i$l, i$u
                  cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(cc-l$b19)+ii-
     +l$b18)+bb-l$b17+cnv$p) = cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(cc-
     +l$b19)+ii-l$b18)+bb-l$b17+cnv$p) - gm((ii-l$b13)*(u$b12-l$b12+1)+
     +bb-l$b12+gm$p) * d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc+1-l$b22)+
     +ii-l$b21)+bb-l$b20+d0$p)
                  enddo
               enddo
            enddo
!           cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(cc-l$b19)+ii-l$b18)+bb
!    +-l$b17+cnv$p) = cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(cc-l$b19)+ii
!    +-l$b18)+bb-l$b17+cnv$p) - gm((ii-l$b13)*(u$b12-l$b12+1)+bb-l$b12+
!    +gm$p) * d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc+1-l$b22)+ii-l$b21)
!    ++bb-l$b20+d0$p)
!           endforall
         else
!           forall (bb=0:1, ii=0:31, cc=1:3)
!           forall (i$i=1:3, i$i1=0:31, i$i2=i$l:i$u) d0((u$b20-l$b20+1)
!    +*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) = d0((
!    +u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20
!    ++d0$p) / r0((u$b23-l$b23+1)*(i$i1-l$b24)+i$i2-l$b23+r0$p)
            do i$i = 1, 3
               do i$i1 = 0, 31
                  do i$i2 = i$l, i$u
                  d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-
     +l$b21)+i$i2-l$b20+d0$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i
     +-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) / r0((u$b23-l$b23+1)*(i$i1-
     +l$b24)+i$i2-l$b23+r0$p)
                  enddo
               enddo
            enddo
!           d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc-l$b22)+ii-l$b21)+bb-
!    +l$b20+d0$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc-l$b22)+ii-
!    +l$b21)+bb-l$b20+d0$p) / r0((u$b23-l$b23+1)*(ii-l$b24)+bb-l$b23+
!    +r0$p)
!           forall (i$i=1:3, i$i1=0:31, i$i2=i$l:i$u) ac(((i$i-l$b16)*(
!    +u$b15-l$b15+1)+i$i1-l$b15)*(u$b14-l$b14+1)+i$i2-l$b14+ac$p) = d0((
!    +u$b20-l$b20+1)*((u$b21-l$b21+1)*(i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20
!    ++d0$p) * cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(9-l$b19)+i$i1-l$b18
!    +)+i$i2-l$b17+cnv$p) + ac(((i$i-l$b16)*(u$b15-l$b15+1)+i$i1-l$b15)*
!    +(u$b14-l$b14+1)+i$i2-l$b14+ac$p)
            do i$i = 1, 3
               do i$i1 = 0, 31
                  do i$i2 = i$l, i$u
                  ac(((i$i-l$b16)*(u$b15-l$b15+1)+i$i1-l$b15)*(u$b14-
     +l$b14+1)+i$i2-l$b14+ac$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(
     +i$i-l$b22)+i$i1-l$b21)+i$i2-l$b20+d0$p) * cnv((u$b17-l$b17+1)*((
     +u$b18-l$b18+1)*(9-l$b19)+i$i1-l$b18)+i$i2-l$b17+cnv$p) + ac(((i$i-
     +l$b16)*(u$b15-l$b15+1)+i$i1-l$b15)*(u$b14-l$b14+1)+i$i2-l$b14+ac$p
     +)
                  enddo
               enddo
            enddo
!           ac((u$b14-l$b14+1)*((u$b15-l$b15+1)*(cc-l$b16)+ii-l$b15)+bb-
!    +l$b14+ac$p) = d0((u$b20-l$b20+1)*((u$b21-l$b21+1)*(cc-l$b22)+ii-
!    +l$b21)+bb-l$b20+d0$p) * cnv((u$b17-l$b17+1)*((u$b18-l$b18+1)*(9-
!    +l$b19)+ii-l$b18)+bb-l$b17+cnv$p) + ac((u$b14-l$b14+1)*((u$b15-
!    +l$b15+1)*(cc-l$b16)+ii-l$b15)+bb-l$b14+ac$p)
!           endforall
         endif
         if (k .lt. lm) then
            call shiftcnv(cnv(cnv$p),cnv$d1(cnv$dp1))
         endif
      enddo
      call pghpf_freen(3,d1$tl$tl1$d(d1$tl$tl1$dp),d1$a$r$d(d1$a$r$dp),
     +d1$a$r$d1(d1$a$r$dp1))
      call pgf90_deallocate(d1$a$r(d1$a$r$p),pghpf_0)
      call pghpf_freen(3,d1$tl$tl$d(d1$tl$tl$dp),d1$a$d(d1$a$dp),d1$a$d1
     +(d1$a$dp1))
      call pgf90_deallocate(d1$a(d1$a$p),pghpf_0)
      call pghpf_freen(3,d0$tl$tl1$d(d0$tl$tl1$dp),d0$a$r$d(d0$a$r$dp),
     +d0$a$r$d1(d0$a$r$dp1))
      call pgf90_deallocate(d0$a$r(d0$a$r$p),pghpf_0)
      call pghpf_freen(3,d0$tl$tl$d(d0$tl$tl$dp),d0$a$d(d0$a$dp),d0$a$d1
     +(d0$a$dp1))
      call pgf90_deallocate(d0$a(d0$a$p),pghpf_0)
99999 continue
      call pghpf_copy_out(cnv$b,cnv(cnv$p),cnv$s0,cnv$d1(cnv$dp1),0)
      call pghpf_freen(8,procs$d(procs$dp),r1$d(r1$dp),p$d(p$dp),gm$d(
     +gm$dp),d1$d(d1$dp),ac$d(ac$dp),d1$d1(d1$dp1),r1$d1(r1$dp1))
      call pgf90_deallocate(r1(r1$p),pghpf_0)
      call pgf90_deallocate(r0(r0$p),pghpf_0)
      call pgf90_deallocate(d1(d1$p),pghpf_0)
      call pgf90_deallocate(d0(d0$p),pghpf_0)
      end
      subroutine shiftcnv(cnv$b,cnv$s0)
      implicit none
      integer npr, nbl, kbl, n
      parameter (npr=2)
      parameter (nbl=2)
      parameter (kbl=32)
      parameter (n=64)
      common /pghpf_0/pghpf_0, /pghpf_1/pghpf_1, /pghpf_0c/pghpf_0c
     +, /pghpf_lineno/pghpf_lineno
      integer pghpf_0, pghpf_1, pghpf_lineno
      character*1 pghpf_0c
      common /pghpf_nbbmod$0_10/ pghpf_nbbmod$0_10a
      integer pghpf_nbbmod$0_10a(1:4)
      common /pghpf_nbbmod$0_9/ pghpf_nbbmod$0_9a
      integer pghpf_nbbmod$0_9a(1:4)
      common /pghpf_nbbmod$0_8/ pghpf_nbbmod$0_8a
      integer pghpf_nbbmod$0_8a(1:4)
      common /pghpf_nbbmod$0_7/ pghpf_nbbmod$0_7a
      integer pghpf_nbbmod$0_7a(1:4)
      common /pghpf_nbbmod$0_6/ pghpf_nbbmod$0_6a
      integer pghpf_nbbmod$0_6a(1:4)
      common /pghpf_nbbmod$0_5/ pghpf_nbbmod$0_5a
      integer pghpf_nbbmod$0_5a(1:4)
      common /pghpf_nbbmod$0_4/ pghpf_nbbmod$0_4a
      integer pghpf_nbbmod$0_4a(1:4)
      common /pghpf_nbbmod$0_3/ pghpf_nbbmod$0_3a
      integer pghpf_nbbmod$0_3a(1:4)
      common /pghpf_nbbmod$0_2/ pghpf_nbbmod$0_2a
      integer pghpf_nbbmod$0_2a(1:4)
      common /pghpf_nbbmod$0_1/ pghpf_nbbmod$0_1a
      integer pghpf_nbbmod$0_1a(1:4)
      common /pghpf_nbbmod$0_0/ nb,g
      integer nb
      real g
      integer cnv$b
      integer cnv$s0(1)
      integer b(1), i(1), p(1), k, i$i, i$i1, i$i2, i$i3, i$i4, i$i5, 
     +i$i6, procs$d(1), i$l, i$u, i$l1, i$u1, i$l2, i$u2, w$tl$d(1), w$d
     +(1), p$d(1), ac$d(1), cnv$d(1), w$d1(1), p$d1(1), gm$d(1), ac$d1(1
     +), cnv$d1(1), l$b, u$b, l$b1, u$b1, l$b2, u$b2, l$b3, u$b3, l$b4, 
     +u$b4, l$b5, u$b5, l$b6, u$b6, l$b7, u$b7, l$b8, u$b8, l$b9, u$b9, 
     +l$b10, u$b10, l$b11, u$b11
      real cnv(1), x0(1), x1(1), v0(1), v1(1), ac(1), m(1), gm(1), w(1)
      integer cnv$p, x0$p, x1$p, v0$p, v1$p, ac$p, m$p, gm$p, b$p, i$p, 
     +p$p, w$p, procs$dp, w$tl$dp, w$dp, p$dp, ac$dp, cnv$dp, w$dp1, 
     +p$dp1, gm$dp, ac$dp1, cnv$dp1
      integer pghpf_newproc
      procs$dp = pghpf_newproc(1,2)
      call pghpf_ptr_offset(procs$dp,procs$dp,procs$d,25)
      call pghpf_template(p$dp,2,1280,procs$d(procs$dp),2,0,0,1,0,31)
      call pghpf_ptr_offset(p$dp,p$dp,p$d,25)
      call pghpf_instance(p$dp1,p$d(p$dp),25,4,2,4,4)
      call pghpf_ptr_offset(p$dp1,p$dp1,p$d1,25)
      call pghpf_common('pghpf_nbbmod$0_10',pghpf_nbbmod$0_10a,1,p$d1(
     +p$dp1))
      p$p = pghpf_nbbmod$0_10a(3)
      call pghpf_ptr_offset(p$p,p$p,p,25)
      call pghpf_allobnds(p$d1(p$dp1),l$b,u$b,l$b1,u$b1)
      call pghpf_common('pghpf_nbbmod$0_9',pghpf_nbbmod$0_9a,1,p$d1(
     +p$dp1))
      i$p = pghpf_nbbmod$0_9a(3)
      call pghpf_ptr_offset(i$p,i$p,i,25)
      call pghpf_common('pghpf_nbbmod$0_8',pghpf_nbbmod$0_8a,1,p$d1(
     +p$dp1))
      b$p = pghpf_nbbmod$0_8a(3)
      call pghpf_ptr_offset(b$p,b$p,b,25)
      call pghpf_instance(gm$dp,p$d(p$dp),27,4,2,4,4)
      call pghpf_ptr_offset(gm$dp,gm$dp,gm$d,25)
      call pghpf_common('pghpf_nbbmod$0_7',pghpf_nbbmod$0_7a,1,gm$d(
     +gm$dp))
      gm$p = pghpf_nbbmod$0_7a(3)
      call pghpf_ptr_offset(gm$p,gm$p,gm,27)
      call pghpf_allobnds(gm$d(gm$dp),l$b2,u$b2,l$b3,u$b3)
      call pghpf_common('pghpf_nbbmod$0_6',pghpf_nbbmod$0_6a,1,gm$d(
     +gm$dp))
      m$p = pghpf_nbbmod$0_6a(3)
      call pghpf_ptr_offset(m$p,m$p,m,27)
      call pghpf_template(ac$dp,3,1280,procs$d(procs$dp),6,0,0,1,0,31,1,
     +3)
      call pghpf_ptr_offset(ac$dp,ac$dp,ac$d,25)
      call pghpf_instance(ac$dp1,ac$d(ac$dp),27,4,6,4,4)
      call pghpf_ptr_offset(ac$dp1,ac$dp1,ac$d1,25)
      call pghpf_common('pghpf_nbbmod$0_5',pghpf_nbbmod$0_5a,1,ac$d1(
     +ac$dp1))
      ac$p = pghpf_nbbmod$0_5a(3)
      call pghpf_ptr_offset(ac$p,ac$p,ac,27)
      call pghpf_allobnds(ac$d1(ac$dp1),l$b4,u$b4,l$b5,u$b5,l$b6,u$b6)
      call pghpf_common('pghpf_nbbmod$0_4',pghpf_nbbmod$0_4a,1,ac$d1(
     +ac$dp1))
      v1$p = pghpf_nbbmod$0_4a(3)
      call pghpf_ptr_offset(v1$p,v1$p,v1,27)
      call pghpf_common('pghpf_nbbmod$0_3',pghpf_nbbmod$0_3a,1,ac$d1(
     +ac$dp1))
      v0$p = pghpf_nbbmod$0_3a(3)
      call pghpf_ptr_offset(v0$p,v0$p,v0,27)
      call pghpf_common('pghpf_nbbmod$0_2',pghpf_nbbmod$0_2a,1,ac$d1(
     +ac$dp1))
      x1$p = pghpf_nbbmod$0_2a(3)
      call pghpf_ptr_offset(x1$p,x1$p,x1,27)
      call pghpf_common('pghpf_nbbmod$0_1',pghpf_nbbmod$0_1a,1,ac$d1(
     +ac$dp1))
      x0$p = pghpf_nbbmod$0_1a(3)
      call pghpf_ptr_offset(x0$p,x0$p,x0,27)
      call pghpf_kopy_in(cnv$p,cnv$dp1,cnv$b,cnv$s0,3,27,4,2560,procs$d(
     +procs$dp),6,0,0,1,0,31,0,9,4,4)
      call pghpf_ptr_offset(cnv$p,cnv$p,cnv,27)
      call pghpf_ptr_offset(cnv$dp1,cnv$dp1,cnv$d1,25)
      call pghpf_allobnds(cnv$d1(cnv$dp1),l$b7,u$b7,l$b8,u$b8,l$b9,u$b9)
      call pghpf_template(w$dp,2,1280,procs$d(procs$dp),2,0,0,1,0,9)
      call pghpf_ptr_offset(w$dp,w$dp,w$d,25)
      call pghpf_instance(w$dp1,w$d(w$dp),27,4,2,0,0)
      call pghpf_ptr_offset(w$dp1,w$dp1,w$d1,25)
      call pghpf_allobnds(w$d1(w$dp1),l$b10,u$b10,l$b11,u$b11)
      call pgf90_alloc((u$b10-l$b10+1)*(u$b11-l$b11+1),27,pghpf_0,
     +pghpf_0,w$p,w)
      call pghpf_localize_bounds(w$d1(w$dp1),1,0,1,1,i$l,i$u)
!     forall (i$i=0:9:1, i$i1=i$l:i$u:1) w((u$b10-l$b10+1)*(i$i-l$b11)+
!    +i$i1-l$b10+w$p) = cnv(((i$i-l$b9)*(u$b8-l$b8+1)+31-l$b8)*(u$b7-
!    +l$b7+1)+i$i1-l$b7+cnv$p)
      do i$i = 0, 9
         do i$i1 = i$l, i$u
            w((u$b10-l$b10+1)*(i$i-l$b11)+i$i1-l$b10+w$p) = cnv(((i$i-
     +l$b9)*(u$b8-l$b8+1)+31-l$b8)*(u$b7-l$b7+1)+i$i1-l$b7+cnv$p)
         enddo
      enddo
      do k = 31, 1, -1
!        forall (i$i=0:9:1, i$i1=i$l:i$u:1) cnv((u$b7-l$b7+1)*((i$i-l$b9
!    +)*(u$b8-l$b8+1)+k-l$b8)+i$i1-l$b7+cnv$p) = cnv((u$b7-l$b7+1)*(k-1+
!    +(i$i-l$b9)*(u$b8-l$b8+1)-l$b8)+i$i1-l$b7+cnv$p)
         do i$i = 0, 9
            do i$i1 = i$l, i$u
               cnv((u$b7-l$b7+1)*((i$i-l$b9)*(u$b8-l$b8+1)+k-l$b8)+i$i1-
     +l$b7+cnv$p) = cnv((u$b7-l$b7+1)*(k-1+(i$i-l$b9)*(u$b8-l$b8+1)-l$b8
     +)+i$i1-l$b7+cnv$p)
            enddo
         enddo
      enddo
!     forall (i$i=0:9:1, i$i1=i$l:i$u:1) cnv((u$b7-l$b7+1)*((i$i-l$b9)*(
!    +u$b8-l$b8+1)-l$b8)+i$i1-l$b7+cnv$p) = w((u$b10-l$b10+1)*(i$i-l$b11
!    +)+i$i1-l$b10+w$p)
      do i$i = 0, 9
         do i$i1 = i$l, i$u
            cnv((u$b7-l$b7+1)*((i$i-l$b9)*(u$b8-l$b8+1)-l$b8)+i$i1-l$b7+
     +cnv$p) = w((u$b10-l$b10+1)*(i$i-l$b11)+i$i1-l$b10+w$p)
         enddo
      enddo
99999 continue
      call pghpf_copy_out(cnv$b,cnv(cnv$p),cnv$s0,cnv$d1(cnv$dp1),0)
      call pghpf_freen(8,procs$d(procs$dp),p$d(p$dp),p$d1(p$dp1),gm$d(
     +gm$dp),ac$d(ac$dp),ac$d1(ac$dp1),w$d(w$dp),w$d1(w$dp1))
      call pgf90_deallocate(w(w$p),pghpf_0)
      end
