       subroutine padi2d ( iarr, idim, jdim, ndim, imin, imax, jmin
     1                   , jmax )
c
c    dac:zeus3d.padi2d <------------------------- pads integer 2-D array
c                                                              may, 1992
c
c    written by: David Clarke
c    modified 1:
c
c  PURPOSE: Pads input integer 2-D array "iarr" with edge values.
c
c  EXTERNALS: [NONE]
c
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
c------------------------ IMPLICIT STATEMENTS --------------------------
c-----------------------------------------------------------------------
c
       implicit      none
c
       integer       idim    , jdim    , ndim    , imin    , imax
     1             , jmin    , jmax    , i       , j       , n
c
       integer       iarr    (idim,jdim,ndim)
c
c-----------------------------------------------------------------------
c
       do 90 n=1,ndim
         do 20 i=1,imin-1
           do 10 j=jmin,jmax
             iarr(i,j,n) = iarr(imin,j,n)
10         continue
20       continue
         do 40 i=imax+1,idim
           do 30 j=jmin,jmax
             iarr(i,j,n) = iarr(imax,j,n)
30         continue
40       continue
         do 60 j=1,jmin-1
           do 50 i=1,idim
             iarr(i,j,n) = iarr(i,jmin,n)
50         continue
60       continue
         do 80 j=jmax+1,jdim
           do 70 i=1,idim
             iarr(i,j,n) = iarr(i,jmax,n)
70         continue
80       continue
90     continue
c
       return
       end
