!
       subroutine putem(hlat1,hlon1,i1d,sm,sice,ieta,im,jm,nm)
!
!
       integer::im,jm,nm
       real*4 hlat1(0:im+1,0:jm+1,nm),hlon1(0:im+1,0:jm+1,nm)
       real*4 hlat(0:im+1,0:jm+1,nm),hlon(0:im+1,0:jm+1,nm)
       integer*4 i1d(360,180), ieta(0:im+1,0:jm+1,nm)
       real*4 sm(0:im+1,0:jm+1,nm),sice(0:im+1,0:jm+1,nm)

       hlat=hlat1*180./3.1415926
       hlon=hlon1*180./3.1415926
       
!
!   This subroutine moves the value stored in i1d (integer 1 by 1 deg global
!   grid) to the nearest eta land point in the ieta integer array.
!   Special effort is made to ensure that islands are taken care of when
!   not resolved on the 1 x 1 deg. grid.
!
        do n=1,nm
        do j = 1,jm
        do i = 1,im

          if((sm(i,j,n).gt.0.5).or.(sice(i,j,n).eq.1.0)) then
            ieta(i,j,n) = 0
          else
            indx = nint(hlon(i,j,n) - 179.5)
            if(indx.lt.1) indx = nint(hlon(i,j,n) + 180.5)
            indy = nint(hlat(i,j,n) + 90.5)
            indy=max(1,min(180,indy))
            if(i1d(indx,indy).ne.0) then
!mp	     write(6,*) 'assigned a value'
                ieta(i,j,n) = i1d(indx,indy)
            else
! We have an isolated point and need to look at surrounding
! 1 degree grid points, at this latitude.
                do krad=1,40
                do jj = indy-krad,indy+krad
                do ii=indx-krad,indx+krad
                  itt = min(ii,360)
                  itt = max(itt,1)
                  jtt = min(jj,180)
                  jtt = max(jtt,1)
                  if(i1d(itt,jtt).ne.0) then
                    ieta(i,j,n) = i1d(itt,jtt)
                    go to 33
                  end if
                end do
                end do
                end do
           print *,"oh oh ",i,j,n,hlat(i,j,n),hlon(i,j,n),indx,indy
33              continue
            end if
          end if
        end do
        end do
        end do
          return
          end
