C CLIMOD    SOURCE    CB215821  24/04/12    21:15:17     11897          
      subroutine climod(pModel,jcolac)
C=======================================================================
C     COLlaborateur LIer MODele
C     Remplace dans un objet modele, les pointeurs vers la pile de
C     communication par les pointeurs esope correspondant.
C=======================================================================
      integer ipoPi,iPoint
      character*8 typNom
      integer mn3,nNomid,nObMod,n1
      integer iMod,lconmo,iInfo,iObNid,iObMod
      integer iPile

-INC PPARAM
-INC CCOPTIO
-INC SMMODEL
-INC TMCOLAC
      pointeur pModel.MMODEL
      pointeur modele.IMODEL

      pointeur jcolac.ICOLAC
      pointeur pile.ITLACC

C      write(ioimp,*) 'Entre dans CLIMOD'
C      write(ioimp,*) 'Modele de pointeur',pModel
      if (pModel.eq.0) then
         write(ioimp,*) 'CLIMOD Erreur: pointeur vers objet MMODEL nul'
         call erreur(5)
      endif

      segact pModel
      n1=pModel.kmodel(/1)
C      write(ioimp,*) 'Nb ss Modele ',n1
      do iMod=1,n1
C        write(ioimp,*) 'Modele elem',iMod,'sur',n1
        modele=pModel.kmodel(iMod)
C        write(ioimp,*) 'ss modele', iMod, 'pointeur',modele
        segact modele*mod

        iPoPi=modele.ipdpge
        if(iPoPi.gt.0) then
          pile=jcolac.kcola(1)
          iPoint=pile.itlac(iPoPi)
        else
          iPoint=0
        endif
        modele.ipdpge=iPoint
C        write(ioimp,*) 'point support DPGE',iPoPi,iPoint

        iPoPi=modele.imamod
        pile=jcolac.kcola(1)
        iPoint=pile.itlac(iPoPi)
C        write(ioimp,*) 'maillage support',iPoPi,iPoint
        modele.imamod=iPoint

C        write(ioimp,*) 'Infmod '
        mn3=modele.infmod(/1)
C     Court circuit en attendant le support des tables, par la
C     suite, il suffit d'enlever la ligne suivante
        modele.infmod(2)=0
        iPoPi=modele.infmod(2)
        if(iPoPi.gt.0) then
          pile=jcolac.kcola(10)
          iPoint=pile.itlac(iPoPi)
          modele.infmod(2)=iPoint
        else
          modele.infmod(2)=0
        endif
        pile=jcolac.kcola(40)
        do iInfo=3,mn3
          iPoPi=modele.infmod(iInfo)
          if(iPoPi.gt.0) then
            iPoint=pile.itlac(iPoPi)
            modele.infmod(iInfo)=iPoint
          else
            modele.infmod(iInfo)=0
          endif
        enddo

        nNomid=modele.lnomid(/1)
        do iObMid=1,nNomid
          iPoPi=modele.lnomid(iObMid)
          if (iPoPi.gt.0) then
            iPoint=iPoPi
            modele.lnomid(iObMid)=iPoint
          else
            modele.lnomid(iObMid)=0
          endif
        enddo

        nObMod=modele.ivamod(/1)
C        write(ioimp,*) 'Nombre d objets',nObMod
        do iObMod=1,nObMod
          typNom=modele.tymode(iObMod)
          call typfil(typNom,iPile)
          if(iPile.gt.0) then
            iPoPi=ivamod(iPile)
            pile=jcolac.kcola(iPile)
            iPoint=pile.itlac(iPoPi)
            modele.ivamod(iObMod)=iPoint
          endif
        enddo

        segdes modele
      enddo
      segdes pModel

c      write(ioimp,*) 'Sortie de CLIMOD'
c      return
      end

 
 
