      subroutine find_rhs_psi(alpha,h2,psi$b,zeta$b,rhs$b,n,alpha$s0,
     +h2$s0,psi$s0,zeta$s0,rhs$s0,n$s0)
      implicit none
      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
      integer psi$b, zeta$b, rhs$b, n
      real alpha, h2
      integer alpha$s0(1), h2$s0(1), psi$s0(1), zeta$s0(1), rhs$s0(1), 
     +n$s0(1)
      integer z_b_0, z_b_1, z_b_2, z_b_3, z_b_4, z_b_5, z_b_6, z_b_7, 
     +z_b_8, z_b_9, z_b_10, z_b_11, i, k, j1, jn, i$i, i$i1, i$i2, i$i3
     +, i$i4, i$i5, i$i6, rhs$s(1), rhs$f$s(1), psi$s(1), rhs$f1$s(1), 
     +psi$s1(1), rhs$f2$s(1), psi$s2(1), rhs$f3$s(1), zeta$s(1), rhs$s1(
     +1), rhs$f4$s(1), psi$s3(1), rhs$s2(1), rhs$f5$s(1), psi$s4(1), i$l
     +, i$u, i$l1, i$u1, i$l2, i$u2, rhs$tl$tl$d(1), rhs$f$d(1), 
     +rhs$f$d1(1), l$b, u$b, rhs$tl$tl1$d(1), rhs$f1$d(1), rhs$f1$d1(1)
     +, l$b1, u$b1, rhs$tl$tl2$d(1), rhs$f2$d(1), rhs$f2$d1(1), l$b2, 
     +u$b2, rhs$tl$tl3$d(1), rhs$f3$d(1), rhs$f3$d1(1), l$b3, u$b3, 
     +rhs$tl$tl4$d(1), rhs$f4$d(1), rhs$f4$d1(1), l$b4, u$b4, 
     +rhs$tl$tl5$d(1), rhs$f5$d(1), rhs$f5$d1(1), l$b5, u$b5, 
     +rhs$tl$tl5$d1(1), zeta$tl$d(1), psi$tl$d(1), rhs$d(1), zeta$d(1), 
     +psi$d(1), rhs$d1(1), zeta$d1(1), psi$d1(1), 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 psi(1), zeta(1), rhs(1), b, rhs$f(1), rhs$f1(1), rhs$f2(1), 
     +rhs$f3(1), rhs$f4(1), rhs$f5(1), psi$s5, psi$s6
      integer cp, xfer, cp1, xfer1, cp2, xfer2, cp3, xfer3, cp4, xfer4, 
     +cp5, xfer5
      integer psi$p, zeta$p, rhs$p, rhs$sp, rhs$f$p, rhs$f$sp, psi$sp, 
     +rhs$f1$p, rhs$f1$sp, psi$sp1, rhs$f2$p, rhs$f2$sp, psi$sp2, 
     +rhs$f3$p, rhs$f3$sp, zeta$sp, rhs$sp1, rhs$f4$p, rhs$f4$sp, 
     +psi$sp3, rhs$sp2, rhs$f5$p, rhs$f5$sp, psi$sp4, rhs$tl$tl$dp, 
     +rhs$f$dp, rhs$f$dp1, rhs$tl$tl1$dp, rhs$f1$dp, rhs$f1$dp1, 
     +rhs$tl$tl2$dp, rhs$f2$dp, rhs$f2$dp1, rhs$tl$tl3$dp, rhs$f3$dp, 
     +rhs$f3$dp1, rhs$tl$tl4$dp, rhs$f4$dp, rhs$f4$dp1, rhs$tl$tl5$dp, 
     +rhs$f5$dp, rhs$f5$dp1, rhs$tl$tl5$dp1, zeta$tl$dp, psi$tl$dp, 
     +rhs$dp, zeta$dp, psi$dp, rhs$dp1, zeta$dp1, psi$dp1
      integer pghpf_extent, pghpf_sect, pghpf_comm_copy, 
     +pghpf_comm_start
      logical pghpf_islocal
      call pghpf_function_entry(5,61,'find_rhs_psi','find_rhs_psi.f90')
      z_b_0 = 1
      z_b_1 = pghpf_extent(psi$s0,1)
      z_b_2 = 1
      z_b_3 = pghpf_extent(psi$s0,2)
      z_b_4 = 1
      z_b_5 = pghpf_extent(zeta$s0,1)
      z_b_6 = 1
      z_b_7 = pghpf_extent(zeta$s0,2)
      z_b_8 = 1
      z_b_9 = pghpf_extent(rhs$s0,1)
      z_b_10 = 1
      z_b_11 = pghpf_extent(rhs$s0,2)
      call pghpf_kopy_in(psi$p,psi$dp1,psi$b,psi$s0,2,27,4,2116,1,0,
     +z_b_0,z_b_2,4,4)
      call pghpf_ptr_offset(psi$p,psi$p,psi,27)
      call pghpf_ptr_offset(psi$dp1,psi$dp1,psi$d1,25)
      call pghpf_allobnds(psi$d1(psi$dp1),l$b6,u$b6,l$b7,u$b7)
      call pghpf_kopy_in(zeta$p,zeta$dp1,zeta$b,zeta$s0,2,27,4,2116,1,0,
     +z_b_4,z_b_6,4,4)
      call pghpf_ptr_offset(zeta$p,zeta$p,zeta,27)
      call pghpf_ptr_offset(zeta$dp1,zeta$dp1,zeta$d1,25)
      call pghpf_allobnds(zeta$d1(zeta$dp1),l$b8,u$b8,l$b9,u$b9)
      call pghpf_kopy_in(rhs$p,rhs$dp1,rhs$b,rhs$s0,2,27,4,2180,1,0,
     +z_b_8,z_b_10,4,4)
      call pghpf_ptr_offset(rhs$p,rhs$p,rhs,27)
      call pghpf_ptr_offset(rhs$dp1,rhs$dp1,rhs$d1,25)
      call pghpf_allobnds(rhs$d1(rhs$dp1),l$b10,u$b10,l$b11,u$b11)
      pghpf_lineno = 47
      call pghpf_line_entry()
      j1 = 2
      pghpf_lineno = 48
      call pghpf_line_entry()
      jn = n - 1
      pghpf_lineno = 49
      call pghpf_line_entry()
      b = alpha - 2.0
      pghpf_lineno = 50
      call pghpf_line_entry()
      continue
      do k = j1, jn
         call pghpf_template(rhs$tl$tl$dp,1,1024,0,0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$tl$tl$dp,rhs$tl$tl$dp,rhs$tl$tl$d,25)
         call pghpf_template(rhs$f$dp,1,20480,rhs$tl$tl$d(rhs$tl$tl$dp),
     +0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$f$dp,rhs$f$dp,rhs$f$d,25)
         call pghpf_instance(rhs$f$dp1,rhs$f$d(rhs$f$dp),27,4,0,4,4)
         call pghpf_ptr_offset(rhs$f$dp1,rhs$f$dp1,rhs$f$d1,25)
         pghpf_lineno = 51
         call pghpf_line_entry()
         call pghpf_allobnds(rhs$f$d1(rhs$f$dp1),l$b,u$b)
         call pgf90_alloc(u$b-l$b+1,27,pghpf_0,pghpf_0,rhs$f$p,rhs$f)
         rhs$f$sp = pghpf_sect(rhs$f$d1(rhs$f$dp1),j1,jn,1,1)
         call pghpf_ptr_offset(rhs$f$sp,rhs$f$sp,rhs$f$s,25)
         psi$sp = pghpf_sect(psi$d1(psi$dp1),k - 1,k - 1,1,j1,jn,1,2)
         call pghpf_ptr_offset(psi$sp,psi$sp,psi$s,25)
         cp = pghpf_comm_copy(rhs$f(rhs$f$p),psi(psi$p),rhs$f$s(rhs$f$sp
     +),psi$s(psi$sp))
         xfer = pghpf_comm_start(cp,rhs$f(rhs$f$p),rhs$f$s(rhs$f$sp),psi
     +(psi$p),psi$s(psi$sp))
         call pghpf_comm_finish(xfer)
         call pghpf_template(rhs$tl$tl1$dp,1,1024,0,0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$tl$tl1$dp,rhs$tl$tl1$dp,rhs$tl$tl1$d,
     +25)
         call pghpf_template(rhs$f1$dp,1,20480,rhs$tl$tl1$d(
     +rhs$tl$tl1$dp),0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$f1$dp,rhs$f1$dp,rhs$f1$d,25)
         call pghpf_instance(rhs$f1$dp1,rhs$f1$d(rhs$f1$dp),27,4,0,4,4)
         call pghpf_ptr_offset(rhs$f1$dp1,rhs$f1$dp1,rhs$f1$d1,25)
         call pghpf_allobnds(rhs$f1$d1(rhs$f1$dp1),l$b1,u$b1)
         call pgf90_alloc(u$b1-l$b1+1,27,pghpf_0,pghpf_0,rhs$f1$p,rhs$f1
     +)
         rhs$f1$sp = pghpf_sect(rhs$f1$d1(rhs$f1$dp1),j1,jn,1,1)
         call pghpf_ptr_offset(rhs$f1$sp,rhs$f1$sp,rhs$f1$s,25)
         psi$sp1 = pghpf_sect(psi$d1(psi$dp1),k,k,1,j1,jn,1,2)
         call pghpf_ptr_offset(psi$sp1,psi$sp1,psi$s1,25)
         cp1 = pghpf_comm_copy(rhs$f1(rhs$f1$p),psi(psi$p),rhs$f1$s(
     +rhs$f1$sp),psi$s1(psi$sp1))
         xfer1 = pghpf_comm_start(cp1,rhs$f1(rhs$f1$p),rhs$f1$s(
     +rhs$f1$sp),psi(psi$p),psi$s1(psi$sp1))
         call pghpf_comm_finish(xfer1)
         call pghpf_template(rhs$tl$tl2$dp,1,1024,0,0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$tl$tl2$dp,rhs$tl$tl2$dp,rhs$tl$tl2$d,
     +25)
         call pghpf_template(rhs$f2$dp,1,20480,rhs$tl$tl2$d(
     +rhs$tl$tl2$dp),0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$f2$dp,rhs$f2$dp,rhs$f2$d,25)
         call pghpf_instance(rhs$f2$dp1,rhs$f2$d(rhs$f2$dp),27,4,0,4,4)
         call pghpf_ptr_offset(rhs$f2$dp1,rhs$f2$dp1,rhs$f2$d1,25)
         call pghpf_allobnds(rhs$f2$d1(rhs$f2$dp1),l$b2,u$b2)
         call pgf90_alloc(u$b2-l$b2+1,27,pghpf_0,pghpf_0,rhs$f2$p,rhs$f2
     +)
         rhs$f2$sp = pghpf_sect(rhs$f2$d1(rhs$f2$dp1),j1,jn,1,1)
         call pghpf_ptr_offset(rhs$f2$sp,rhs$f2$sp,rhs$f2$s,25)
         psi$sp2 = pghpf_sect(psi$d1(psi$dp1),k + 1,k + 1,1,j1,jn,1,2)
         call pghpf_ptr_offset(psi$sp2,psi$sp2,psi$s2,25)
         cp2 = pghpf_comm_copy(rhs$f2(rhs$f2$p),psi(psi$p),rhs$f2$s(
     +rhs$f2$sp),psi$s2(psi$sp2))
         xfer2 = pghpf_comm_start(cp2,rhs$f2(rhs$f2$p),rhs$f2$s(
     +rhs$f2$sp),psi(psi$p),psi$s2(psi$sp2))
         call pghpf_comm_finish(xfer2)
         call pghpf_template(rhs$tl$tl3$dp,1,1024,0,0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$tl$tl3$dp,rhs$tl$tl3$dp,rhs$tl$tl3$d,
     +25)
         call pghpf_template(rhs$f3$dp,1,20480,rhs$tl$tl3$d(
     +rhs$tl$tl3$dp),0,z_b_10,z_b_11)
         call pghpf_ptr_offset(rhs$f3$dp,rhs$f3$dp,rhs$f3$d,25)
         call pghpf_instance(rhs$f3$dp1,rhs$f3$d(rhs$f3$dp),27,4,0,4,4)
         call pghpf_ptr_offset(rhs$f3$dp1,rhs$f3$dp1,rhs$f3$d1,25)
         call pghpf_allobnds(rhs$f3$d1(rhs$f3$dp1),l$b3,u$b3)
         call pgf90_alloc(u$b3-l$b3+1,27,pghpf_0,pghpf_0,rhs$f3$p,rhs$f3
     +)
         rhs$f3$sp = pghpf_sect(rhs$f3$d1(rhs$f3$dp1),j1,jn,1,1)
         call pghpf_ptr_offset(rhs$f3$sp,rhs$f3$sp,rhs$f3$s,25)
         zeta$sp = pghpf_sect(zeta$d1(zeta$dp1),k,k,1,j1,jn,1,2)
         call pghpf_ptr_offset(zeta$sp,zeta$sp,zeta$s,25)
         cp3 = pghpf_comm_copy(rhs$f3(rhs$f3$p),zeta(zeta$p),rhs$f3$s(
     +rhs$f3$sp),zeta$s(zeta$sp))
         xfer3 = pghpf_comm_start(cp3,rhs$f3(rhs$f3$p),rhs$f3$s(
     +rhs$f3$sp),zeta(zeta$p),zeta$s(zeta$sp))
         call pghpf_comm_finish(xfer3)
         call pghpf_localize_bounds(rhs$d1(rhs$dp1),2,j1,jn,1,i$l,i$u)
!        forall (i$i=i$l:i$u:1) rhs((i$i-l$b11)*(u$b10-l$b10+1)+k-l$b10+
!    +rhs$p) = b * rhs$f1(i$i-l$b1+rhs$f1$p) + rhs$f(i$i-l$b+rhs$f$p) + 
!    +rhs$f2(i$i-l$b2+rhs$f2$p) - h2 * rhs$f3(i$i-l$b3+rhs$f3$p)
         do i$i = i$l, i$u
            rhs((i$i-l$b11)*(u$b10-l$b10+1)+k-l$b10+rhs$p) = b * rhs$f1(
     +i$i-l$b1+rhs$f1$p) + rhs$f(i$i-l$b+rhs$f$p) + rhs$f2(i$i-l$b2+
     +rhs$f2$p) - h2 * rhs$f3(i$i-l$b3+rhs$f3$p)
         enddo
         call pghpf_comm_free(1,cp3)
         call pghpf_free(zeta$s(zeta$sp))
         call pghpf_free(rhs$f3$s(rhs$f3$sp))
         call pghpf_freen(3,rhs$tl$tl3$d(rhs$tl$tl3$dp),rhs$f3$d(
     +rhs$f3$dp),rhs$f3$d1(rhs$f3$dp1))
         call pgf90_deallocate(rhs$f3(rhs$f3$p),pghpf_0)
         call pghpf_comm_free(1,cp2)
         call pghpf_free(psi$s2(psi$sp2))
         call pghpf_free(rhs$f2$s(rhs$f2$sp))
         call pghpf_freen(3,rhs$tl$tl2$d(rhs$tl$tl2$dp),rhs$f2$d(
     +rhs$f2$dp),rhs$f2$d1(rhs$f2$dp1))
         call pgf90_deallocate(rhs$f2(rhs$f2$p),pghpf_0)
         call pghpf_comm_free(1,cp1)
         call pghpf_free(psi$s1(psi$sp1))
         call pghpf_free(rhs$f1$s(rhs$f1$sp))
         call pghpf_freen(3,rhs$tl$tl1$d(rhs$tl$tl1$dp),rhs$f1$d(
     +rhs$f1$dp),rhs$f1$d1(rhs$f1$dp1))
         call pgf90_deallocate(rhs$f1(rhs$f1$p),pghpf_0)
         call pghpf_comm_free(1,cp)
         call pghpf_free(psi$s(psi$sp))
         call pghpf_free(rhs$f$s(rhs$f$sp))
         call pghpf_freen(3,rhs$tl$tl$d(rhs$tl$tl$dp),rhs$f$d(rhs$f$dp),
     +rhs$f$d1(rhs$f$dp1))
         call pgf90_deallocate(rhs$f(rhs$f$p),pghpf_0)
         pghpf_lineno = 53
         call pghpf_line_entry()
      enddo
      call pghpf_template(rhs$tl$tl4$dp,1,1024,0,0,z_b_10,z_b_11)
      call pghpf_ptr_offset(rhs$tl$tl4$dp,rhs$tl$tl4$dp,rhs$tl$tl4$d,25)
      call pghpf_template(rhs$f4$dp,1,20480,rhs$tl$tl4$d(rhs$tl$tl4$dp),
     +0,z_b_10,z_b_11)
      call pghpf_ptr_offset(rhs$f4$dp,rhs$f4$dp,rhs$f4$d,25)
      call pghpf_instance(rhs$f4$dp1,rhs$f4$d(rhs$f4$dp),27,4,0,4,4)
      call pghpf_ptr_offset(rhs$f4$dp1,rhs$f4$dp1,rhs$f4$d1,25)
      pghpf_lineno = 56
      call pghpf_line_entry()
      call pghpf_allobnds(rhs$f4$d1(rhs$f4$dp1),l$b4,u$b4)
      call pgf90_alloc(u$b4-l$b4+1,27,pghpf_0,pghpf_0,rhs$f4$p,rhs$f4)
      rhs$f4$sp = pghpf_sect(rhs$f4$d1(rhs$f4$dp1),1,z_b_11,1,1)
      call pghpf_ptr_offset(rhs$f4$sp,rhs$f4$sp,rhs$f4$s,25)
      psi$sp3 = pghpf_sect(psi$d1(psi$dp1),1,1,1,1,z_b_3,1,2)
      call pghpf_ptr_offset(psi$sp3,psi$sp3,psi$s3,25)
      cp4 = pghpf_comm_copy(rhs$f4(rhs$f4$p),psi(psi$p),rhs$f4$s(
     +rhs$f4$sp),psi$s3(psi$sp3))
      xfer4 = pghpf_comm_start(cp4,rhs$f4(rhs$f4$p),rhs$f4$s(rhs$f4$sp),
     +psi(psi$p),psi$s3(psi$sp3))
      call pghpf_comm_finish(xfer4)
      call pghpf_localize_bounds(rhs$d1(rhs$dp1),2,1,z_b_11,1,i$l1,i$u1)
!     forall (i$i=i$l1:i$u1:1) rhs((i$i-l$b11)*(u$b10-l$b10+1)+1-l$b10+
!    +rhs$p) = rhs$f4(i$i-l$b4+rhs$f4$p)
      do i$i = i$l1, i$u1
         rhs((i$i-l$b11)*(u$b10-l$b10+1)+1-l$b10+rhs$p) = rhs$f4(i$i-
     +l$b4+rhs$f4$p)
      enddo
      call pghpf_comm_free(1,cp4)
      call pghpf_free(psi$s3(psi$sp3))
      call pghpf_free(rhs$f4$s(rhs$f4$sp))
      call pghpf_freen(3,rhs$tl$tl4$d(rhs$tl$tl4$dp),rhs$f4$d(rhs$f4$dp)
     +,rhs$f4$d1(rhs$f4$dp1))
      call pgf90_deallocate(rhs$f4(rhs$f4$p),pghpf_0)
      call pghpf_template(rhs$tl$tl5$dp,1,1024,0,0,z_b_10,z_b_11)
      call pghpf_ptr_offset(rhs$tl$tl5$dp,rhs$tl$tl5$dp,rhs$tl$tl5$d,25)
      call pghpf_template(rhs$f5$dp,1,20480,rhs$tl$tl5$d(rhs$tl$tl5$dp),
     +0,z_b_10,z_b_11)
      call pghpf_ptr_offset(rhs$f5$dp,rhs$f5$dp,rhs$f5$d,25)
      call pghpf_instance(rhs$f5$dp1,rhs$f5$d(rhs$f5$dp),27,4,0,4,4)
      call pghpf_ptr_offset(rhs$f5$dp1,rhs$f5$dp1,rhs$f5$d1,25)
      pghpf_lineno = 57
      call pghpf_line_entry()
      call pghpf_allobnds(rhs$f5$d1(rhs$f5$dp1),l$b5,u$b5)
      call pgf90_alloc(u$b5-l$b5+1,27,pghpf_0,pghpf_0,rhs$f5$p,rhs$f5)
      rhs$f5$sp = pghpf_sect(rhs$f5$d1(rhs$f5$dp1),1,z_b_11,1,1)
      call pghpf_ptr_offset(rhs$f5$sp,rhs$f5$sp,rhs$f5$s,25)
      psi$sp4 = pghpf_sect(psi$d1(psi$dp1),n,n,1,1,z_b_3,1,2)
      call pghpf_ptr_offset(psi$sp4,psi$sp4,psi$s4,25)
      cp5 = pghpf_comm_copy(rhs$f5(rhs$f5$p),psi(psi$p),rhs$f5$s(
     +rhs$f5$sp),psi$s4(psi$sp4))
      xfer5 = pghpf_comm_start(cp5,rhs$f5(rhs$f5$p),rhs$f5$s(rhs$f5$sp),
     +psi(psi$p),psi$s4(psi$sp4))
      call pghpf_comm_finish(xfer5)
      call pghpf_localize_bounds(rhs$d1(rhs$dp1),2,1,z_b_11,1,i$l2,i$u2)
!     forall (i$i=i$l2:i$u2:1) rhs((i$i-l$b11)*(u$b10-l$b10+1)+n-l$b10+
!    +rhs$p) = rhs$f5(i$i-l$b5+rhs$f5$p)
      do i$i = i$l2, i$u2
         rhs((i$i-l$b11)*(u$b10-l$b10+1)+n-l$b10+rhs$p) = rhs$f5(i$i-
     +l$b5+rhs$f5$p)
      enddo
      call pghpf_comm_free(1,cp5)
      call pghpf_free(psi$s4(psi$sp4))
      call pghpf_free(rhs$f5$s(rhs$f5$sp))
      call pghpf_freen(3,rhs$tl$tl5$d(rhs$tl$tl5$dp),rhs$f5$d(rhs$f5$dp)
     +,rhs$f5$d1(rhs$f5$dp1))
      call pgf90_deallocate(rhs$f5(rhs$f5$p),pghpf_0)
      pghpf_lineno = 58
      call pghpf_line_entry()
      continue
      do k = j1, jn
         pghpf_lineno = 59
         call pghpf_line_entry()
         call pghpf_copy_scalar(psi$s5,rhs$d1(rhs$dp1),k,1,psi(psi$p),
     +psi$d1(psi$dp1),k,1)
         if (pghpf_islocal(rhs$d1(rhs$dp1),k,1)) then
            rhs((u$b10-l$b10+1)*(1-l$b11)+k-l$b10+rhs$p) = psi$s5
         endif
         pghpf_lineno = 60
         call pghpf_line_entry()
         call pghpf_copy_scalar(psi$s6,rhs$d1(rhs$dp1),k,n,psi(psi$p),
     +psi$d1(psi$dp1),k,n)
         if (pghpf_islocal(rhs$d1(rhs$dp1),k,n)) then
            rhs((u$b10-l$b10+1)*(n-l$b11)+k-l$b10+rhs$p) = psi$s6
         endif
         pghpf_lineno = 61
         call pghpf_line_entry()
      enddo
      pghpf_lineno = 63
      call pghpf_line_entry()
      goto 99999
99999 continue
      pghpf_lineno = 65
      call pghpf_line_entry()
      call pghpf_copy_out(psi$b,psi(psi$p),psi$s0,psi$d1(psi$dp1),1)
      call pghpf_copy_out(zeta$b,zeta(zeta$p),zeta$s0,zeta$d1(zeta$dp1),
     +1)
      call pghpf_copy_out(rhs$b,rhs(rhs$p),rhs$s0,rhs$d1(rhs$dp1),2)
      call pghpf_function_exit()
      end
