C sup_norm.f
C 
C   real function sup_norm2d(A,nx,ny,nxdim,nydim)
C   real function sup_norm1d(A,nx)
C   
C
      real function sup_norm2d(A,nx,ny,nxdim,nydim)

         integer nx,ny,nxdim, nydim
	 real    A(nxdim,nydim)

	 real    size
	 integer i,j

	 size = 0.   
         do i = 1, nx
	    do j = 1, ny
		size = max(size,abs(A(i,j)))
	    enddo
	 enddo
         sup_norm2d = size
      return 
      end

      real function sup_norm1d(A,nx)
         integer nx
	 real    A(nx)

	 real    size
	 integer i

	 size = 0.   
         do i = 1, nx
            size = max(size,abs(A(i)))
	 enddo
         sup_norm1d = size
      return 
      end

C       program main
C 
C          integer nxdim, nydim
C 	 parameter (nxdim =4, nydim=5)
C 	 integer nx,ny
C 	 real    bob(nxdim,nydim)
C 
C 	 real size
C 	 real sup_norm2d
C 
C 	 integer i,j
C 
C 	 do j = 1, nxdim
C 	    do i = 1, nydim
C 	       bob(i,j) = -1.0e35
C 	    enddo
C          enddo
C 	 size = sup_norm2d(bob,nxdim,nydim,nxdim,nydim)
C 	 write(*,*)'size1 ', size
C 
C 	 nx = 3
C 	 ny = 2
C 	 do i = 1,nx 
C 	    do j = 1, ny
C 	       if(i.gt.j) then 
C 	          bob(i,j) = 2*(i+j) 
C 	       else
C 	          bob(i,j) = -(i+j) 
C 	       endif
C 	    enddo
C 	 enddo
C 	 size = sup_norm2d(bob,nx,ny,nxdim,nydim)
C 	 write(*,*)'size2 ', size
C 
C 	 nx = 3
C 	 ny = 4
C 	 do i = 1,nx 
C 	    do j = 1, ny
C 	       if(i.gt.j) then 
C 	          bob(i,j) = (i+j) 
C 	       else
C 	          bob(i,j) = -2*(i+j) 
C 	       endif
C 	    enddo
C 	 enddo
C 	 size = sup_norm2d(bob,nx,ny,nxdim,nydim)
C 	 write(*,*)'size3 ', size
C 
C 
C       stop
C       end 
