!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      subroutine a2almskoc (a,imin,jmin,n,lmax,list)
!*************************************************************************
!                                                                        *
!     Decompose global array and output result                           *
!                                                                        *
!*************************************************************************
      implicit none
      include 'param_o.h'
!------------------------------------------------------------------------
      integer::lmax
      real, dimension  (0:im+1,0:jm+1,nm,lmax), intent (inout) :: a
      real, dimension (0:ilm+1,0:jlm+1,lmax) :: al
      integer::i,j,l,il,jl,imin,jmin,n,list
!------------------------------------------------------------------------

      do l=1,lmax
          j = jmin
        do jl = 0,jlm+1
          i = imin
        do il = 0,ilm+1
	 if(il.lt.1.or.il.gt.ilm.or.jl.lt.1.or.jl.gt.jlm)then
	   al(il,jl,l)=0.
         else
           al(il,jl,l) = a(i,j,n,l)
	   if(a(i,j,n,l).ne.0.)then
	     a(i,j,n,l)=0.
           endif
         endif
          i = i + 1
        end do
          j = j + 1
        end do
      end do
      write(list) al
!------------------------------------------------------------------------
      end subroutine a2almskoc 
