      IMPLICIT REAL*8(a-h,o-z)
      PARAMETER(ncoef=3,nvobs=2,mpext=1000)
      REAL*8 coef(ncoef),vobsext(mpext,nvobs)
      CHARACTER*1 deux,cbidon
      CHARACTER*12 namess
      CHARACTER*16 filcoe
      filcoe='diffusion.coe'
      namess='PriseMasse'
      CALL sid_lircoef(filcoe,ncoef,coef)
c_____mise a jour du code externe
      deux=CHAR(50)
      ZeRo=0.
      Tfin=104.59
      D0=1.48e-12
      e=1.570796327
      OPEN(54,FILE='courbe_diffusion.txt')
      WRITE(54,'(A1)') deux
      DO i=IDINT(ZeRo),IDINT(Tfin)
          petitc=FLOAT(i)
	  val=D0*coef(1)*EXP(coef(2)*((petitc/Tfin)**coef(3)))
          WRITE(54,777) petitc,val
      END DO
      CLOSE(54)
c_____faire rouler le code
      CALL SYSTEM('./iteration_opti ')
c_____recup des variables obs
      OPEN(55,FILE='itere_diff.txt',STATUS='old')
      READ(55,*) cbidon
      DO isim=1,mpext
      READ(55,*,END=999) c1,c2,vobsext(isim,1),c4,c5,c6,vobsext(isim,2)
      END DO
 999  npext=isim-1
      CLOSE(55)
      CALL sid_vobtexp(namess,npext,mpext,nvobs,vobsext)
 777  FORMAT(E15.9,1X,E15.9)
      END
