Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/advtrac.F90
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/advtrac.F90	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/advtrac.F90	(revision 3852)
@@ -9,5 +9,5 @@
   !            M.A Filiberti (04/2002)
   !
-  USE infotrac, ONLY: nqtot, iadv,nqperes,ok_iso_verif
+  USE infotrac, ONLY: nqtot, tracers
   USE control_mod, ONLY: iapp_tracvl, day_step
   USE comconst_mod, ONLY: dtvr
@@ -48,4 +48,5 @@
   INTEGER iadvtr
   INTEGER ij,l,iq,iiq
+  INTEGER, POINTER :: iadv(:)
   REAL zdpmin, zdpmax
   EXTERNAL  minmax
@@ -73,4 +74,6 @@
   real, save :: cflxmax(llm),cflymax(llm),cflzmax(llm)
 
+  iadv => tracers(:)%iadv
+
   IF(iadvtr.EQ.0) THEN
      pbaruc(:,:)=0
@@ -219,12 +222,9 @@
      !-----------------------------------------------------------
 
-     if (ok_iso_verif) then
-           write(*,*) 'advtrac 227'
-           call check_isotopes_seq(q,ip1jmp1,'advtrac 162')
-     endif !if (ok_iso_verif) then
-
-     do iq=1,nqperes
+     call check_isotopes_seq(q,ip1jmp1,'advtrac 162')
+
+     do iq=1,nqtot
         !        call clock(t_initial)
-        if(iadv(iq) == 0) cycle 
+        if(iadv(iq) == 0 .OR. tracers(iq)%igen /= 1) cycle 
         !   ----------------------------------------------------------------
         !   Schema de Van Leer I MUSCL
@@ -394,8 +394,5 @@
      end DO
 
-     if (ok_iso_verif) then
-           write(*,*) 'advtrac 402'
-           call check_isotopes_seq(q,ip1jmp1,'advtrac 397')
-     endif !if (ok_iso_verif) then
+     call check_isotopes_seq(q,ip1jmp1,'advtrac 397')
 
      !------------------------------------------------------------------
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/check_isotopes.F
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/check_isotopes.F	(revision 3851)
+++ 	(revision )
@@ -1,201 +1,0 @@
-        subroutine check_isotopes_seq(q,ip1jmp1,err_msg)
-        USE infotrac
-        implicit none
-
-#include "dimensions.h"
-
-        ! inputs
-        integer ip1jmp1
-        real q(ip1jmp1,llm,nqtot)
-        character*(*) err_msg ! message d''erreur à afficher
-
-        ! locals
-        integer ixt,phase,k,i,iq,iiso,izone,ieau,iqeau
-        real xtractot,xiiso
-        real borne
-        real qmin
-        real errmax ! erreur maximale en absolu.
-        real errmaxrel ! erreur maximale en relatif autorisée
-        real deltaDmax,deltaDmin
-        real ridicule
-        parameter (borne=1e19)
-        parameter (errmax=1e-8)
-        parameter (errmaxrel=1e-3)
-        parameter (qmin=1e-11)
-        parameter (deltaDmax=200.0,deltaDmin=-999.9)
-        parameter (ridicule=1e-12)
-        real deltaD
-
-        if (ok_isotopes) then
-
-        write(*,*) 'check_isotopes 31: err_msg=',err_msg
-        ! verifier que rien n'est NaN
-        do ixt=1,ntraciso
-          do phase=1,nqo
-            iq=iqiso(ixt,phase)
-            do k=1,llm
-              DO i = 1,ip1jmp1
-                if ((q(i,k,iq).gt.-borne).and.
-     :            (q(i,k,iq).lt.borne)) then
-                else !if ((x(ixt,i,j).gt.-borne).and.
-                  write(*,*) 'erreur detectee par iso_verif_noNaN:'
-                  write(*,*) err_msg
-                  write(*,*) 'q,i,k,iq=',q(i,k,iq),i,k,iq
-                  write(*,*) 'borne=',borne
-                  stop
-                endif  !if ((x(ixt,i,j).gt.-borne).and.
-              enddo !DO i = 1,ip1jmp1
-            enddo !do k=1,llm
-          enddo !do phase=1,nqo
-        enddo !do ixt=1,ntraciso
-
-        !write(*,*) 'check_isotopes 52'
-        ! verifier que l'eau normale est OK
-        if (use_iso(1)) then
-          ixt=indnum_fn_num(1)
-          do phase=1,nqo
-            iq=iqiso(ixt,phase)
-            do k=1,llm
-            DO i = 1,ip1jmp1  
-              if ((abs(q(i,k,phase)-q(i,k,iq)).gt.errmax).and.
-     :          (abs((q(i,k,phase)-q(i,k,iq))/
-     :           max(max(abs(q(i,k,phase)),abs(q(i,k,iq))),1e-18))
-     :           .gt.errmaxrel)) then
-                  write(*,*) 'erreur detectee par iso_verif_egalite:'
-                  write(*,*) err_msg
-                  write(*,*) 'ixt,phase=',ixt,phase
-                  write(*,*) 'q,iq,i,k=',q(i,k,iq),iq,i,k
-                  write(*,*) 'q(i,k,phase)=',q(i,k,phase)
-                  stop
-              endif !if ((abs(q(i,k,phase)-q(i,k,iq)).gt.errmax).and.
-              ! bidouille pour éviter divergence:
-              q(i,k,iq)= q(i,k,phase) 
-            enddo ! DO i = 1,ip1jmp1
-            enddo !do k=1,llm
-          enddo ! do phase=1,nqo 
-        endif !if (use_iso(1)) then
-        
-        !write(*,*) 'check_isotopes 78'
-        ! verifier que HDO est raisonable
-        if (use_iso(2)) then
-          ixt=indnum_fn_num(2)
-          do phase=1,nqo
-            iq=iqiso(ixt,phase)
-            do k=1,llm
-            DO i = 1,ip1jmp1
-            if (q(i,k,iq).gt.qmin) then
-             deltaD=(q(i,k,iq)/q(i,k,phase)/tnat(2)-1)*1000
-             if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then
-                  write(*,*) 'erreur detectee par iso_verif_aberrant:'
-                  write(*,*) err_msg
-                  write(*,*) 'ixt,phase=',ixt,phase
-                  write(*,*) 'q,iq,i,k,=',q(i,k,iq),iq,i,k
-                  write(*,*) 'q=',q(i,k,:)
-                  write(*,*) 'deltaD=',deltaD
-                  stop
-             endif !if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then
-            endif !if (q(i,k,iq).gt.qmin) then
-            enddo !DO i = 1,ip1jmp1
-            enddo !do k=1,llm
-          enddo ! do phase=1,nqo 
-        endif !if (use_iso(2)) then
-
-        !write(*,*) 'check_isotopes 103'
-        ! verifier que O18 est raisonable
-        if (use_iso(3)) then
-          ixt=indnum_fn_num(3)
-          do phase=1,nqo
-            iq=iqiso(ixt,phase)
-            do k=1,llm
-            DO i = 1,ip1jmp1
-            if (q(i,k,iq).gt.qmin) then
-             deltaD=(q(i,k,iq)/q(i,k,phase)/tnat(3)-1)*1000
-             if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then
-                  write(*,*) 'erreur detectee iso_verif_aberrant O18:'
-                  write(*,*) err_msg
-                  write(*,*) 'ixt,phase=',ixt,phase
-                  write(*,*) 'q,iq,i,k,=',q(i,k,phase),iq,i,k
-                  write(*,*) 'xt=',q(i,k,:)
-                  write(*,*) 'deltaO18=',deltaD
-                  stop
-             endif !if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then
-            endif !if (q(i,k,iq).gt.qmin) then
-            enddo !DO i = 1,ip1jmp1
-            enddo !do k=1,llm
-          enddo ! do phase=1,nqo 
-        endif !if (use_iso(2)) then
-
-
-        !write(*,*) 'check_isotopes 129'
-        if (ok_isotrac) then
-
-          if (use_iso(2).and.use_iso(1)) then
-            do izone=1,ntraceurs_zone
-             ixt=index_trac(izone,indnum_fn_num(2))
-             ieau=index_trac(izone,indnum_fn_num(1))
-             do phase=1,nqo
-               iq=iqiso(ixt,phase)
-               iqeau=iqiso(ieau,phase)
-               do k=1,llm
-                DO i = 1,ip1jmp1
-                if (q(i,k,iq).gt.qmin) then
-                 deltaD=(q(i,k,iq)/q(i,k,iqeau)/tnat(2)-1)*1000
-                 if ((deltaD.gt.deltaDmax).or.
-     &                   (deltaD.lt.deltaDmin)) then
-                  write(*,*) 'erreur dans iso_verif_aberrant trac:'
-                  write(*,*) err_msg
-                  write(*,*) 'izone,phase=',izone,phase
-                  write(*,*) 'ixt,ieau=',ixt,ieau
-                  write(*,*) 'q,iq,i,k,=',q(i,k,iq),iq,i,k
-                  write(*,*) 'deltaD=',deltaD
-                  stop
-                 endif !if ((deltaD.gt.deltaDmax).or.
-                endif !if (q(i,k,iq).gt.qmin) then
-                enddo !DO i = 1,ip1jmp1
-                enddo  ! do k=1,llm
-              enddo ! do phase=1,nqo    
-            enddo !do izone=1,ntraceurs_zone
-          endif !if (use_iso(2).and.use_iso(1)) then
-
-          do iiso=1,niso
-           do phase=1,nqo
-              iq=iqiso(iiso,phase)
-              do k=1,llm
-                DO i = 1,ip1jmp1
-                   xtractot=0.0
-                   xiiso=q(i,k,iq)
-                   do izone=1,ntraceurs_zone
-                      iq=iqiso(index_trac(izone,iiso),phase)
-                      xtractot=xtractot+ q(i,k,iq)
-                   enddo !do izone=1,ntraceurs_zone
-                   if ((abs(xtractot-xiiso).gt.errmax).and.
-     :                  (abs(xtractot-xiiso)/
-     :                  max(max(abs(xtractot),abs(xiiso)),1e-18)
-     :                  .gt.errmaxrel)) then
-                  write(*,*) 'erreur detectee par iso_verif_traceurs:'
-                  write(*,*) err_msg
-                  write(*,*) 'iiso,phase=',iiso,phase
-                  write(*,*) 'i,k,=',i,k
-                  write(*,*) 'q(i,k,:)=',q(i,k,:)
-                  stop
-                 endif !if ((abs(q(i,k,phase)-q(i,k,iq)).gt.errmax).and.
-                  
-                 ! bidouille pour éviter divergence:
-                 if (abs(xtractot).gt.ridicule) then
-                   do izone=1,ntraceurs_zone
-                     ixt=index_trac(izone,iiso) 
-                     q(i,k,iq)=q(i,k,iq)/xtractot*xiiso
-                   enddo !do izone=1,ntraceurs_zone                
-                  endif !if ((abs(xtractot).gt.ridicule) then
-                enddo !DO i = 1,ip1jmp1
-              enddo !do k=1,llm
-           enddo !do phase=1,nqo
-          enddo !do iiso=1,niso
-
-        endif !if (ok_isotrac) then
-
-        endif ! if (ok_isotopes)
-        !write(*,*) 'check_isotopes 198'
-        
-        end
-
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/check_isotopes.F90
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/check_isotopes.F90	(revision 3852)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/check_isotopes.F90	(revision 3852)
@@ -0,0 +1,143 @@
+SUBROUTINE check_isotopes_seq(q, ip1jmp1, err_msg)
+  USE strings_mod, ONLY: strIdx, msg, modname, prt_level
+  USE infotrac,    ONLY: isotope, isoSelect, iH2O, isoCheck, isoName, nqtot, niso, nitr, nzon, npha, iTraPha, iZonIso, tnat
+  IMPLICIT NONE
+  include "dimensions.h"
+  REAL,             INTENT(INOUT) :: q(ip1jmp1,llm,nqtot)
+  INTEGER,          INTENT(IN)    :: ip1jmp1
+  CHARACTER(LEN=*), INTENT(IN)    :: err_msg     !--- Error message to display
+  CHARACTER(LEN=256) :: msg1
+  INTEGER :: ixt, ipha, k, i, iq, iiso, izon, ieau, iqeau
+  INTEGER, ALLOCATABLE :: ix(:)
+  REAL    :: xtractot, xiiso, deltaD, q1, q2
+  REAL, PARAMETER :: borne     = 1e19,  &
+                     errmax    = 1e-8,  &        !--- Max. absolute error
+                     errmaxrel = 1e-8,  &        !--- Max. relative error
+                     qmin      = 1e-11, &
+                     deltaDmax = 200.0, &
+                     deltaDmin =-999.9, &
+                     ridicule  = 1e-12
+  INTEGER, SAVE :: ixH2O, ixHDO, ixO18
+  LOGICAL, SAVE :: first=.TRUE.
+
+  modname = 'check_isotopes'
+  IF(first) THEN
+    IF(isoSelect('H2O')) RETURN
+    ixH2O = strIdx(isoName,'H2[16]O')
+    ixHDO = strIdx(isoName,'H[2]HO')
+    ixO18 = strIdx(isoName,'H2[18]O')
+    first = .FALSE.
+  ELSE
+    IF(isoSelect(iH2O)) RETURN
+  END IF
+  IF(.NOT.isoCheck .OR. niso == 0) RETURN        !--- No need to check or no isotopes => finished
+
+  !--- CHECK FOR NaNs (FOR ALL THE ISOTOPES, INCLUDING GEOGRAPHIC TAGGING TRACERS)
+  DO ixt = 1, nitr
+    DO ipha = 1, npha
+      iq = iTraPha(ixt,ipha)
+      DO k = 1, llm
+        DO i = 1, ip1jmp1
+          IF(ABS(q(i,k,iq))<=borne) CYCLE
+          WRITE(msg1,'(s,"(",i0,",",i0,",",i0,") = ",ES12.4)')isoName(ixt),i,k,iq,q(i,k,iq); CALL msg(msg1)
+          CALL abort_gcm(modname, 'Error in iso_verif_noNaN: '//TRIM(err_msg), 1)
+          STOP
+        END DO
+      END DO
+    END DO
+  END DO
+
+  !--- CHECK CONSERVATION (MAIN ISOTOPE AND PARENT CONCENTRATIONS MUST BE EQUAL)
+  ixt = ixH2O
+  IF(ixt /= 0) THEN
+    DO ipha = 1, npha
+      iq = iTraPha(ixt,ipha)
+      DO k = 1, llm
+        DO i = 1, ip1jmp1
+          q1 = q(i,k,ipha); q2 = q(i,k,iq)
+          IF(ABS(q1-q2) <= errmax .OR. ABS(q1-q2)/MAX(MAX(ABS(q1),ABS(q2)),1e-18) < errmaxrel) CYCLE
+          WRITE(msg1,'("ixt = ",i0)')ixt;                                      CALL msg(msg1)
+          WRITE(msg1,'("q(",i0,",",i0,",iq=",i0,") = ",ES12.4)')i, k, iq, q2;  CALL msg(msg1)
+          WRITE(msg1,'("q(",i0,",",i0,",ipha=",i0,") = ",ES12.4)')i,k,ipha,q1; CALL msg(msg1)
+          CALL abort_gcm(modname, 'Error in iso_verif_egalite: '//TRIM(err_msg), 1)
+          q(i,k,iq) = q(i,k,ipha)                !--- Bidouille pour convergence
+        END DO
+      END DO
+    END DO
+  END IF
+
+  !--- CHECK DELTA ANOMALIES
+  ix = [ixHDO, ixO18]
+  DO iiso = 1, SIZE(ix)
+    ixt = ix(iiso)
+    IF(ixt  == 0) CYCLE
+    DO ipha = 1, npha
+      iq = iTraPha(ixt,ipha)
+      DO k = 1, llm
+        DO i = 1, ip1jmp1
+          q1 = q(i,k,ipha); q2 = q(i,k,iq)
+          IF(q2 <= qmin) CYCLE
+          deltaD = (q2/q1/tnat(ixt)-1)*1000
+          IF(deltaD <= deltaDmax .AND. deltaD >= deltaDmin) CYCLE
+          WRITE(msg1,'("ixt = ",i0)')ixt;                                     CALL msg(msg1)
+          WRITE(msg1,'("q(",i0,",",i0,",iq=",i0,") = ",ES12.4)')i, k, iq, q2; CALL msg(msg1)
+          WRITE(msg1,'("q=",ES12.4)')q(i,k,:);                                CALL msg(msg1)
+          WRITE(msg1,'("deltaD=",ES12.4)')deltaD;                             CALL msg(msg1)
+          CALL abort_gcm(modname, 'Error in iso_verif_aberrant: '//TRIM(err_msg), 1)
+        END DO
+      END DO
+    END DO
+  END DO
+
+  !--- CHECK FOR TAGGING TRACERS DELTAD ANOMALIES
+  IF(nitr == 0) RETURN
+  IF(ixH2O /= 0 .AND. ixHDO /= 0) THEN
+    DO izon = 1, nzon
+      ixt  = iZonIso(izon, ixHDO)
+      ieau = iZonIso(izon, ixH2O)
+      DO ipha = 1, npha
+        iq    = iTraPha(ixt,  ipha)
+        iqeau = iTraPha(ieau, ipha)
+        DO k = 1, llm
+          DO i = 1, ip1jmp1
+            IF(q(i,k,iq)<=qmin) CYCLE
+            deltaD = (q(i,k,iq)/q(i,k,iqeau)/tnat(ixHDO)-1)*1000
+            IF(deltaD <= deltaDmax .AND. deltaD >= deltaDmin) CYCLE
+            WRITE(msg1,'("izon, ipha =",2i0)')izon, ipha;                              CALL msg(msg1)
+            WRITE(msg1,'( "ixt, ieau =",2i0)') ixt, ieau;                              CALL msg(msg1)
+            WRITE(msg1,'("q(",i0,",",i0,",iq=",i0,") = ",ES12.4)')i, k, iq, q(i,k,iq); CALL msg(msg1)
+            WRITE(msg1,'("deltaD=",ES12.4)')deltaD;                                    CALL msg(msg1)
+            CALL abort_gcm(modname, 'Error in iso_verif_aberrant trac: '//TRIM(err_msg), 1)
+          END DO
+        END DO
+      END DO
+    END DO
+  END IF
+
+  !--- CHECK FOR TAGGING TRACERS CONSERVATION (PARENT AND TAGGING TRACERS SUM OVER ALL REGIONS MUST BE EQUAL)
+  DO iiso = 1, niso
+    DO ipha = 1, npha
+      iq = iTraPha(iiso, ipha)
+      DO k = 1, llm
+        DO i = 1, ip1jmp1
+          xiiso = q(i,k,iq)
+          xtractot = SUM(q(i, k, iTraPha(iZonIso(1:nzon,iiso), ipha)))
+          IF(ABS(xtractot-xiiso) > errmax .AND. ABS(xtractot-xiiso)/MAX(MAX(ABS(xtractot),ABS(xiiso)),1e-18) > errmaxrel) THEN
+            CALL msg('Error in iso_verif_aberrant trac: '//TRIM(err_msg))
+            WRITE(msg1,'("iiso, ipha =",2i0)')iiso, ipha;              CALL msg(msg1)
+            WRITE(msg1,'("i, k =",2i0)')i, k;                          CALL msg(msg1)
+            WRITE(msg1,'("q(",i0,",",i0,":) = ",ES12.4)')i,k,q(i,k,:); CALL msg(msg1)
+            STOP
+          END IF
+          IF(ABS(xtractot) <= ridicule) CYCLE
+          DO izon = 1, nzon
+            ixt = iZonIso(izon, iiso) 
+            q(i,k,iq) = q(i,k,iq) / xtractot * xiiso
+          END DO
+        END DO
+      END DO
+    END DO
+  END DO
+
+END SUBROUTINE check_isotopes_seq
+
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/dynetat0.f90
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/dynetat0.f90	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/dynetat0.f90	(revision 3852)
@@ -6,7 +6,8 @@
 ! Purpose: Initial state reading.
 !-------------------------------------------------------------------------------
-  USE infotrac
+  USE infotrac,    ONLY: nqtot, niso, tracers, iTraPha, tnat, alpha_ideal, tra
   USE netcdf,      ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_INQ_VARID, NF90_NoErr, &
                          NF90_CLOSE, NF90_GET_VAR
+  USE strings_mod, ONLY: strIdx
   USE control_mod, ONLY: planet_type
   USE assert_eq_m, ONLY: assert_eq
@@ -36,10 +37,13 @@
 !===============================================================================
 ! Local variables:
-  CHARACTER(LEN=256) :: msg, var, modname
+  CHARACTER(LEN=256) :: sdum, var, modname, oldH2O(3), newH2O(3)
   INTEGER, PARAMETER :: length=100
-  INTEGER :: iq, fID, vID, idecal!, iml, jml, lml, nqt
+  INTEGER :: iq, fID, vID, idecal, ix!, iml, jml, lml, nqt
   REAL    :: time, tab_cntrl(length)               !--- RUN PARAMS TABLE
+ TYPE(tra), POINTER :: tr
 !-------------------------------------------------------------------------------
   modname="dynetat0"
+  oldH2O=['H2Ov ','H2Ol ','H2Oi ']
+  newH2O=['H2O-g','H2O-l','H2O-s']
 
 !--- Initial state file opening
@@ -126,17 +130,32 @@
 !--- Tracers
   DO iq=1,nqtot
-    var=tname(iq)
+    tr => tracers(iq)
+    var = tr%name
     IF(NF90_INQ_VARID(fID,var,vID)==NF90_NoErr) THEN
       CALL err(NF90_GET_VAR(fID,vID,q(:,:,:,iq)),"get",var); CYCLE
+#ifdef INCA
+    ELSE IF(var == "O3") THEN          !--- INCA and O3 missing: take OX instead
+      WRITE(lunout,*) 'Tracer O3 is missing - it is initialized to OX'
+        IF(NF90_INQ_VARID(fID,"OX",vID) == NF90_NoErr) THEN
+           CALL err(NF90_GET_VAR(fID,vID,q(:,:,:,iq)),"get",var); CYCLE
+        END IF
+#endif
+    ELSE                               !--- Old file, water: H2Ov/l/i instead of H2O-g/-l/-s
+      ix = strIdx(newH2O, var)         !--- Current tracer is water (new name) ?
+      IF(ix /= 0) THEN                 !--- Then read the field, using the old name.
+        IF(NF90_INQ_VARID(fID,oldH2O(ix),vID) == NF90_NoErr) THEN
+           CALL err(NF90_GET_VAR(fID,vID,q(:,:,:,iq)),"get",var); CYCLE
+        END IF
+      END IF
     END IF
     WRITE(lunout,*)TRIM(modname)//": Tracer <"//TRIM(var)//"> is missing"
     WRITE(lunout,*)"         It is hence initialized to zero"
     q(:,:,:,iq)=0.
-   !--- CRisi: for isotops, theoretical initialization using very simplified
-   !           Rayleigh distillation las.
-    IF(ok_isotopes.AND.iso_num(iq)>0) THEN
-      IF(zone_num(iq)==0) q(:,:,:,iq)=q(:,:,:,iqpere(iq))*tnat(iso_num(iq))    &
-     &             *(q(:,:,:,iqpere(iq))/30.e-3)**(alpha_ideal(iso_num(iq))-1)
-      IF(zone_num(iq)==1) q(:,:,:,iq)=q(:,:,:,iqiso(iso_indnum(iq),phase_num(iq)))
+    !--- CRisi: for isotops, theoretical initialization using very simplified
+    !           Rayleigh distillation las.
+    IF(niso > 0 .AND. tr%iso_num > 0) THEN
+      IF(tr%iso_zon == 0) q(:,:,:,iq) = q(:,:,:,tr%iprnt)         *        tnat(tr%iso_num)  &
+                                      *(q(:,:,:,tr%iprnt)/30.e-3)**(alpha_ideal(tr%iso_num)-1)
+      IF(tr%iso_zon == 1) q(:,:,:,iq) = q(:,:,:,iTraPha(tr%iso_num,tr%iso_pha))
     END IF
   END DO
@@ -153,10 +172,10 @@
   INTEGER,          INTENT(IN) :: n1, n2
   CHARACTER(LEN=*), INTENT(IN) :: str1, str2
-  CHARACTER(LEN=100) :: s1, s2
+  CHARACTER(LEN=256) :: s1, s2
   IF(n1/=n2) THEN
     s1='value of '//TRIM(str1)//' ='
     s2=' read in starting file differs from parametrized '//TRIM(str2)//' ='
-    WRITE(msg,'(10x,a,i4,2x,a,i4)'),TRIM(ADJUSTL(s1)),n1,TRIM(ADJUSTL(s2)),n2
-    CALL ABORT_gcm(TRIM(modname),TRIM(msg),1)
+    WRITE(sdum,'(10x,a,i4,2x,a,i4)'),TRIM(ADJUSTL(s1)),n1,TRIM(ADJUSTL(s2)),n2
+    CALL ABORT_gcm(TRIM(modname),TRIM(sdum),1)
   END IF
 END SUBROUTINE check_dim
@@ -193,10 +212,10 @@
   IF(ierr==NF90_NoERR) RETURN
   SELECT CASE(typ)
-    CASE('inq');   msg="Field <"//TRIM(nam)//"> is missing"
-    CASE('get');   msg="Reading failed for <"//TRIM(nam)//">"
-    CASE('open');  msg="File opening failed for <"//TRIM(nam)//">"
-    CASE('close'); msg="File closing failed for <"//TRIM(nam)//">"
+    CASE('inq');   sdum="Field <"//TRIM(nam)//"> is missing"
+    CASE('get');   sdum="Reading failed for <"//TRIM(nam)//">"
+    CASE('open');  sdum="File opening failed for <"//TRIM(nam)//">"
+    CASE('close'); sdum="File closing failed for <"//TRIM(nam)//">"
   END SELECT
-  CALL ABORT_gcm(TRIM(modname),TRIM(msg),ierr)
+  CALL ABORT_gcm(TRIM(modname),TRIM(sdum),ierr)
 END SUBROUTINE err
 
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/dynredem.F90
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/dynredem.F90	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/dynredem.F90	(revision 3852)
@@ -7,5 +7,5 @@
   USE IOIPSL
 #endif
-  USE infotrac
+  USE infotrac, ONLY: nqtot, tracers
   USE netcdf, ONLY: NF90_CREATE, NF90_DEF_DIM, NF90_INQ_VARID, NF90_GLOBAL,    &
                     NF90_CLOSE,  NF90_PUT_ATT, NF90_UNLIMITED, NF90_CLOBBER,   &
@@ -145,5 +145,5 @@
   CALL cre_var(nid,"teta" ,"Temperature",[rlonvID,rlatuID,sID,timID])
   DO iq=1,nqtot
-    CALL cre_var(nid,tname(iq),ttext(iq),[rlonvID,rlatuID,sID,timID])
+    CALL cre_var(nid,tracers(iq)%name,tracers(iq)%lnam,[rlonvID,rlatuID,sID,timID])
   END DO
   CALL cre_var(nid,"masse","Masse d air"    ,[rlonvID,rlatuID,sID,timID])
@@ -166,5 +166,5 @@
 ! Purpose: Write the NetCDF restart file (append).
 !-------------------------------------------------------------------------------
-  USE infotrac
+  USE infotrac, ONLY: nqtot, tracers, type_trac
   USE control_mod
   USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_GET_VAR, NF90_INQ_VARID,  &
@@ -226,10 +226,11 @@
 
 !--- Tracers in file "start_trac.nc" (added by Anne)
-  lread_inca=.FALSE.; fil="start_trac.nc"
-  IF(type_trac=='inca') INQUIRE(FILE=fil,EXIST=lread_inca)
+  fil="start_trac.nc"
+  INQUIRE(FILE=fil, EXIST=lread_inca)
+  lread_inca = lread_inca .AND. type_trac == 'inca'
   IF(lread_inca) CALL err(NF90_OPEN(fil,NF90_NOWRITE,nid_trac),"open")
 
 !--- Save tracers
-  DO iq=1,nqtot; var=tname(iq); ierr=-1
+  DO iq=1,nqtot; var=tracers(iq)%name; ierr=-1
     IF(lread_inca) THEN                  !--- Possibly read from "start_trac.nc"
       fil="start_trac.nc"
@@ -237,6 +238,4 @@
       dum='inq'; IF(ierr==NF90_NoErr) dum='fnd'
       WRITE(lunout,*)msg(dum,var)
-
-
       IF(ierr==NF90_NoErr) CALL dynredem_read_u(nid_trac,var,q(:,:,:,iq),llm)
     END IF
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/iniacademic.F90
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/iniacademic.F90	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/iniacademic.F90	(revision 3852)
@@ -5,5 +5,5 @@
 
   USE filtreg_mod, ONLY: inifilr
-  USE infotrac
+  USE infotrac, ONLY: nqtot, niso, tracers, iTraPha, tnat, alpha_ideal, tra
   USE control_mod, ONLY: day_step,planet_type
 #ifdef CPP_IOIPSL
@@ -73,5 +73,7 @@
 
   REAL zdtvr
-  
+
+  TYPE(tra), POINTER :: tr 
+ 
   character(len=*),parameter :: modname="iniacademic"
   character(len=80) :: abort_message
@@ -96,5 +98,5 @@
   time_0=0.
   day_ref=1
-  annee_ref=0
+!  annee_ref=0
 
   im         = iim
@@ -265,15 +267,13 @@
               ! CRisi: init des isotopes
               ! distill de Rayleigh très simplifiée
-              if (ok_isotopes) then
-                if ((iso_num(i).gt.0).and.(zone_num(i).eq.0)) then          
-                   q(:,:,i)=q(:,:,iqpere(i))             &
-      &                  *tnat(iso_num(i))               &
-      &                  *(q(:,:,iqpere(i))/30.e-3)      &
-      &                  **(alpha_ideal(iso_num(i))-1)
-                endif                
-                if ((iso_num(i).gt.0).and.(zone_num(i).eq.1)) then
-                  q(:,:,i)=q(:,:,iqiso(iso_indnum(i),phase_num(i)))
-                endif
-              endif !if (ok_isotopes) then
+              tr => tracers(i)
+              if (niso > 0 .AND. tr%iso_num > 0) then
+                 if(tr%iso_zon == 0) q(:,:,i) =         &
+      &            q(:,:,tr%iprnt)*tnat(tr%iso_num)     &
+      &          *(q(:,:,tr%iprnt)/30.e-3)              &
+      &           **(alpha_ideal(tr%iso_num)-1)
+                 if (tr%iso_zon == 1) q(:,:,i) =        &
+                   q(:,:,iTraPha(tr%iso_num,tr%iso_pha))
+              endif !if (niso > 0 .AND. tr%iso_num > 0)
 
            enddo
@@ -282,7 +282,5 @@
         endif ! of if (planet_type=="earth")
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc')
-        endif !if (ok_iso_verif) then
+        call check_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc')
 
         ! add random perturbation to temperature
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/integrd.F
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/integrd.F	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/integrd.F	(revision 3852)
@@ -212,5 +212,9 @@
         ENDDO
 
+        CALL check_isotopes_seq(q,ip1jmp1,'integrd 342')
+
         CALL qminimum( q, nq, deltap )
+
+        CALL check_isotopes_seq(q,ip1jmp1,'integrd 346')
 
 c
@@ -235,4 +239,5 @@
         ENDDO
        ENDDO
+       CALL check_isotopes_seq(q,ip1jmp1,'integrd 409')
 
 ! Ehouarn: forget about finvmaold
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/leapfrog.F
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/leapfrog.F	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/leapfrog.F	(revision 3852)
@@ -11,5 +11,5 @@
       use IOIPSL
 #endif
-      USE infotrac, ONLY: nqtot,ok_iso_verif
+      USE infotrac, ONLY: nqtot
       USE guide_mod, ONLY : guide_main
       USE write_field, ONLY: writefield
@@ -237,7 +237,5 @@
       jH_cur = jH_cur - int(jH_cur)
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 321')
-        endif !if (ok_iso_verif) then
+      call check_isotopes_seq(q,ip1jmp1,'leapfrog 321')
 
 #ifdef CPP_IOIPSL
@@ -271,7 +269,5 @@
 !      CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 )
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 400')
-        endif !if (ok_iso_verif) then
+      call check_isotopes_seq(q,ip1jmp1,'leapfrog 400')
 
    2  CONTINUE ! Matsuno backward or leapfrog step begins here
@@ -323,8 +319,5 @@
       endif
 
-
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 589')
-        endif !if (ok_iso_verif) then
+      call check_isotopes_seq(q,ip1jmp1,'leapfrog 589')
 
 c-----------------------------------------------------------------------
@@ -345,8 +338,6 @@
 c   -------------------------------------------------------------
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,
+      call check_isotopes_seq(q,ip1jmp1,
      &           'leapfrog 686: avant caladvtrac')
-        endif !if (ok_iso_verif) then
 
       IF( forward. OR . leapf )  THEN
@@ -376,8 +367,5 @@
 c   ----------------------------------
 
-        if (ok_iso_verif) then
-           write(*,*) 'leapfrog 720' 
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 756')
-        endif !if (ok_iso_verif) then
+       call check_isotopes_seq(q,ip1jmp1,'leapfrog 756')
         
        CALL integrd ( nqtot,vcovm1,ucovm1,tetam1,psm1,massem1 ,
@@ -385,8 +373,5 @@
 !     $              finvmaold                                    )
 
-       if (ok_iso_verif) then
-          write(*,*) 'leapfrog 724'
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 762')
-        endif !if (ok_iso_verif) then
+       call check_isotopes_seq(q,ip1jmp1,'leapfrog 762')
 
 c .P.Le Van (26/04/94  ajout de  finvpold dans l'appel d'integrd)
@@ -552,7 +537,5 @@
         CALL massdair(p,masse)
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 1196')
-        endif !if (ok_iso_verif) then
+        call check_isotopes_seq(q,ip1jmp1,'leapfrog 1196')
 
 c-----------------------------------------------------------------------
@@ -639,7 +622,5 @@
 c   preparation du pas d'integration suivant  ......
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 1509')
-        endif !if (ok_iso_verif) then
+      call check_isotopes_seq(q,ip1jmp1,'leapfrog 1509')
 
       IF ( .NOT.purmats ) THEN
@@ -703,7 +684,5 @@
             ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin))
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 1584')
-        endif !if (ok_iso_verif) then
+            call check_isotopes_seq(q,ip1jmp1,'leapfrog 1584')
 
 c-----------------------------------------------------------------------
@@ -785,7 +764,5 @@
       ELSE ! of IF (.not.purmats)
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 1664')
-        endif !if (ok_iso_verif) then
+        call check_isotopes_seq(q,ip1jmp1,'leapfrog 1664')
 
 c       ........................................................
@@ -812,7 +789,5 @@
             ELSE ! of IF(forward) i.e. backward step
  
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'leapfrog 1698')
-        endif !if (ok_iso_verif) then  
+              call check_isotopes_seq(q,ip1jmp1,'leapfrog 1698')
 
               IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/qminimum.F
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/qminimum.F	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/qminimum.F	(revision 3852)
@@ -4,5 +4,5 @@
       SUBROUTINE qminimum( q,nqtot,deltap )
 
-      USE infotrac, ONLY: ok_isotopes,ntraciso,iqiso,ok_iso_verif
+      USE infotrac, ONLY: niso, nitr, iTraPha
       IMPLICIT none
 c
@@ -49,7 +49,5 @@
 c
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'qminimum 52')   
-        endif !if (ok_iso_verif) then     
+      call check_isotopes_seq(q,ip1jmp1,'qminimum 52')   
 
       zx_defau_diag(:,:,:)=0.0
@@ -59,8 +57,6 @@
           if (seuil_liq - q(i,k,iq_liq) .gt. 0.d0 ) then
 
-              if (ok_isotopes) then
-                 zx_defau_diag(i,k,iq_liq)=AMAX1
+              if (niso > 0) zx_defau_diag(i,k,iq_liq)=AMAX1
      :               ( seuil_liq - q(i,k,iq_liq), 0.0 )
-              endif !if (ok_isotopes) then
 
              q(i,k,iq_vap) = q(i,k,iq_vap) + q(i,k,iq_liq) - seuil_liq
@@ -80,7 +76,5 @@
           if ( seuil_vap - q(i,k,iq) .gt. 0.d0 ) then
 
-            if (ok_isotopes) then
-              zx_defau_diag(i,k,iq)=AMAX1( seuil_vap - q(i,k,iq), 0.0 )
-            endif !if (ok_isotopes) then
+            zx_defau_diag(i,k,iq)=AMAX1( seuil_vap - q(i,k,iq), 0.0 )
 
             q(i,k-1,iq) =  q(i,k-1,iq) - ( seuil_vap - q(i,k,iq) ) *
@@ -110,5 +104,5 @@
 
       !write(*,*) 'qminimum 128'
-      if (ok_isotopes) then
+      if (niso > 0) then
       ! CRisi: traiter de même les traceurs d'eau
       ! Mais il faut les prendre à l'envers pour essayer de conserver la
@@ -130,16 +124,16 @@
           if (zx_defau_diag(i,k,iq_vap).gt.0.0) then             
               ! on ajoute la vapeur en k              
-              do ixt=1,ntraciso
-               q(i,k,iqiso(ixt,iq_vap))=q(i,k,iqiso(ixt,iq_vap))
+              do ixt=1,nitr
+               q(i,k,iTraPha(ixt,iq_vap))=q(i,k,iTraPha(ixt,iq_vap))
      :              +zx_defau_diag(i,k,iq_vap)
-     :              *q(i,k-1,iqiso(ixt,iq_vap))/q_follow(i,k-1,iq_vap)
+     :              *q(i,k-1,iTraPha(ixt,iq_vap))/q_follow(i,k-1,iq_vap)
                 
               ! et on la retranche en k-1
-               q(i,k-1,iqiso(ixt,iq_vap))=q(i,k-1,iqiso(ixt,iq_vap))
+               q(i,k-1,iTraPha(ixt,iq_vap))=q(i,k-1,iTraPha(ixt,iq_vap))
      :              -zx_defau_diag(i,k,iq_vap)
      :              *deltap(i,k)/deltap(i,k-1)
-     :              *q(i,k-1,iqiso(ixt,iq_vap))/q_follow(i,k-1,iq_vap)
+     :              *q(i,k-1,iTraPha(ixt,iq_vap))/q_follow(i,k-1,iq_vap)
 
-              enddo !do ixt=1,niso
+              enddo !do ixt=1,nitr
               q_follow(i,k,iq_vap)=   q_follow(i,k,iq_vap)
      :               +zx_defau_diag(i,k,iq_vap)
@@ -151,7 +145,5 @@
        enddo !do k=2,llm
 
-        if (ok_iso_verif) then     
-           call check_isotopes_seq(q,ip1jmp1,'qminimum 168')
-        endif !if (ok_iso_verif) then
+       call check_isotopes_seq(q,ip1jmp1,'qminimum 168')
         
       
@@ -163,12 +155,12 @@
 
               ! on ajoute eau liquide en k en k              
-              do ixt=1,ntraciso
-               q(i,k,iqiso(ixt,iq_liq))=q(i,k,iqiso(ixt,iq_liq))
+              do ixt=1,nitr
+               q(i,k,iTraPha(ixt,iq_liq))=q(i,k,iTraPha(ixt,iq_liq))
      :              +zx_defau_diag(i,k,iq_liq)
-     :              *q(i,k,iqiso(ixt,iq_vap))/q_follow(i,k,iq_vap)
+     :              *q(i,k,iTraPha(ixt,iq_vap))/q_follow(i,k,iq_vap)
               ! et on la retranche à la vapeur en k
-               q(i,k,iqiso(ixt,iq_vap))=q(i,k,iqiso(ixt,iq_vap))
+               q(i,k,iTraPha(ixt,iq_vap))=q(i,k,iTraPha(ixt,iq_vap))
      :              -zx_defau_diag(i,k,iq_liq)
-     :              *q(i,k,iqiso(ixt,iq_vap))/q_follow(i,k,iq_vap)   
+     :              *q(i,k,iTraPha(ixt,iq_vap))/q_follow(i,k,iq_vap)   
               enddo !do ixt=1,niso
               q_follow(i,k,iq_liq)=   q_follow(i,k,iq_liq)
@@ -180,9 +172,7 @@
        enddo !do k=2,llm  
 
-        if (ok_iso_verif) then
-           call check_isotopes_seq(q,ip1jmp1,'qminimum 197')
-        endif !if (ok_iso_verif) then
+       call check_isotopes_seq(q,ip1jmp1,'qminimum 197')
 
-      endif !if (ok_isotopes) then
+      endif !if (niso > 0) then
       !write(*,*) 'qminimum 188'
       
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/vlsplt.F
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/vlsplt.F	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/vlsplt.F	(revision 3852)
@@ -4,5 +4,5 @@
 
       SUBROUTINE vlsplt(q,pente_max,masse,w,pbaru,pbarv,pdt,iq)
-      USE infotrac, ONLY: nqtot,nqdesc,iqfils
+      USE infotrac, ONLY: nqtot, tracers, tra
 c
 c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
@@ -54,5 +54,6 @@
       SAVE temps1,temps2,temps3
       INTEGER iminn,imaxx
-      INTEGER ifils,iq2 ! CRisi
+      INTEGER ichld,iq2 ! CRisi
+      TYPE(tra), POINTER :: tr
 
       REAL qmin,qmax
@@ -61,4 +62,5 @@
       DATA temps1,temps2,temps3/0.,0.,0./
 
+       tr => tracers(iq)
 
         zzpbar = 0.5 * pdt
@@ -83,10 +85,10 @@
       CALL SCOPY(ijp1llm,masse,1,zm(1,1,iq),1)
         
-      if (nqdesc(iq).gt.0) then  
-        do ifils=1,nqdesc(iq)
-          iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then  
+        do ichld=1,tr%ndesc
+          iq2=tr%idesc(ichld)
           CALL SCOPY(ijp1llm,q(1,1,iq2),1,zq(1,1,iq2),1)
         enddo  
-      endif !if (nqfils(iq).gt.0) then
+      endif !if (tr%ndesc > 0) then
 
 cprint*,'Entree vlx1'
@@ -122,7 +124,7 @@
       ENDDO
       ! CRisi: aussi pour les fils
-      if (nqdesc(iq).gt.0) then
-      do ifils=1,nqdesc(iq)
-        iq2=iqfils(ifils,iq)
+      if(tr%ndesc > 0) then
+      do ichld=1,tr%ndesc
+        iq2=tr%idesc(ichld)
         DO l=1,llm
          DO ij=1,ip1jmp1
@@ -133,11 +135,11 @@
          ENDDO
         ENDDO
-      enddo !do ifils=1,nqdesc(iq)    
-      endif ! if (nqdesc(iq).gt.0) then    
+      enddo !do ichld=1,tr%ndesc
+      endif ! if (tr%ndesc > 0)    
 
       RETURN
       END
       RECURSIVE SUBROUTINE vlx(q,pente_max,masse,u_m,iq)
-      USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
+      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
 
 c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
@@ -179,5 +181,6 @@
       ! CRisi
       REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot)
-      INTEGER ifils,iq2 ! CRisi
+      INTEGER ichld,iq2 ! CRisi
+      TYPE(tra), POINTER :: tr
 
       Logical extremum,first,testcpu
@@ -200,4 +203,6 @@
          first=.false.
       ENDIF
+
+      tr => tracers(iq)
 
 c   calcul de la pente a droite et a gauche de la maille
@@ -450,7 +455,7 @@
       !write(*,*) 'vlsplt 326: iq,nqfils(iq)=',iq,nqfils(iq) 
       
-      if (nqdesc(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then  
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
           DO ij=iip2,ip1jm
@@ -460,10 +465,10 @@
           enddo   
          enddo
-        enddo !do ifils=1,nqdesc(iq)
-        do ifils=1,nqfils(iq)
-         iq2=iqfils(ifils,iq)
+        enddo !do ichld=1,tr%ndesc
+        do ichld=1,tr%nchld
+         iq2=tr%idesc(ichld)
          call vlx(Ratio,pente_max,masseq,u_mq,iq2)
-        enddo !do ifils=1,nqfils(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%nchld
+      endif !if (tr%nchld > 0) then
 ! end CRisi
 
@@ -489,7 +494,7 @@
       ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio 
       ! puis on boucle en longitude
-      if (nqdesc(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)  
+      if (tr%ndesc > 0) then  
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)  
          DO l=1,llm
           DO ij=iip2+1,ip1jm
@@ -500,6 +505,6 @@
           enddo ! DO ij=ijb+iip1-1,ije,iip1
          enddo !DO l=1,llm
-        enddo !do ifils=1,nqdesc(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%ndesc
+      endif !if (tr%ndesc > 0) then
 
 c     CALL SCOPY((jjm-1)*llm,q(iip1+iip1,1),iip1,q(iip2,1),iip1)
@@ -510,5 +515,5 @@
       END
       RECURSIVE SUBROUTINE vly(q,pente_max,masse,masse_adv_v,iq)
-      USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
+      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
 c
 c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
@@ -562,6 +567,6 @@
 
       REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot) ! CRisi
-      INTEGER ifils,iq2 ! CRisi
-
+      INTEGER ichld,iq2 ! CRisi
+      TYPE(tra), POINTER :: tr
 c
 c
@@ -590,4 +595,5 @@
       ENDIF
 
+      tr => tracers(iq)
 c
 cPRINT*,'CALCUL EN LATITUDE'
@@ -770,7 +776,7 @@
       !write(*,*) 'vly 689: iq,nqfils(iq)=',iq,nqfils(iq) 
    
-      if (nqfils(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then  
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
          DO ij=1,ip1jmp1
@@ -781,11 +787,11 @@
           enddo   
          enddo
-        enddo !do ifils=1,nqdesc(iq)
-
-        do ifils=1,nqfils(iq)
-         iq2=iqfils(ifils,iq)
+        enddo !do ichld=1,tr%ndesc
+
+        do ichld=1,tr%nchld
+         iq2=tr%idesc(ichld)
          call vly(Ratio,pente_max,masseq,qbyv,iq2)
-        enddo !do ifils=1,nqfils(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%nchld
+      endif !if (tr%ndesc > 0)
 
       DO l=1,llm
@@ -855,7 +861,7 @@
   
 ! retablir les fils en rapport de melange par rapport a l'air:
-      if (nqfils(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)  
+      if (tr%ndesc > 0) then  
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)  
          DO l=1,llm
           DO ij=1,ip1jmp1
@@ -863,6 +869,6 @@
           enddo
          enddo
-        enddo !do ifils=1,nqdesc(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%ndesc
+      endif !if (tr%ndesc > 0)
 
       !write(*,*) 'vly 853: sortie'
@@ -871,5 +877,5 @@
       END
       RECURSIVE SUBROUTINE vlz(q,pente_max,masse,w,iq)
-      USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi 
+      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi 
 c
 c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
@@ -907,5 +913,6 @@
 
       REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot) ! CRisi
-      INTEGER ifils,iq2 ! CRisi
+      INTEGER ichld,iq2 ! CRisi
+      TYPE(tra), POINTER :: tr
 
       LOGICAL testcpu
@@ -923,4 +930,6 @@
 
       !write(*,*) 'vlz 923: entree'
+
+      tr => tracers(iq)
 
 #ifdef BIDON
@@ -992,7 +1001,7 @@
 ! Il faut faire ça avant d'avoir mis à jour q et masse
       !write(*,*) 'vlsplt 942: iq,nqfils(iq)=',iq,nqfils(iq)
-      if (nqfils(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then  
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
           DO ij=1,ip1jmp1
@@ -1001,11 +1010,11 @@
           enddo   
          enddo
-        enddo !do ifils=1,nqdesc(iq)
+        enddo !do ichld=1,tr%ndesc
         
-        do ifils=1,nqfils(iq)
-         iq2=iqfils(ifils,iq)         
+        do ichld=1,tr%nchld
+         iq2=tr%idesc(ichld)         
          call vlz(Ratio,pente_max,masseq,wq,iq2)
-        enddo !do ifils=1,nqfils(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%nchld
+      endif !if (tr%ndesc > 0)
 ! end CRisi  
 
@@ -1020,7 +1029,7 @@
 
 ! retablir les fils en rapport de melange par rapport a l'air:
-      if (nqfils(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)  
+      if (tr%ndesc > 0) then  
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
           DO ij=1,ip1jmp1
@@ -1028,6 +1037,6 @@
           enddo
          enddo
-        enddo !do ifils=1,nqdesc(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%ndesc
+      endif !if (tr%ndesc > 0)
       !write(*,*) 'vlsplt 1032'
 
Index: LMDZ6/branches/LMDZ-tracers/libf/dyn3d/vlspltqs.F
===================================================================
--- LMDZ6/branches/LMDZ-tracers/libf/dyn3d/vlspltqs.F	(revision 3851)
+++ LMDZ6/branches/LMDZ-tracers/libf/dyn3d/vlspltqs.F	(revision 3852)
@@ -4,5 +4,5 @@
        SUBROUTINE vlspltqs ( q,pente_max,masse,w,pbaru,pbarv,pdt,
      ,                                  p,pk,teta,iq             )
-       USE infotrac, ONLY: nqtot,nqdesc,iqfils
+       USE infotrac, ONLY: nqtot, tracers, tra
 c
 c     Auteurs:   P.Le Van, F.Hourdin, F.Forget, F.Codron 
@@ -45,5 +45,6 @@
 c
       INTEGER i,ij,l,j,ii
-      INTEGER ifils,iq2 ! CRisi
+      INTEGER ichld,iq2 ! CRisi
+      TYPE(tra), POINTER :: tr
 c
       REAL qsat(ip1jmp1,llm)
@@ -84,4 +85,6 @@
         rtt  = 273.16
 
+        tr => tracers(iq)
+
 c-- Calcul de Qsat en chaque point
 c-- approximation: au milieu des couches play(l)=(p(l)+p(l+1))/2
@@ -121,10 +124,10 @@
       CALL SCOPY(ijp1llm,q(1,1,iq),1,zq(1,1,iq),1)
       CALL SCOPY(ijp1llm,masse,1,zm(1,1,iq),1)
-      if (nqdesc(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-        iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then  
+       do ichld=1,tr%ndesc
+        iq2=tr%idesc(ichld)
         CALL SCOPY(ijp1llm,q(1,1,iq2),1,zq(1,1,iq2),1)
        enddo  
-      endif !if (nqfils(iq).gt.0) then
+      endif !if (tr%ndesc > 0)
 
 c      call minmaxq(zq,qmin,qmax,'avant vlxqs     ')
@@ -162,7 +165,7 @@
       ENDDO
       ! CRisi: aussi pour les fils
-      if (nqdesc(iq).gt.0) then
-      do ifils=1,nqdesc(iq)
-        iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then
+      do ichld=1,tr%ndesc
+        iq2=tr%idesc(ichld)
         DO l=1,llm
          DO ij=1,ip1jmp1
@@ -173,6 +176,6 @@
          ENDDO
         ENDDO
-      enddo !do ifils=1,nqdesc(iq)  
-      endif ! if (nqfils(iq).gt.0) then
+      enddo !do ichld=1,tr%ndesc
+      endif ! if (tr%ndesc > 0)
       !write(*,*) 'vlspltqs 183: fin de la routine'
 
@@ -180,5 +183,5 @@
       END
       SUBROUTINE vlxqs(q,pente_max,masse,u_m,qsat,iq)
-      USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
+      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
 
 c
@@ -218,5 +221,6 @@
       ! CRisi
       REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot)
-      INTEGER ifils,iq2 ! CRisi
+      INTEGER ichld,iq2 ! CRisi
+      TYPE(tra), POINTER :: tr
 
       Logical first,testcpu
@@ -238,4 +242,6 @@
          first=.false.
       ENDIF
+
+      tr => tracers(iq)
 
 c   calcul de la pente a droite et a gauche de la maille
@@ -485,7 +491,7 @@
       !write(*,*) 'vlspltqs 326: iq,nqfils(iq)=',iq,nqfils(iq) 
       
-      if (nqfils(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
           DO ij=iip2,ip1jm
@@ -495,10 +501,10 @@
           enddo   
          enddo
-        enddo !do ifils=1,nqdesc(iq)
-        do ifils=1,nqfils(iq)
-         iq2=iqfils(ifils,iq)
+        enddo !do ichld=1,nqdesc(iq)
+        do ichld=1,tr%nchld
+         iq2=tr%idesc(ichld)
          call vlx(Ratio,pente_max,masseq,u_mq,iq2)
-        enddo !do ifils=1,nqfils(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%nchld
+      endif !if (tr%ndesc > 0)
 ! end CRisi
 
@@ -523,7 +529,7 @@
       ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio 
       ! puis on boucle en longitude
-      if (nqdesc(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)  
+      if (tr%ndesc > 0) then
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
           DO ij=iip2+1,ip1jm
@@ -534,6 +540,6 @@
           enddo ! DO ij=ijb+iip1-1,ije,iip1
          enddo !DO l=1,llm
-        enddo !do ifils=1,nqdesc(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%ndesc
+      endif !if (tr%ndesc > 0)
 
 c     CALL SCOPY((jjm-1)*llm,q(iip1+iip1,1),iip1,q(iip2,1),iip1)
@@ -544,5 +550,5 @@
       END
       SUBROUTINE vlyqs(q,pente_max,masse,masse_adv_v,qsat,iq)
-      USE infotrac, ONLY : nqtot,nqfils,nqdesc,iqfils ! CRisi
+      USE infotrac, ONLY : nqtot, tracers, tra ! CRisi
 c
 c     Auteurs:   P.Le Van, F.Hourdin, F.Forget 
@@ -598,5 +604,6 @@
 
       REAL masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot) ! CRisi
-      INTEGER ifils,iq2 ! CRisi
+      INTEGER ichld,iq2 ! CRisi
+      TYPE(tra), POINTER :: tr
 c
 c
@@ -623,4 +630,5 @@
       ENDIF
 
+      tr => tracers(iq)
 c
 
@@ -796,7 +804,7 @@
       !write(*,*) 'vlyqs 689: iq,nqfils(iq)=',iq,nqfils(iq) 
    
-      if (nqfils(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)
+      if (tr%ndesc > 0) then
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
          DO ij=1,ip1jmp1
@@ -805,12 +813,12 @@
           enddo   
          enddo
-        enddo !do ifils=1,nqdesc(iq)
-
-        do ifils=1,nqfils(iq)
-         iq2=iqfils(ifils,iq)
+        enddo !do ichld=1,tr%ndesc
+
+        do ichld=1,tr%nchld
+         iq2=tr%idesc(ichld)
          !write(*,*) 'vlyqs 783: appel rec de vly, iq2=',iq2
          call vly(Ratio,pente_max,masseq,qbyv,iq2)
-        enddo !do ifils=1,nqfils(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%nchld
+      endif !if (tr%ndesc > 0)
 
       DO l=1,llm
@@ -868,7 +876,7 @@
 
 ! retablir les fils en rapport de melange par rapport a l'air:
-      if (nqdesc(iq).gt.0) then  
-       do ifils=1,nqdesc(iq)
-         iq2=iqfils(ifils,iq)  
+      if (tr%ndesc > 0) then
+       do ichld=1,tr%ndesc
+         iq2=tr%idesc(ichld)
          DO l=1,llm
           DO ij=1,ip1jmp1
@@ -876,6 +884,6 @@
           enddo
          enddo
-        enddo !do ifils=1,nqdesc(iq)
-      endif !if (nqfils(iq).gt.0) then
+        enddo !do ichld=1,tr%ndesc
+      endif !if (tr%ndesc > 0)
       !write(*,*) 'vly 879'
 
