Index: LMDZ6/trunk/libf/phylmdiso/cv3_routines.F90
===================================================================
--- LMDZ6/trunk/libf/phylmdiso/cv3_routines.F90	(revision 4120)
+++ LMDZ6/trunk/libf/phylmdiso/cv3_routines.F90	(revision 4123)
@@ -4743,11 +4743,11 @@
     use infotrac_phy, ONLY: ntraciso,niso, &
 &       ntraceurs_zone,index_trac
-    use isotopes_mod, ONLY: essai_convergence,ridicule,iso_eau,iso_HDO
+    use isotopes_mod, ONLY: essai_convergence,ridicule,iso_eau,iso_HDO,iso_O18
 #ifdef ISOVERIF
     use isotopes_verif_mod, ONLY: errmax,errmaxrel, &
-        iso_verif_egalite_choix, iso_verif_noNaN,iso_verif_aberrant, &
+        iso_verif_egalite_choix, iso_verif_noNaN,iso_verif_aberrant,iso_verif_O18_aberrant, &
         iso_verif_egalite,iso_verif_egalite_choix_nostop,iso_verif_positif_nostop, &
         iso_verif_egalite_nostop,iso_verif_aberrant_nostop,deltaD,iso_verif_noNaN_nostop, &
-        iso_verif_positif
+        iso_verif_positif,iso_verif_O18_aberrant_nostop,deltaO
 #endif
 #ifdef ISOTRAC
@@ -5293,5 +5293,12 @@
            call iso_verif_aberrant((xt(iso_HDO,il,1) &
      &        +delt*fxt(iso_HDO,il,1))/(rr(il,1)+delt*fr(il,1)), &
-     &           'cv3_yield 3125, ddft en 1')
+     &           'cv3_yield 3125, ddft en 1')                
+          endif !if (iso_HDO.gt.0) then
+          if ((iso_HDO.gt.0).and.(iso_O18.gt.0).and. &
+     &           (rr(il,1)+delt*fr(il,1).gt.ridicule)) then
+           call iso_verif_O18_aberrant((xt(iso_HDO,il,1) &
+     &        +delt*fxt(iso_HDO,il,1))/(rr(il,1)+delt*fr(il,1)),(xt(iso_O18,il,1) &
+     &        +delt*fxt(iso_O18,il,1))/(rr(il,1)+delt*fr(il,1)), &
+     &        'cv3_yield 3125b, ddft en 1')                
           endif !if (iso_HDO.gt.0) then
 #ifdef ISOTRAC
@@ -5386,4 +5393,11 @@
      &         +delt*fxt(iso_HDO,il,1))/(rr(il,1)+delt*fr(il,1)), &
      &         'cv3_yield 3127, dtr melanges')
+          endif !if (iso_HDO.gt.0) then
+          if ((iso_HDO.gt.0).and.(iso_O18.gt.0).and. &
+     &           (rr(il,1)+delt*fr(il,1).gt.ridicule)) then
+           call iso_verif_O18_aberrant((xt(iso_HDO,il,1) &
+     &        +delt*fxt(iso_HDO,il,1))/(rr(il,1)+delt*fr(il,1)),(xt(iso_O18,il,1) &
+     &        +delt*fxt(iso_O18,il,1))/(rr(il,1)+delt*fr(il,1)), &
+     &        'cv3_yield 3127b, dtr melanges')                
           endif !if (iso_HDO.gt.0) then
 #ifdef ISOTRAC
@@ -6111,4 +6125,11 @@
      &           /(rr(il,i)+delt*fr(il,i)),'cv3_yield 3384, flux masse')
         endif !if (iso_HDO.gt.0) then
+        if ((iso_HDO.gt.0).and.(iso_O18.gt.0).and. &
+     &           (rr(il,i)+delt*fr(il,i).gt.ridicule)) then
+           call iso_verif_O18_aberrant((xt(iso_HDO,il,i) &
+     &        +delt*fxt(iso_HDO,il,i))/(rr(il,i)+delt*fr(il,i)),(xt(iso_O18,il,i) &
+     &        +delt*fxt(iso_O18,il,i))/(rr(il,i)+delt*fr(il,i)), &
+     &        'cv3_yield 3384b, flux masse')                
+          endif !if (iso_HDO.gt.0) then
 #ifdef ISOTRAC
         call iso_verif_traceur_justmass(fxt(1,il,1),'cv3_routine 3626')
@@ -6344,19 +6365,19 @@
        do ixt = 1, ntraciso
         fxt(ixt,il,i)=fxt(ixt,il,i) &
-     &   +0.1*dpinv*ment(il,k,i)*(xtent(ixt,il,k,i)-xt(ixt,il,i))
+     &   +0.01*grav*dpinv*ment(il,k,i)*(xtent(ixt,il,k,i)-xt(ixt,il,i))
        enddo
 
 #ifdef DIAGISO
        fq_detrainement(il,i)=fq_detrainement(il,i) &
-              +0.1*dpinv*ment(il,k,i)*(qent(il,k,i)-rr(il,i)) 
+              +0.01*grav*dpinv*ment(il,k,i)*(qent(il,k,i)-rr(il,i)) 
        f_detrainement(il,i)=f_detrainement(il,i) &
-              +0.1*dpinv*ment(il,k,i)
+              +0.01*grav*dpinv*ment(il,k,i)
        q_detrainement(il,i)=q_detrainement(il,i) &
-              +0.1*dpinv*ment(il,k,i)*qent(il,k,i)
+              +0.01*grav*dpinv*ment(il,k,i)*qent(il,k,i)
        do ixt = 1, niso
         fxt_detrainement(ixt,il,i)=fxt_detrainement(ixt,il,i) &
-     &          +0.1*dpinv*ment(il,k,i)*(xtent(ixt,il,k,i)-xt(ixt,il,i))
+     &          +0.01*grav*dpinv*ment(il,k,i)*(xtent(ixt,il,k,i)-xt(ixt,il,i))
         xt_detrainement(ixt,il,i)=xt_detrainement(ixt,il,i) &
-     &          +0.1*dpinv*ment(il,k,i)*xtent(ixt,il,k,i)
+     &          +0.01*grav*dpinv*ment(il,k,i)*xtent(ixt,il,k,i)
        enddo
 #endif     
@@ -6387,4 +6408,11 @@
      &           /(rr(il,i)+delt*fr(il,i)),'cv3_yield 3605b, dtr mels')
           endif !if (iso_HDO.gt.0) then        
+          if ((iso_HDO.gt.0).and.(iso_O18.gt.0).and. &
+     &           (rr(il,i)+delt*fr(il,i).gt.ridicule)) then
+           call iso_verif_O18_aberrant((xt(iso_HDO,il,i) &
+     &        +delt*fxt(iso_HDO,il,i))/(rr(il,i)+delt*fr(il,i)),(xt(iso_O18,il,i) &
+     &        +delt*fxt(iso_O18,il,i))/(rr(il,i)+delt*fr(il,i)), &
+     &        'cv3_yield 6415c, dtr mels')                
+          endif !if (iso_HDO.gt.0) then
 #ifdef ISOTRAC
         call iso_verif_traceur_justmass(fxt(1,il,i),'cv3_routine 3972')
@@ -6553,14 +6581,39 @@
 
 #ifdef ISOVERIF
+        do i=inb(il)-1,inb(il)
         if (iso_eau.gt.0) then
-              call iso_verif_egalite(fxt(iso_eau,il,inb(il)-1), &
-     &           fr(il,inb(il)-1),'cv3_routines 5308')
+              call iso_verif_egalite(fxt(iso_eau,il,i), &
+     &           fr(il,i),'cv3_routines 5308')
         endif !if (iso_eau.gt.0) then
         if ((iso_HDO.gt.0).and. &
-     &           (rr(il,inb(il)-1)+delt*fr(il,inb(il)-1).gt.ridicule)) then
-           call iso_verif_aberrant((xt(iso_HDO,il,inb(il)-1) &
-     &           +delt*fxt(iso_HDO,il,inb(il)-1)) &
-     &           /(rr(il,inb(il)-1)+delt*fr(il,inb(il)-1)),'cv3_yield 6555')
-        endif !if (iso_HDO.gt.0) then    
+     &           (rr(il,i)+delt*fr(il,i).gt.ridicule)) then
+           call iso_verif_aberrant((xt(iso_HDO,il,i) &
+     &           +delt*fxt(iso_HDO,il,i)) &
+     &           /(rr(il,i)+delt*fr(il,i)),'cv3_yield 6555')
+        endif !if (iso_HDO.gt.0) then                 
+          if ((iso_HDO.gt.0).and.(iso_O18.gt.0).and. &
+     &           (rr(il,i)+delt*fr(il,i).gt.ridicule)) then
+           if (iso_verif_O18_aberrant_nostop((xt(iso_HDO,il,i) &
+     &        +delt*fxt(iso_HDO,il,i))/(rr(il,i)+delt*fr(il,i)),(xt(iso_O18,il,i) &
+     &        +delt*fxt(iso_O18,il,i))/(rr(il,i)+delt*fr(il,i)), &
+     &        'cv3_yield 6555b').eq.1) then
+                write(*,*) 'il,i=',il,i
+                write(*,*) 'deltaOavant=',deltaO(xt(iso_O18,il,i)/rr(il,i))
+                write(*,*) 'deltaOapres=',deltaO((xt(iso_O18,il,i) &
+     &                  +delt*fxt(iso_O18,il,i))/(rr(il,i)+delt*fr(il,i)))
+                write(*,*) 'rr,fq*delt=',rr(il,i),delt*fr(il,i)
+                write(*,*) 'deltaOfq=',deltaO(fxt(iso_O18,il,i)/fr(il,i))
+                write(*,*) 'xt,fxt*delt=',xt(iso_O18,il,i),delt*fxt(iso_O18,il,i)
+                write(*,*) 'qent(il,inb(il),inb(il)),rr(il,inb(il))=', &
+     &                   qent(il,inb(il),inb(il)),rr(il,inb(il))
+                write(*,*) 'xtent(il,inb(il),inb(il)),xt(il,inb(il))=', &
+     &                   xtent(iso_O18,il,inb(il),inb(il)),xt(iso_O18,il,inb(il))
+                write(*,*) 'deltaOent=',deltaO(xtent(iso_O18,il,inb(il),inb(il))/qent(il,inb(il),inb(il)))
+                write(*,*) 'bx,xtbx(iso_O18)=',bx,xtbx(iso_O18)
+                stop
+
+           endif                
+         endif !if (iso_HDO.gt.0) then
+        enddo
 #endif        
 #endif
@@ -6752,5 +6805,12 @@
      &           +delt*fxt(iso_HDO,il,i)) &
      &           /(rr(il,i)+delt*fr(il,i)),'cv3_yield 6744')
-        endif !if (iso_HDO.gt.0) then    
+        endif !if (iso_HDO.gt.0) then               
+          if ((iso_HDO.gt.0).and.(iso_O18.gt.0).and. &
+     &           (rr(il,i)+delt*fr(il,i).gt.ridicule)) then
+           call iso_verif_O18_aberrant((xt(iso_HDO,il,i) &
+     &        +delt*fxt(iso_HDO,il,i))/(rr(il,i)+delt*fr(il,i)),(xt(iso_O18,il,i) &
+     &        +delt*fxt(iso_O18,il,i))/(rr(il,i)+delt*fr(il,i)), &
+     &        'cv3_yield 6744b')                
+          endif !if (iso_HDO.gt.0) then  
 #endif         
 #endif
@@ -6800,4 +6860,5 @@
       print *,' CV3_YIELD : alpha_qpos ',alpha_qpos(1)
     ENDIF
+
 !
   DO il = 1, ncum
@@ -6841,6 +6902,26 @@
            call iso_verif_aberrant((xt(iso_HDO,il,i) &
      &           +delt*fxt(iso_HDO,il,i)) &
-     &           /(rr(il,i)+delt*fr(il,i)),'cv3_yield 6835')
-        endif !if (iso_HDO.gt.0) then    
+     &           /(rr(il,i)+delt*fr(il,i)),'cv3_yield 6835a')
+        endif !if (iso_HDO.gt.0) then        
+          if ((iso_HDO.gt.0).and.(iso_O18.gt.0).and. &
+     &           (rr(il,i)+delt*fr(il,i).gt.ridicule)) then
+           if (iso_verif_O18_aberrant_nostop((xt(iso_HDO,il,i) &
+     &        +delt*fxt(iso_HDO,il,i))/(rr(il,i)+delt*fr(il,i)),(xt(iso_O18,il,i) &
+     &        +delt*fxt(iso_O18,il,i))/(rr(il,i)+delt*fr(il,i)), &
+     &        'cv3_yield 6835b').eq.1) then
+                write(*,*) 'il,i=',il,i
+                write(*,*) 'deltaOavant=',deltaO(xt(iso_O18,il,i)/rr(il,i))
+                write(*,*) 'deltaOapres=',deltaO((xt(iso_O18,il,i) &
+     &                  +delt*fxt(iso_O18,il,i))/(rr(il,i)+delt*fr(il,i)))
+                write(*,*) 'rr,fq*delt=',rr(il,i),delt*fr(il,i)
+                write(*,*) 'alpha_qpos=',alpha_qpos(il)
+                write(*,*) 'fq*delt avantqpos=',delt*fr(il,i)*alpha_qpos(il)
+                write(*,*) 'deltaO avantqpos=',deltaO((xt(iso_O18,il,i) &
+     &                  +delt*fxt(iso_O18,il,i)*alpha_qpos(il))/(rr(il,i)+delt*fr(il,i)*alpha_qpos(il)))
+                write(*,*) 'deltaOfq=',deltaO(fxt(iso_O18,il,i)/fr(il,i))
+                write(*,*) 'xt,fxt*delt=',xt(iso_O18,il,i),delt*fxt(iso_O18,il,i)
+                stop
+           endif                
+          endif !if (iso_HDO.gt.0) then 
 #endif    
 #ifdef DIAGISO
