      function isglobal(is,my_id) ! Bernd Berg Dec 3 2008. 
C Returns global position corresponding to is on MPI sublattice ismpi.
      include '../../Libs/Fortran/implicit.sta'
      include '../../Libs/Fortran/constants.par'
      include '../../Libs/Fortran_par/latmpi.par'
      include '../../Libs/MPI_par/common_cblat.f'
c     include '../../Libs/MPI_par/common_cblatinfo.f'
      dimension ix(nd),ix_mpi(ndmpi)
      ltest=.false.
      ltest=.true.
      ismpi=my_id+1
      call ixcor(ix,nla,is,nd)             ! Corresponding coordinates.
      call ixcor(ix_mpi,nla_mpi,ismpi,ndmpi) ! MPI sublattice position.
c     print*,"ismpi,ndmpi,nla_mpi,ix_mpi:",ismpi,ndmpi,nla_mpi,ix_mpi
      do idmpi=1,ndmpi
        ix(idmpi)=ix(idmpi)+ix_mpi(idmpi)*nla(idmpi)
      enddo
      isglobal=isfun(ix,nla_full,nd)
      return
      end
