      program main
      implicit none
      
      integer*4 i
      logical*4 test(50)
      
      do i= 1, 50
          test(i)= .true.
      end do
         
         
      write(6,100) test(1)
100   format(l4)
      call SwapLogicalArray( 50,test )
      write(6,100) test(1)
      
      return
      end




      subroutine SwapLogicalArray( Size,Array )
      implicit none
      
      integer*4 Size,i
      logical*4 Array(1),LogIn
      
      do i= 1, Size
        LogIn= Array(i)
        call SwapLogical( LogIn,Array(i) )
      end do
      return
      end


      subroutine SwapLogical( LogIn,LogOut )
      implicit none
      
      integer*4 i                             
      logical*4 LogIn,LogOut,LogInTemp,LogOutTemp
      character CharIn*4,CharOut*4
      
      equivalence ( LogInTemp,CharIn )
      equivalence ( LogOutTemp,CharOut )
      
	  LogInTemp= LogIn
      do i= 1, 4
        CharOut(i:i)= CharIn(5-i:5-i)
      end do
	  LogOut= LogOutTemp
      return
      end                
