Program g : permut

      program progg
      implicit none
      
      real mata(20,10),matb(20,10)
      integer i,j,nberr

      do i=1,20
         do j=1,10
            mata(i,j)=1+i+j
            matb(i,j)=mata(i,j)
         enddo   
      enddo

      write (*,'(20I3)') mata
      print *,''

      call permut(mata,20,10)
      write (*,'(20I3)') mata

      nberr=0
      do i=1,20
         do j=1,10
            if (mata(i,j).ne.matb(i,11-j)) then
               print *,'Error at element (',i,' ,',j,' )'
               nberr=nberr+1
            endif
         enddo   
      enddo
      if (nberr.eq.0) then
         print *,'Inversion of the line order by permut successful'
      endif
      
      stop
      end