	program fft
	real, dimension(n,n) :: a1,a2
	logical done1
!hpf$ processors procs(8)
!hpf$ distribute as(block,*) onto procs(1:4)
!hpf$ distribute a2(*,block) onto procs(5:8)

!hpf$ template,dimension(4),distribute(block) onto porcs(1:4):: td1
!hpf$ align with td1(*) :: done1

!hpf$ task_region 
	 done1 = .false.
	 do while (.true.)
!hpf$ 	on home(porcs(4:4)), resident begin
		read(unit = iu, end=100) a1
		call rowffts(a1)
		goto 101
100		done1 =.true.
101		continue
!hpf$   end on

		if(done1) exit
		a2 = a1

!hpf$   on home(procs(5:8)),resident begin 
		call colffts(a2)
		write (unit=ou) a2
!hpf$   end on
	  end do
!hpf$ end task_region

	end program
