
! ***** This is level 2 program *****

! This program should require no communication 

      PROGRAM MAIN 
      REAL X(-78:194), Y(-52:832) 
!HPF$ PROCESSORS P(4) 
!HPF$ TEMPLATE TX(-940:2329),TY(-156:2506) 
!HPF$ DISTRIBUTE TX(CYCLIC) ONTO P 
!HPF$ DISTRIBUTE TY(CYCLIC) ONTO P 
!HPF$ ALIGN X(i) WITH TX(12*i+0) 
!HPF$ ALIGN Y(i) WITH TY(3*i+2) 

      FORALL (i=-78:194) X(i) = 0 
      FORALL (i=-52:832) Y(i) = i 
      FORALL (i=-5:191:3) X(i) = Y(4*i-6) + Y(4*i-6) 

      CALL FOO(X(-75:194:1),Y(-49:821:3)) 
      CALL FOO(X(-77:192:1),Y(-48:242:1)) 

      PRINT 111, (X(i),i=-78,194) 
111   FORMAT(1x,f17.2) 
      END 

      SUBROUTINE FOO(X,Y) 
      REAL X(:), Y(:) 
!HPF$ INHERIT X,Y 
      FORALL (i=1:269) X(i)=X(i)-Y(i)-Y(i+1) 
      END 
!          p,lx,ly,ux,uy,l,u,s,d1,d2,ax,ay,a1,a2, 
!          ltx,utx,lty,uty,bx,by,b1,b2, 
!          lxs1,uxs1, sxs1, lys1, uys1, sys1, 
!          lxs2,uxs2, sxs2, lys2, uys2, sys2 
!          4 -78 -52 194 832 -5 191 3 2 2 12 3 4 4 
!          -940 2329 -156 2506 0 2 -6 -6  
!          -75 194 1 -49 821 3 
!          -77 192 1 -48 242 1 
