      subroutine rinit3D(f,idim,jdim,kdim,val)
      dimension f(idim,jdim,kdim)
        do k=1,kdim
        do j=1,jdim
        do i=1,idim
           f(i,j,k)=val
        enddo
        enddo
        enddo
      return
      end
      subroutine rinit2D(f,idim,jdim,val)
      dimension f(idim,jdim)
        do j=1,jdim
        do i=1,idim
           f(i,j)=val
        enddo
        enddo
      return
      end
      subroutine rinit1D(f,idim,val)
      dimension f(idim)
        do i=1,idim
           f(i)=val
        enddo
      return
      end
      subroutine init3D(f,idim,jdim,kdim,ival)
      integer f(idim,jdim,kdim)
        do k=1,kdim
        do j=1,jdim
        do i=1,idim
           f(i,j,k)=ival
        enddo
        enddo
        enddo
      return
      end
      subroutine init2D(f,idim,jdim,ival)
      integer f(idim,jdim)
        do j=1,jdim
        do i=1,idim
           f(i,j)=ival
        enddo
        enddo
      return
      end
      subroutine init1D(f,idim,ival)
      integer f(idim)
        do i=1,idim
           f(i)=ival
        enddo
      return
      end
