Index: LMDZ6/trunk/libf/dyn3d/dynetat0.f90
===================================================================
--- LMDZ6/trunk/libf/dyn3d/dynetat0.f90	(revision 4062)
+++ LMDZ6/trunk/libf/dyn3d/dynetat0.f90	(revision 4063)
@@ -7,5 +7,6 @@
 !-------------------------------------------------------------------------------
   USE infotrac,    ONLY: nqtot, tracers, iqiso, iso_indnum, tnat, alpha_ideal, &
-                         ok_isotopes, maxlen
+                         ok_isotopes
+  USE strings_mod, ONLY: maxlen
   USE netcdf,      ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_INQ_VARID, NF90_NoErr, &
                          NF90_CLOSE, NF90_GET_VAR
Index: LMDZ6/trunk/libf/dyn3d/dynredem.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3d/dynredem.F90	(revision 4062)
+++ LMDZ6/trunk/libf/dyn3d/dynredem.F90	(revision 4063)
@@ -7,5 +7,6 @@
   USE IOIPSL
 #endif
-  USE infotrac, ONLY: nqtot, tracers, maxlen
+  USE strings_mod, ONLY: maxlen
+  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,   &
@@ -166,5 +167,6 @@
 ! Purpose: Write the NetCDF restart file (append).
 !-------------------------------------------------------------------------------
-  USE infotrac, ONLY: nqtot, tracers, type_trac, maxlen
+  USE strings_mod, ONLY: maxlen
+  USE infotrac, ONLY: nqtot, tracers, type_trac
   USE control_mod
   USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_GET_VAR, NF90_INQ_VARID,  &
Index: LMDZ6/trunk/libf/dyn3d_common/infotrac.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3d_common/infotrac.F90	(revision 4062)
+++ LMDZ6/trunk/libf/dyn3d_common/infotrac.F90	(revision 4063)
@@ -3,62 +3,176 @@
 MODULE infotrac
 
-  USE readTracFiles_mod, ONLY: trac_type, isot_type, maxlen, ancestor, delPhase
-
-! nqtot : total number of tracers and higher order of moment, water vapor and liquid included
-  INTEGER, SAVE :: nqtot
-!CR: on ajoute le nombre de traceurs de l eau
-  INTEGER, SAVE :: nqo
-
-! nbtr : number of tracers not including higher order of moment or water vapor or liquid
-!        number of tracers used in the physics
-  INTEGER, SAVE :: nbtr
-
-! Nombre de traceurs passes a phytrac
-  INTEGER, SAVE :: nqtottr
-
-! ThL: nb traceurs CO2
-  INTEGER, SAVE :: nqCO2
-
-! DC: derived types containing informations about tracers and isotopes
-  TYPE(trac_type), TARGET,  SAVE, ALLOCATABLE ::  tracers(:)    !=== TRACERS DESCRIPTORS VECTOR
-  TYPE(isot_type), TARGET,  SAVE, ALLOCATABLE :: isotopes(:)    !=== ISOTOPES PARAMETERS VECTOR
-
-  REAL :: qperemin,masseqmin,ratiomin ! MVals et CRisi
-  PARAMETER (qperemin=1e-30,masseqmin=1e-18,ratiomin=1e-16) ! MVals
-
-! conv_flg(it)=0 : convection desactivated for tracer number it 
-  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE  :: conv_flg
-! pbl_flg(it)=0  : boundary layer diffusion desactivaded for tracer number it 
-  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE  :: pbl_flg
-
-  CHARACTER(len=4),SAVE :: type_trac
-  CHARACTER(len=8),DIMENSION(:),ALLOCATABLE, SAVE :: solsym
+   USE       strings_mod, ONLY: msg, find, strIdx,  strFind, strParse, dispTable, int2str, reduceExpr,   &
+                               fmsg, test, strTail, strHead, strStack, strReduce, maxlen,  testFile, cat
+   USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, addPhase,  phases_sep,  nphases, ancestor,  &
+                                isot_type, readIsotopesFile, delPhase,   old_phases, getKey_init, tran0, &
+                                keys_type, initIsotopes,  indexUpdate, known_phases, getKey, setGeneration
+
+   IMPLICIT NONE
+
+   PRIVATE
+
+   !=== FOR TRACERS:
+   PUBLIC :: infotrac_init                                 !--- Initialization of the tracers
+   PUBLIC :: tracers, type_trac                            !--- Full tracers database, tracers type keyword
+   PUBLIC :: nqtot,   nbtr,   nqo,   nqCO2,   nqtottr      !--- Main dimensions
+   PUBLIC :: solsym, conv_flg, pbl_flg                     !--- Tracers names + convection & boundary layer activation keys
+
+   !=== FOR ISOTOPES: General
+   PUBLIC :: isotopes,  nbIso                              !--- Derived type, full isotopes families database + nb of families
+   PUBLIC :: isoSelect, ixIso                              !--- Isotopes family selection tool + selected family index
+   PUBLIC :: min_qParent, min_qMass, min_ratio             !--- Min. values for various isotopic quantities
+   !=== FOR ISOTOPES: Specific to water
+   PUBLIC :: iH2O, tnat, alpha_ideal                       !--- H2O isotopes index, natural abundance, fractionning coeff.
+   !=== FOR ISOTOPES: Depending on the selected isotopes family
+   PUBLIC :: isotope, isoKeys                              !--- Selected isotopes database + associated keys (cf. getKey)
+   PUBLIC :: isoName, isoZone, isoPhas                     !--- Isotopes and tagging zones names, phases
+   PUBLIC :: niso,    nzone,   nphas,   ntiso              !---  " " numbers + isotopes & tagging tracers number
+   PUBLIC :: iZonIso, iTraPha                              !--- 2D index tables to get "iq" index
+   PUBLIC :: isoCheck                                      !--- Run isotopes checking routines
+   !=== FOR BOTH TRACERS AND ISOTOPES
+   PUBLIC :: getKey                                        !--- Get a key from "tracers" or "isotope"
+
+   PUBLIC :: ntraciso, ntraceurs_zone, iqiso
+   PUBLIC :: ok_isotopes, ok_iso_verif, ok_isotrac, ok_init_iso, use_iso
+   PUBLIC :: index_trac, iso_indnum, indnum_fn_num, niso_possibles
+   PUBLIC :: qperemin, masseqmin, ratiomin
+
+   INTERFACE isoSelect; MODULE PROCEDURE isoSelectByIndex, isoSelectByName; END INTERFACE isoSelect
+
+!=== CONVENTIONS FOR TRACERS NUMBERS:
+!  |--------------------+-----------------------+-----------------+---------------+----------------------------|
+!  | water in different |    water tagging      |  water isotopes | other tracers | additional tracers moments |
+!  | phases: H2O_[gls]  |      isotopes         |                 |               |  for higher order schemes  |
+!  |--------------------+-----------------------+-----------------+---------------+----------------------------|
+!  |                    |                       |                 |               |                            |
+!  |<--     nqo      -->|<-- nqo*niso* nzone -->|<-- nqo*niso  -->|<--  nbtr   -->|<--        (nmom)        -->|         
+!  |                    |                                         |                                            |
+!  |                    |<-- nqo*niso*(nzone+1)  =   nqo*ntiso -->|<--    nqtottr = nbtr + nmom             -->|
+!  |                                                                              = nqtot - nqo*(ntiso+1)      |
+!  |                                                                                                           |
+!  |<--                        nqtrue  =  nbtr + nqo*(ntiso+1)                 -->|                            |
+!  |                                                                                                           |
+!  |<--                        nqtot   =  nqtrue + nmom                                                     -->|
+!  |                                                                                                           |
+!  |-----------------------------------------------------------------------------------------------------------|
+!  NOTES FOR THIS TABLE:
+!  * Used "niso", "nzone" and "ntiso" are components of "isotopes(ip)" for water (isotopes(ip)%parent == 'H2O'),
+!    since water is so far the sole tracers family, except passive CO2, removed from the main tracers table.
+!  * For water, "nqo" is equal to the more general field "isotopes(ip)%nphas".
+!  * "niso", "nzone", "ntiso", "nphas" are defined for other isotopic tracers families, if any.
+!
+!=== DERIVED TYPE EMBEDDING MOST OF THE TRACERS-RELATED QUANTITIES (LENGTH: nqtot)
+!    Each entry is accessible using "%" sign.
+!  |-------------+------------------------------------------------------+-------------+------------------------+
+!  |  entry      | Meaning                                              | Former name | Possible values        |
+!  |-------------+------------------------------------------------------+-------------+------------------------+
+!  | name        | Name (short)                                         | tname       |                        |
+!  | gen0Name    | Name of the 1st generation ancestor                  | /           |                        |
+!  | parent      | Name of the parent                                   | /           |                        |
+!  | longName    | Long name (with adv. scheme suffix) for outputs      | ttext       |                        |
+!  | type        | Type (so far: tracer or tag)                         | /           | tracer,tag             |
+!  | phase       | Phases list ("g"as / "l"iquid / "s"olid)             | /           | [g][l][s]              |
+!  | component   | Name(s) of the merged/cumulated section(s)           | /           | coma-separated names   |
+!  | iadv        | Advection scheme number                              | iadv        | 1-20,30 exc. 3-9,15,19 |
+!  | iGeneration | Generation (>=1)                                     | /           |                        |
+!  | isAdvected  | advected tracers flag (.TRUE. if iadv > 0)           | /           | nqtrue  .TRUE. values  |
+!  | isH2Ofamily | H2O tracer/isotope/tagging tracer                    | /           | nqtottr .TRUE. values  |
+!  | iqParent    | Index of the parent tracer                           | iqpere      | 1:nqtot                |
+!  | iqDescen    | Indexes of the childs       (all generations)        | iqfils      | 1:nqtot                |
+!  | nqDescen    | Number of the descendants   (all generations)        | nqdesc      | 1:nqtot                |
+!  | nqChilds    | Number of childs            (1st generation only)    | nqfils      | 1:nqtot                |
+!  | iso_iGroup  | Isotopes group index in isotopes(:)                  | /           | 1:nbIso                |
+!  | iso_iName   | Isotope  name  index in isotopes(iso_iGroup)%trac(:) | iso_indnum  | 1:niso                 |
+!  | iso_iZone   | Isotope  zone  index in isotopes(iso_iGroup)%zone(:) | zone_num    | 1:nzone                |
+!  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
+!  | keys        | key/val pairs accessible with "getKey" routine       | /           |                        |
+!  +-------------+------------------------------------------------------+-------------+------------------------+
+!
+!=== DERIVED TYPE EMBEDDING MOST OF THE ISOTOPES-RELATED QUANTITIES (LENGTH: nbIso, NUMBER OF ISOTOPES FAMILIES)
+!    Each entry is accessible using "%" sign.
+!  |-----------------+--------------------------------------------------+----------------+-----------------+
+!  |  entry | length | Meaning                                          | Former name    | Possible values |
+!  |-----------------+--------------------------------------------------+----------------+-----------------+
+!  | parent          | Parent tracer (isotopes family name)             |                |                 |
+!  | keys   | niso   | Isotopes keys/values pairs list + number         |                |                 |
+!  | trac   | ntiso  | Isotopes + tagging tracers list + number         |                |                 |
+!  | zone   | nzone  | Geographic tagging zones   list + number         |                |                 |
+!  | phase  | nphas  | Phases                     list + number         |                | [g][l][s], 1:3  |
+!  | niso            | Number of isotopes, excluding tagging tracers    |                |                 |
+!  | ntiso           | Number of isotopes, including tagging tracers    | ntraciso       |                 |
+!  | nzone           | Number of geographic tagging zones               | ntraceurs_zone |                 |
+!  | nphas           | Number of phases                                 |                |                 |
+!  | iTraPha         | Index in "trac(1:niso)" = f(name(1:ntiso)),phas) | iqiso          | 1:niso          |
+!  | iZonIso         | Index in "trac(1:ntiso)" = f(zone, name(1:niso)) | index_trac     | 1:nzone         |
+!  |-----------------+--------------------------------------------------+----------------+-----------------+
+
+   REAL, PARAMETER :: min_qParent = 1.e-30, min_qMass = 1.e-18, min_ratio = 1.e-16 ! MVals et CRisi
+
+   !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES
+   INTEGER,                 SAVE :: nqtot,  &                   !--- Tracers nb in dynamics (incl. higher moments + H2O)
+                                    nbtr,   &                   !--- Tracers nb in physics  (excl. higher moments + H2O)
+                                    nqo,    &                   !--- Number of water phases
+                                    nbIso,  &                   !--- Number of available isotopes family
+                                    nqtottr, &                  !--- Number of tracers passed to phytrac (TO BE DELETED ?)
+                                    nqCO2                       !--- Number of tracers of CO2  (ThL)
+   CHARACTER(LEN=maxlen),   SAVE :: type_trac                   !--- Keyword for tracers type
+
+   !=== DERIVED TYPES EMBEDDING MOST INFORMATIONS ABOUT TRACERS AND ISOTOPES FAMILIES
+   TYPE(trac_type), TARGET, SAVE, ALLOCATABLE ::  tracers(:)    !=== TRACERS DESCRIPTORS VECTOR
+   TYPE(isot_type), TARGET, SAVE, ALLOCATABLE :: isotopes(:)    !=== ISOTOPES PARAMETERS VECTOR
+
+   !=== ALIASES FOR CURRENTLY SELECTED ISOTOPES FAMILY OF VARIABLES EMBEDDED IN THE VECTOR "isotopes"
+   TYPE(isot_type),         SAVE, POINTER :: isotope            !--- CURRENTLY SELECTED ISOTOPES FAMILY DESCRIPTOR
+   INTEGER,                 SAVE          :: ixIso, iH2O        !--- Index of the selected isotopes family and H2O family
+   LOGICAL,                 SAVE          :: isoCheck           !--- Flag to trigger the checking routines
+   TYPE(keys_type),         SAVE, POINTER :: isoKeys(:)         !--- ONE SET OF KEYS FOR EACH ISOTOPE (LISTED IN isoName)
+   CHARACTER(LEN=maxlen),   SAVE, POINTER :: isoName(:),   &    !--- ISOTOPES NAMES FOR THE CURRENTLY SELECTED FAMILY
+                                             isoZone(:),   &    !--- TAGGING ZONES  FOR THE CURRENTLY SELECTED FAMILY
+                                             isoPhas            !--- USED PHASES    FOR THE CURRENTLY SELECTED FAMILY
+   INTEGER, TARGET,         SAVE          ::  niso, nzone, &    !--- NUMBER OF ISOTOPES, TAGGING ZONES AND PHASES
+                                             nphas, ntiso       !--- NUMBER OF PHASES AND ISOTOPES + ISOTOPIC TAGGING TRACERS
+   INTEGER,                 SAVE, POINTER :: iZonIso(:,:)       !--- INDEX IN "isoTrac" AS f(tagging zone, isotope)
+   INTEGER,                 SAVE, POINTER :: iTraPha(:,:)       !--- INDEX IN "isoTrac" AS f(isotopic tracer, phase)
+   INTEGER, ALLOCATABLE,    SAVE ::  index_trac(:,:) ! numero ixt en fn izone, indnum entre 1 et niso
+   INTEGER, ALLOCATABLE,    SAVE ::  iqiso(:,:)      ! donne indice iq en fn de (ixt,phase) 
+
+   !--- Aliases for older names
+   INTEGER, POINTER, SAVE :: ntraciso, ntraceurs_zone
+   REAL,    POINTER, SAVE :: qperemin, masseqmin, ratiomin
 
 ! CRisi: cas particulier des isotopes
-  LOGICAL,SAVE :: ok_isotopes,ok_iso_verif,ok_isotrac,ok_init_iso
-  INTEGER :: niso_possibles   
-  PARAMETER ( niso_possibles=5)
-  REAL, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal
-  LOGICAL, DIMENSION(niso_possibles),SAVE ::  use_iso
-  INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE ::  iqiso ! donne indice iq en fn de (ixt,phase) 
-  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE ::  iso_indnum ! donne numero iso entre 1 et niso effectif en fn de nqtot
-  INTEGER, DIMENSION(niso_possibles), SAVE :: indnum_fn_num ! donne indice entre entre 1 et niso en fonction du numero d isotope entre 1 et niso_possibles
-  INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE ::  index_trac ! numero ixt en fn izone, indnum entre 1 et niso
-  INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso
+   INTEGER, PARAMETER :: niso_possibles = 5
+   LOGICAL, SAVE      :: ok_isotopes, ok_iso_verif, ok_isotrac, ok_init_iso
+   LOGICAL, SAVE, ALLOCATABLE ::       use_iso(:)
+   INTEGER, SAVE, ALLOCATABLE ::    iso_indnum(:)     !--- Gives 1<=idx<=niso_possibles as function(1<=iq <=nqtot)
+   INTEGER, SAVE, ALLOCATABLE :: indnum_fn_num(:)     !--- Gives 1<=idx<=niso           as function(1<=idx<=niso_possibles)
+
+   !=== VARIABLES FOR ISOTOPES INITIALIZATION AND FOR INCA
+   REAL,               SAVE, ALLOCATABLE ::     tnat(:),  &     !--- Natural relative abundance of water isotope        (niso)
+                                         alpha_ideal(:)         !--- Ideal fractionning coefficient (for initial state) (niso)
+   INTEGER,            SAVE, ALLOCATABLE :: conv_flg(:),  &     !--- Convection     activation ; needed for INCA        (nbtr)
+                                             pbl_flg(:)         !--- Boundary layer activation ; needed for INCA        (nbtr)
+   CHARACTER(LEN=8),   SAVE, ALLOCATABLE ::   solsym(:)         !--- Names from INCA                                    (nbtr)
+   LOGICAL, PARAMETER :: lOldCode = .TRUE.
 
 CONTAINS
 
-  SUBROUTINE infotrac_init
-    USE control_mod, ONLY: planet_type, config_inca
+SUBROUTINE infotrac_init
+   USE control_mod, ONLY: planet_type, config_inca
 #ifdef REPROBUS
-    USE CHEM_REP, ONLY : Init_chem_rep_trac
-#endif
-    IMPLICIT NONE
-!=======================================================================
+   USE CHEM_REP,    ONLY: Init_chem_rep_trac
+#endif
+   IMPLICIT NONE
+!==============================================================================================================================
 !
 !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
 !   -------
-!   Modif special traceur F.Forget 05/94
-!   Modif M-A Filiberti 02/02 lecture de traceur.def
+!
+!   Modifications:
+!   --------------
+!   05/94: F.Forget      Modif special traceur
+!   02/02: M-A Filiberti Lecture de traceur.def
+!   01/22: D. Cugnet     Nouveaux tracer.def et tracer_*.def + encapsulation (types tr et iso)
 !
 !   Objet:
@@ -66,695 +180,701 @@
 !   GCM LMD nouvelle grille
 !
-!=======================================================================
+!==============================================================================================================================
 !   ... modification de l'integration de q ( 26/04/94 ) ....
-!-----------------------------------------------------------------------
-! Declarations
-
-    INCLUDE "dimensions.h"
-    INCLUDE "iniprint.h"
-
+!------------------------------------------------------------------------------------------------------------------------------
+! Declarations:
+   INCLUDE "dimensions.h"
+   INCLUDE "iniprint.h"
+
+!------------------------------------------------------------------------------------------------------------------------------
 ! Local variables
-    INTEGER, ALLOCATABLE, DIMENSION(:) :: hadv  ! index of horizontal trasport schema
-    INTEGER, ALLOCATABLE, DIMENSION(:) :: vadv  ! index of vertical trasport schema
-
-    INTEGER, ALLOCATABLE, DIMENSION(:) :: hadv_inca  ! index of horizontal trasport schema
-    INTEGER, ALLOCATABLE, DIMENSION(:) :: vadv_inca  ! index of vertical trasport schema
-
-    INTEGER, ALLOCATABLE, DIMENSION(:) :: conv_flg_inca
-    INTEGER, ALLOCATABLE, DIMENSION(:) :: pbl_flg_inca
-    CHARACTER(len=8), ALLOCATABLE, DIMENSION(:) :: solsym_inca
-
-    CHARACTER(len=maxlen), ALLOCATABLE, DIMENSION(:) :: tnom_0  ! tracer short name
-    CHARACTER(len=maxlen), ALLOCATABLE, DIMENSION(:) :: tnom_transp ! transporting fluid short name: CRisi
-    CHARACTER(len=3), DIMENSION(30) :: descrq
-    CHARACTER(len=1), DIMENSION(3)  :: txts
-    CHARACTER(len=2), DIMENSION(9)  :: txtp
-    CHARACTER(len=maxlen)           :: str1,str2
-  
-    INTEGER :: nqtrue  ! number of tracers read from tracer.def, without higer order of moment
-    INTEGER :: iq, new_iq, iiq, jq, ierr,itr, iadv
-    INTEGER :: ifils,ipere ! CRisi
-    LOGICAL :: continu,nouveau_traceurdef
-    INTEGER :: IOstatus ! gestion de la retrocompatibilite de traceur.def
-    CHARACTER(len=maxlen) :: tchaine, msg1
-    INTEGER, ALLOCATABLE  :: iqfils(:,:)
-    INTEGER :: nqINCA
-
-    character(len=*),parameter :: modname="infotrac_init"
-
-!-----------------------------------------------------------------------
+   INTEGER, ALLOCATABLE :: &
+                  hadv(:), had(:), hadv_inca(:), conv_flg_inca(:), & !--- Horizontal/vertical transport scheme number
+                  vadv(:), vad(:), vadv_inca(:),  pbl_flg_inca(:)    !---   + specific variables for INCA
+   CHARACTER(LEN=8), ALLOCATABLE :: solsym_inca(:)                   !--- Tracers names for INCA
+   CHARACTER(LEN=2)      ::   suff(9)                                !--- Suffixes for schemes of order 3 or 4 (Prather)
+   CHARACTER(LEN=3)      :: descrq(30)                               !--- Advection scheme description tags
+   CHARACTER(LEN=maxlen) :: oldH2O, newH2O                           !--- Old and new water names
+   CHARACTER(LEN=maxlen) :: msg1, msg2                               !--- Strings for messages
+   CHARACTER(LEN=maxlen), ALLOCATABLE :: str(:)                      !--- Temporary storage
+   INTEGER :: fType                                                  !--- Tracers description file type ; 0: none
+                                                                     !--- 1/2/3: "traceur.def"/"tracer.def"/"tracer_*.def"
+   INTEGER :: nqtrue                                                 !--- Tracers nb from tracer.def (no higher order moments)
+   INTEGER :: iad                                                    !--- Advection scheme number
+   INTEGER :: ic, ip, np, iq, jq, it, nt, im, nm, ix, iz, nz         !--- Indexes and temporary variables
+   LOGICAL :: lerr, ll
+   CHARACTER(LEN=1) :: p
+   TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:)
+   TYPE(trac_type), POINTER             :: t1, tp, t(:)
+   TYPE(isot_type), POINTER             :: iso
+
+   CHARACTER(LEN=maxlen), ALLOCATABLE :: tnom_0(:), tnom_transp(:)        !--- Tracer short name + transporting fluid name
+   CHARACTER(LEN=maxlen)              :: tchaine
+   INTEGER :: ierr, nqINCA
+   LOGICAL :: lINCA
+
+   CHARACTER(LEN=*), PARAMETER :: modname="infotrac_init"
+!------------------------------------------------------------------------------------------------------------------------------
 ! Initialization :
+!------------------------------------------------------------------------------------------------------------------------------
+   suff          = ['x ','y ','z ','xx','xy','xz','yy','yz','zz']
+   descrq( 1: 2) = ['LMV','BAK']
+   descrq(10:20) = ['VL1','VLP','FH1','FH2','VLH','   ','PPM','PPS','PPP','   ','SLP']
+   descrq(30)    =  'PRA'
+    
+   CALL msg('type_trac='//TRIM(type_trac), modname)
+   IF(lOldCode) THEN
+      str = [type_trac]; nt = 1
+   ELSE
+      IF(strParse(type_trac, ',', str, n=nt)) CALL abort_gcm(modname,'can''t parse "type_trac = '//TRIM(type_trac)//'"',1)
+   END IF
+
+   !---------------------------------------------------------------------------------------------------------------------------
+   DO it = 1, nt                                                          !--- nt>1=> "type_trac": coma-separated keywords list
+   !---------------------------------------------------------------------------------------------------------------------------
+      !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
+      msg1 = 'For type_trac = "'//TRIM(str(it))//'":'
+      SELECT CASE(type_trac)
+         CASE('inca'); CALL msg(TRIM(msg1)//' coupling with INCA chemistry model, config_inca='//config_inca, modname)
+         CASE('inco'); CALL msg(TRIM(msg1)//' coupling jointly with INCA and CO2 cycle',  modname)
+         CASE('repr'); CALL msg(TRIM(msg1)//' coupling with REPROBUS chemistry model',    modname)
+         CASE('co2i'); CALL msg(TRIM(msg1)//' you have chosen to run with CO2 cycle',     modname)
+         CASE('coag'); CALL msg(TRIM(msg1)//' tracers are treated for COAGULATION tests', modname)
+         CASE('lmdz'); CALL msg(TRIM(msg1)//' tracers are treated in LMDZ only',          modname)
+         CASE DEFAULT; CALL abort_gcm(modname,'type_trac='//TRIM(str(it))//' not possible yet.',1)
+      END SELECT
+
+      !--- COHERENCE TEST BETWEEN "type_trac" AND "config_inca"
+      IF(ANY(['inca', 'inco'] == str(it)) .AND. ALL(['aero', 'aeNP', 'chem'] /= config_inca)) &
+         CALL abort_gcm(modname, 'Incoherence between type_trac and config_inca. Please modify "run.def"',1)
+
+      !--- COHERENCE TEST BETWEEN "type_trac" AND PREPROCESSING KEYS
+      SELECT CASE(str(it))
+         CASE('inca','inco')
+#ifndef INCA
+            CALL abort_gcm(modname, 'You must add cpp key INCA and compile with INCA code', 1)
+#endif
+         CASE('repr')
+#ifndef REPROBUS
+            CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)
+#endif
+         CASE('coag')
+#ifndef CPP_StratAer
+            CALL abort_gcm(modname, 'You must add cpp key StratAer and compile with StratAer code', 1)
+#endif
+      END SELECT
+
+      !--- DISABLE "config_inca" OPTION FOR A RUN WITHOUT "INCA" IF IT DIFFERS FROM "none"
+      IF(fmsg('Setting config_inca="none" as you do not couple with INCA model', &
+              modname, ALL(['inca', 'inco'] /= str(it)) .AND. config_inca /= 'none')) config_inca = 'none'
+
+   !---------------------------------------------------------------------------------------------------------------------------
+   END DO
+   !---------------------------------------------------------------------------------------------------------------------------
+
+   nqCO2 = 0; IF(ANY(str == 'inco')) nqCO2 = 1
+
+!==============================================================================================================================
+! 1) Get the numbers of: true (first order only) tracers "nqtrue", water tracers "nqo" (vapor/liquid/solid)
+!==============================================================================================================================
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   IF(lOldCode) THEN
+!------------------------------------------------------------------------------------------------------------------------------
+   !--- Determine nqtrue and (INCA only) nqo, nbtr
+   OPEN(90, FILE='traceur.def', FORM='formatted', STATUS='old', IOSTAT=ierr)
+   IF(ierr /= 0) CALL abort_gcm(modname, 'file "traceur.def" not found !', 1)
+   CALL msg('File "traceur.def" successfully opened.', modname)
+   lINCA = ANY(['inca','inco'] == type_trac)
+
+   IF(lINCA) THEN
+#ifdef INCA
+      READ(90,*) nqo
+      IF(nqCO2==1 .AND. nqo==4) nqo = 3
+      CALL Init_chem_inca_trac(nqINCA)
+      nbtr = nqINCA + nqCO2
+      nqtrue = nbtr + nqo
+      IF(ALL([2,3] /= nqo) CALL abort_gcm(modname, 'Only 2 or 3 water phases allowed ; found nqo='//TRIM(int2str(nqo)), 1)
+      CALL msg('nqo    = '//TRIM(int2str(nqo)),    modname)
+      CALL msg('nbtr   = '//TRIM(int2str(nbtr)),   modname)
+      CALL msg('nqtrue = '//TRIM(int2str(nqtrue)), modname)
+      CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
+      CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
+      ALLOCATE(hadv_inca(nqINCA), conv_flg_inca(nqINCA), solsym_inca(nqINCA))
+      ALLOCATE(vadv_inca(nqINCA),  pbl_flg_inca(nqINCA))
+      CALL init_transport(hadv_inca, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca)
+      ! DC passive CO2 tracer is at position 1: H2O was removed ; nqCO2/=0 in "inco" case only
+      conv_flg = [(  1,        ic=1, nqCO2),conv_flg_inca]
+       pbl_flg = [(  1,        ic=1, nqCO2), pbl_flg_inca]
+       solsym  = [('CO2     ', ic=1, nqCO2)   solsym_inca]
+      DEALLOCATE(conv_flg_inca, pbl_flg_inca, solsym_inca)
+#endif
+   ELSE
+      READ(90,*) nqtrue
+   END IF
+
+   IF (planet_type=="earth" .AND. nqtrue < 2) &
+      CALL abort_gcm('infotrac_init', 'Not enough tracers: nqtrue='//TRIM(int2str(nqtrue))//', 2 tracers is the minimum', 1)
+
+   !--- Allocate variables depending on nqtrue
+   ALLOCATE(hadv(nqtrue), vadv(nqtrue), tnom_0(nqtrue), tnom_transp(nqtrue), tracers(nqtrue))
+
+   !--- Continue to read tracer.def
+   it = 0
+   DO iq = 1, nqtrue
+#ifdef INCA
+      IF(iq > nqo+nqCO2) THEN
+         it = it+1
+         hadv  (iq) = hadv_inca  (it)
+         vadv  (iq) = vadv_inca  (it) 
+         tnom_0(iq) = solsym_inca(it)
+         tnom_transp(iq) = 'air'
+         CYCLE
+      END IF
+#endif
+      CALL msg('237: iq='//TRIM(int2str(iq)), modname)
+      READ(90,'(I2,X,I2,X,A)',IOSTAT=ierr) hadv(iq),vadv(iq),tchaine
+      WRITE(msg1,'("iq, hadv(iq), vadv(iq) = ",i0,2(", ",i0))')iq, hadv(iq), vadv(iq)
+      CALL msg(msg1, modname)
+      CALL msg('tchaine = "'//TRIM(tchaine)//'"', modname)
+      CALL msg('infotrac 238: IOstatus='//TRIM(int2str(ierr)), modname)
+      IF(ierr/=0) CALL abort_gcm('infotrac_init', 'Pb dans la lecture de traceur.def', 1)
+      jq = INDEX(tchaine(1:LEN_TRIM(tchaine)),' ')
+      CALL msg("Ancienne version de traceur.def: traceurs d'air uniquement", modname, iq==1 .AND. jq==0)
+      CALL msg("Nouvelle version de traceur.def",                            modname, iq==1 .AND. jq/=0)
+      IF(jq /= 0) THEN                                               !--- Space in the string chain => new format
+         tnom_0     (iq) = tchaine(1:jq-1)
+         tnom_transp(iq) = tchaine(jq+1:)
+      ELSE
+         tnom_0     (iq) = tchaine
+         tnom_transp(iq) = 'air'
+      END IF
+      CALL msg(     'tnom_0(iq)=<'//TRIM(tnom_0(iq))     //'>', modname)
+      CALL msg('tnom_transp(iq)=<'//TRIM(tnom_transp(iq))//'>', modname)
+   END DO
+
+   CLOSE(90)
+
+#ifndef INCA
+   conv_flg = [(1, ic=1, nbtr)]                                      !--- Convection activated for all tracers
+    pbl_flg = [(1, ic=1, nbtr)]                                      !--- Boundary layer activated for all tracers
+   ALLOCATE(solsym(nbtr))
+   CALL msg('Valeur de traceur.def :', modname)
+   CALL msg('nombre total de traceurs '//TRIM(int2str(nqtrue)), modname)
+   DO iq = 1, nqtrue
+      CALL msg(strStack([int2str(hadv(iq)), int2str(vadv(iq)), tnom_0(iq), tnom_transp(iq)]), modname)
+   END DO
+   IF(planet_type /= 'earth') nqo = 0                                !--- Same number of tracers in dynamics and physics
+   IF(planet_type == 'earth') nqo = COUNT(delPhase(tnom_0) == 'H2O') !--- for all planets except for Earth
+   nbtr = nqtrue - nqo               
+#endif
+
+   !--- SET FIELDS %name, %parent, %phase, %component
+   tracers(:)%name      = tnom_0
+   tracers(:)%parent    = tnom_transp
+   tracers(:)%phase     = 'g'
+   tracers(:)%component = type_trac
+   DO ip = 1, nphases
+      p = old_phases(ip:ip)
+      iq = strIdx(tracers(:)%name, 'H2O'//p)
+      IF(iq /= 0) CYCLE
+      tracers(iq)%phase = p
+      IF(lINCA) tracers(iq)%component = 'lmdz'
+   END DO
+   IF(lINCA) tracers(1+nqo:nqCO2+nqo)%component = 'co2i'
+   CALL setGeneration(tracers)                                       !--- SET FIELDS %iGeneration, %gen0Name
+
+! manque "type"
+
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ELSE
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   IF(readTracersFiles(type_trac, fType, tracers)) CALL abort_gcm(modname, 'problem with tracers file(s)',1)
+   IF(fType == 0) CALL abort_gcm(modname, 'Missing tracers file: "traceur.def", "tracer.def" or "tracer_<keyword>.def file.',1)
+   !---------------------------------------------------------------------------------------------------------------------------
+   IF(fType == 1) THEN                                               !=== FOUND AN OLD STYLE "traceur.def"
+   !---------------------------------------------------------------------------------------------------------------------------
+#ifdef INCA
+      nqo = SIZE(tracers)
+      IF(nqCO2==1 .AND. nqo==4) nqo = 3                              !--- Force nqo to 3 (ThL)
+      CALL Init_chem_inca_trac(nqINCA)                               !--- Get nqINCA from INCA
+      nbtr = nqINCA + nqCO2                                          !--- Number of tracers passed to phytrac
+      nqtrue = nbtr + nqo                                            !--- Total number of "true" tracers
+      IF(ALL([2,3] /= nqo) CALL abort_gcm(modname, 'Only 2 or 3 water phases allowed ; found nqo='//TRIM(int2str(nqo)), 1)
+      CALL msg('nqo    = '//TRIM(int2str(nqo)),    modname)
+      CALL msg('nbtr   = '//TRIM(int2str(nbtr)),   modname)
+      CALL msg('nqtrue = '//TRIM(int2str(nqtrue)), modname)
+      CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
+      CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
+      ALLOCATE(hadv(nqtrue), hadv_inca(nqINCA), conv_flg_inca(nqINCA), solsym_inca(nqINCA))
+      ALLOCATE(vadv(nqtrue), vadv_inca(nqINCA),  pbl_flg_inca(nqINCA))
+      CALL init_transport(hadv_inca, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca)
+      ! DC passive CO2 tracer is at position 1: H2O was removed ; nqCO2/=0 in "inco" case only
+      conv_flg = [(  1,        k=1, nqCO2), conv_flg_inca]
+       pbl_flg = [(  1,        k=1, nqCO2),  pbl_flg_inca]
+       solsym  = [('CO2     ', k=1, nqCO2)    solsym_inca]
+      DEALLOCATE(conv_flg_inca, pbl_flg_inca, solsym_inca)
+      ALLOCATE(ttr(nqtrue))
+      ttr(1:nqo+nqCO2)                    = tracers
+      ttr(1    :      nqo   )%component   = 'lmdz'
+      ttr(1+nqo:nqCO2+nqo   )%component   = 'co2i'
+      ttr(1+nqo+nqCO2:nqtrue)%component   = 'inca'
+      ttr(1+nqo      :nqtrue)%name        = solsym
+      ttr(1+nqo+nqCO2:nqtrue)%parent      = tran0
+      ttr(1+nqo+nqCO2:nqtrue)%phase       = 'g'
+      lerr = getKey('hadv', had, ky=ttr(:)%keys); hadv(:) = [had, hadv_inca]
+      lerr = getKey('vadv', vad, ky=ttr(:)%keys); vadv(:) = [vad, vadv_inca]
+      DEALLOCATE(had, hadv_inca, vad, vadv_inca)
+      CALL MOVE_ALLOC(FROM=ttr, TO=tracers)
+      CALL setGeneration(tracers)                                    !--- SET FIELDS %iGeneration, %gen0Name
+#else
+      nqo    = COUNT(delPhase(tracers(:)%name) == 'H2O')             !--- Number of water phases
+      nqtrue = SIZE(tracers)                                         !--- Total number of "true" tracers
+      nbtr   = nqtrue - nqo                                          !--- Number of tracers passed to phytrac
+      lerr = getKey('hadv', hadv, ky=tracers(:)%keys)
+      lerr = getKey('vadv', vadv, ky=tracers(:)%keys)
+#endif
+   !---------------------------------------------------------------------------------------------------------------------------
+   ELSE                                                              !=== FOUND NEW STYLE TRACERS CONFIGURATION FILE(S)
+   !---------------------------------------------------------------------------------------------------------------------------
+      nqo    = COUNT(delPhase(tracers(:)%name) == 'H2O')             !--- Number of water phases
+      nqtrue = SIZE(tracers)                                         !--- Total number of "true" tracers
+      nbtr   = nqtrue - nqo                                          !--- Number of tracers passed to phytrac
+      lerr = getKey('hadv', hadv, ky=tracers(:)%keys)
+      lerr = getKey('vadv', vadv, ky=tracers(:)%keys)
+      ALLOCATE(solsym(nbtr))
+      conv_flg = [(1, it=1, nbtr)]
+       pbl_flg = [(1, it=1, nbtr)]
+   !---------------------------------------------------------------------------------------------------------------------------
+   END IF
+   !---------------------------------------------------------------------------------------------------------------------------
+END IF
+!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+   CALL getKey_init(tracers)
+
+   !--- Transfert the number of tracers to Reprobus
+#ifdef REPROBUS
+   CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name)
+#endif
+
+!==============================================================================================================================
+! 2) Calculate nqtot, number of tracers needed (greater if advection schemes 20 or 30 have been chosen).
+!==============================================================================================================================
+   DO iq = 1, nqtrue
+      IF( hadv(iq)<20 .OR. (ANY(hadv(iq)==[20,30]) .AND. hadv(iq)==vadv(iq)) ) CYCLE
+      WRITE(msg1,'("The choice hadv=",i0,", vadv=",i0,a)')hadv(iq),vadv(iq),' for "'//TRIM(tracers(iq)%name)//'" is not available'
+      CALL abort_gcm(modname, TRIM(msg1), 1)
+   END DO
+   nqtot =    COUNT( hadv< 20 .AND. vadv< 20 ) &                     !--- No additional tracer
+         +  4*COUNT( hadv==20 .AND. vadv==20 ) &                     !--- 3  additional tracers
+         + 10*COUNT( hadv==30 .AND. vadv==30 )                       !--- 9  additional tracers
+
+   !--- More tracers due to the choice of advection scheme => assign total number of tracers
+   IF( nqtot /= nqtrue ) THEN
+      CALL msg('The choice of advection scheme for one or more tracers makes it necessary to add tracers')
+      CALL msg('The number of true tracers is '//TRIM(int2str(nqtrue)))
+      CALL msg('The total number of tracers needed is '//TRIM(int2str(nqtot)))
+   END IF
+   CALL msg('nqo    = '//TRIM(int2str(nqo)),    modname)
+   CALL msg('nbtr   = '//TRIM(int2str(nbtr)),   modname)
+   CALL msg('nqtrue = '//TRIM(int2str(nqtrue)), modname)
+   CALL msg('nqtot  = '//TRIM(int2str(nqtot)),  modname)
+
+!==============================================================================================================================
+! 3) Determine the advection scheme choice for water and tracers "iadv" and the fields long name, isAdvected.
+!     iadv = 1    "LMDZ-specific humidity transport" (for H2O vapour)          LMV
+!     iadv = 2    backward                           (for H2O liquid)          BAK
+!     iadv = 14   Van-Leer + specific humidity, modified by Francis Codron     VLH
+!     iadv = 10   Van-Leer (chosen for vapour and liquid water)                VL1
+!     iadv = 11   Van-Leer for hadv and PPM version (Monotonic) for vadv       VLP
+!     iadv = 12   Frederic Hourdin I                                           FH1
+!     iadv = 13   Frederic Hourdin II                                          FH2
+!     iadv = 16   Monotonic         PPM (Collela & Woodward 1984)              PPM
+!     iadv = 17   Semi-monotonic    PPM (overshoots allowed)                   PPS
+!     iadv = 18   Definite positive PPM (overshoots and undershoots allowed)   PPP
+!     iadv = 20   Slopes                                                       SLP
+!     iadv = 30   Prather                                                      PRA
 !
-    txts=(/'x','y','z'/)
-    txtp=(/'x ','y ','z ','xx','xy','xz','yy','yz','zz'/)
-
-    descrq(14)='VLH'
-    descrq(10)='VL1'
-    descrq(11)='VLP'
-    descrq(12)='FH1'
-    descrq(13)='FH2'
-    descrq(16)='PPM'
-    descrq(17)='PPS'
-    descrq(18)='PPP'
-    descrq(20)='SLP'
-    descrq(30)='PRA'
-    
-    !--- MESSAGE ABOUT THE CHOSEN CONFIGURATION
-    WRITE(lunout,*)'type_trac='//TRIM(type_trac)
-    msg1 = 'For type_trac = "'//TRIM(type_trac)//'":'
-    SELECT CASE(type_trac)
-      CASE('inca'); WRITE(lunout,*)TRIM(msg1)//' coupling with INCA chemistry model, config_inca='//config_inca
-      CASE('inco'); WRITE(lunout,*)TRIM(msg1)//' coupling jointly with INCA and CO2 cycle'
-      CASE('repr'); WRITE(lunout,*)TRIM(msg1)//' coupling with REPROBUS chemistry model'
-      CASE('co2i'); WRITE(lunout,*)TRIM(msg1)//' you have chosen to run with CO2 cycle'
-      CASE('coag'); WRITE(lunout,*)TRIM(msg1)//' tracers are treated for COAGULATION tests'
-      CASE('lmdz'); WRITE(lunout,*)TRIM(msg1)//' tracers are treated in LMDZ only'
-      CASE DEFAULT
-        CALL abort_gcm(modname,'type_trac='//TRIM(type_trac)//' not possible yet.',1)
-    END SELECT
-
-    !--- COHERENCE TEST BETWEEN "type_trac", "config_inca" AND PREPROCESSING KEYS
-    SELECT CASE(type_trac)
-      CASE('inca','inco'); IF(ALL(['aero', 'aeNP', 'chem']/=config_inca)) &
-        CALL abort_gcm(modname, 'Incoherence between type_trac and config_inca. Please modify "run.def"',1)
-#ifndef INCA
-        CALL abort_gcm(modname, 'You must add cpp key INCA and compile with INCA code',1)
-#endif
-      CASE('repr')
-#ifndef REPROBUS
-        CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code',1)
-#endif
-      CASE('coag')
-#ifndef CPP_StratAer
-        CALL abort_gcm(modname, 'You must add cpp key StratAer and compile with StratAer code',1)
-#endif
-    END SELECT
-
-    !--- Disable "config_inca" option for a run without INCA if it differs from "none"
-    IF (ALL(['inca', 'inco', 'none'] /= config_inca)) THEN
-      WRITE(lunout,*)'setting config_inca="none" as you do not couple with INCA model'
-      config_inca = 'none'
-    END IF
-
-!-----------------------------------------------------------------------
-!
-! 1) Get the true number of tracers + water vapor/liquid
-!    Here true tracers (nqtrue) means declared tracers (only first order)
-!
-!-----------------------------------------------------------------------
-    OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr)
-    IF(ierr.EQ.0) THEN
-       WRITE(lunout,*) trim(modname),': Open traceur.def : ok'
-    ELSE 
-       WRITE(lunout,*) trim(modname),': Failed opening traceur.def'
-       CALL abort_gcm(modname,"file traceur.def not found!",1)
-    ENDIF
-    nqCO2 = 0; IF(type_trac == 'inco') nqCO2 = 1
-    SELECT CASE(type_trac)
-       CASE('lmdz','repr','coag','co2i'); READ(90,*) nqtrue
-       CASE('inca','inco');               READ(90,*) nqo
-          ! The traceur.def file is used to define the number "nqo" of water phases 
-          ! present in the simulation. Default : nqo = 2.
-          IF (nqo == 4 .AND. type_trac=='inco') nqo = 3
-          IF(ALL([2,3] /= nqo)) THEN
-             WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowed. Only 2 or 3 water phases allowed'
-             CALL abort_gcm('infotrac_init','Bad number of water phases',1)
-          END IF
-          ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 
-#ifdef INCA
-          CALL Init_chem_inca_trac(nqINCA)
+!        In array q(ij,l,iq) : iq = 1/2[/3]    for vapour/liquid[/ice] water
+!        And optionaly:        iq = 3[4],nqtot for other tracers
+!==============================================================================================================================
+   ALLOCATE(ttr(nqtot))
+   jq = nqtrue+1; tracers(:)%iadv = -1
+   DO iq = 1, nqtrue
+      t1 => tracers(iq)
+
+      !--- VERIFY THE CHOICE OF ADVECTION SCHEME
+      iad = -1
+      IF(hadv(iq)     ==    vadv(iq)    ) iad = hadv(iq)
+      IF(hadv(iq)==10 .AND. vadv(iq)==16) iad = 11
+      WRITE(msg1,'("Bad choice of advection scheme for ",a,": hadv = ",i0,", vadv = ",i0)')TRIM(t1%name), hadv(iq), vadv(iq)
+      IF(iad == -1) CALL abort_gcm(modname, msg1, 1)
+
+      !--- SET FIELDS %longName, %iadv, %isAdvected, %isH2Ofamily
+      t1%longName   = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad)
+      t1%iadv       = iad
+      t1%isAdvected = iad > 0
+      t1%isH2Ofamily= delPhase(t1%gen0Name) == 'H2O'
+      ttr(iq)       = t1
+
+      !--- DEFINE THE HIGHER ORDER TRACERS, IF ANY
+      nm = 0
+      IF(iad == 20) nm = 3                                             !--- 2nd order scheme
+      IF(iad == 30) nm = 9                                             !--- 3rd order scheme
+      ttr(jq+1:jq+nm)             = t1
+      ttr(jq+1:jq+nm)%name        = [(TRIM(t1%name)    //'-'//TRIM(suff(im)), im=1, nm) ]
+      ttr(jq+1:jq+nm)%parent      = [(TRIM(t1%parent)  //'-'//TRIM(suff(im)), im=1, nm) ]
+      ttr(jq+1:jq+nm)%longName    = [(TRIM(t1%longName)//'-'//TRIM(suff(im)), im=1, nm) ]
+      ttr(jq+1:jq+nm)%iadv        = [(-iad,    im=1, nm) ]
+      ttr(jq+1:jq+nm)%isAdvected  = [(.FALSE., im=1, nm) ]
+      jq = jq + nm
+   END DO
+   DEALLOCATE(hadv, vadv)
+   CALL MOVE_ALLOC(FROM=ttr, TO=tracers)
+
+   !--- SET FIELDS %iqParent, %nqChilds, %iGeneration, %iqDescen, %nqDescen
+   CALL indexUpdate(tracers)
+
+   CALL msg('Information stored in infotrac :', modname)
+   CALL msg('iadv  name  long_name :', modname)
+
+   !=== TEST ADVECTION SCHEME
+   DO iq=1,nqtot ; t1 => tracers(iq); iad = t1%iadv
+
+      !--- ONLY TESTED VALUES FOR TRACERS FOR NOW:               iadv = 14, 10 (and 0 for non-transported tracers)
+      IF(ALL([10,14,0] /= iad)) &
+         CALL abort_gcm(modname, 'Not tested for iadv='//TRIM(int2str(iad))//' ; 10 or 14 only are allowed !', 1)
+
+      !--- ONLY TESTED VALUES FOR PARENTS HAVING CHILDS FOR NOW: iadv = 14, 10 (PARENTS: TRACERS OF GENERATION 1)
+      IF(ALL([10,14] /= iad) .AND. t1%iGeneration == 1 .AND. ANY(tracers(:)%iGeneration > 1)) &
+         CALL abort_gcm(modname, 'iadv='//TRIM(int2str(iad))//' not implemented for parents ; 10 or 14 only are allowed !', 1)
+
+      !--- ONLY TESTED VALUES FOR CHILDS FOR NOW:                iadv = 10     (CHILDS:  TRACERS OF GENERATION GREATER THAN 1)
+      IF(fmsg('WARNING ! iadv='//TRIM(int2str(iad))//' not implemented for childs. Setting iadv=10 for "'//TRIM(t1%name)//'"',&
+         modname, iad /= 10 .AND. t1%iGeneration > 1)) t1%iadv = 10
+
+      !--- ONLY VALID SCHEME NUMBER FOR WATER VAPOUR:            iadv = 14
+      ll = t1%name /= addPhase('H2O','g'); IF(lOldCode) ll = t1%name /= 'H2Ov'
+      IF(fmsg('WARNING ! iadv=14 is valid for water vapour only. Setting iadv=10 for "'//TRIM(t1%name)//'".', &
+         modname, iad == 14 .AND. ll))                 t1%iadv = 10
+   END DO
+
+IF(lOldCode) THEN
+
+   CALL infotrac_setHeredity                !--- SET FIELDS %iqParent, %nqChilds, %iGeneration, %gen0Name, %iqDescen, %nqDescen
+   CALL infotrac_isoinit(tnom_0, nqtrue)    !--- SET FIELDS %type, %iso_iName, %iso_iZone, %iso_iPhase
+   CALL getKey_init(tracers, isotopes)
+   IF(isoSelect('H2O')) RETURN                                    !--- Select water isotopes ; finished if no water isotopes
+   iH2O = ixIso                                                   !--- Keep track of water family index
+
+   !--- Remove the isotopic tracers from the tracers list passed to phytrac
+   nbtr    = nbtr -nqo*   ntiso             !--- ISOTOPIC TAGGING TRACERS ARE NOT PASSED TO THE PHYSICS
+   nqtottr = nqtot-nqo*(1+ntiso)            !--- NO H2O-FAMILY    TRACER  IS      PASSED TO THE PHYSICS
+   CALL msg('702: nbtr, ntiso='//strStack(int2str([nbtr, ntiso])), modname)
+   CALL msg('704: nqtottr, nqtot, nqo = '//strStack(int2str([nqtottr, nqtot, nqo])), modname)
+   ! Rq: nqtottr n'est pas forcement egal a nbtr dans le cas ou nmom/=0
+   IF(COUNT(tracers%iso_iName == 0 .AND. delPhase(tracers(:)%name)/='H2O') /= nqtottr) &
+      CALL abort_gcm('infotrac_init', 'pb dans le calcul de nqtottr', 1)
+
+   !--- Finalize :
+   DEALLOCATE(tnom_0, hadv, vadv, tnom_transp)
+
+ELSE
+
+   CALL initIsotopes(tracers, isotopes)
+   nbIso = SIZE(isotopes); IF(nbIso==0) RETURN                    !--- No isotopes: finished.
+
+   !=== READ PHYSICAL PARAMETERS FROM "isotopes_params.def" FILE SPECIFIC TO WATER ISOTOPES
+   !    DONE HERE, AND NOT ONLY IN "infotrac_phy", BECAUSE SOME PHYSICAL PARAMS ARE NEEDED FOR RESTARTS (tnat, alpha_ideal)
+   CALL getKey_init(tracers, isotopes)
+   IF(isoSelect('H2O')) RETURN                                    !--- Select water isotopes ; finished if no water isotopes
+   iH2O = ixIso                                                   !--- Keep track of water family index
+   IF(getKey('tnat' , tnat,        isoName(1:niso))) CALL abort_gcm(modname, 'can''t read "tnat"', 1)
+   IF(getKey('alpha', alpha_ideal, isoName(1:niso))) CALL abort_gcm(modname, 'can''t read "alpha_ideal"', 1)
+
+   !=== ENSURE THE MEMBERS OF AN ISOTOPES FAMILY ARE PRESENT IN THE SAME PHASES
+   DO ix = 1, nbIso
+      iso => isotopes(ix)
+      !--- Check whether each isotope and tagging isotopic tracer is present in the same number of phases
+      DO it = 1, iso%ntiso
+         np = SUM([(COUNT(tracers(:)%name == addPhase(iso%trac(it), iso%phase(ip:ip))), ip=1, iso%nphas)])
+         IF(np == iso%nphas) CYCLE
+         WRITE(msg1,'("Found ",i0," phases for ",s," instead of ",i0)')np, iso%trac(it), iso%nphas
+         CALL abort_gcm(modname, msg1, 1)
+      END DO
+      DO it = 1, iso%niso
+         nz = SUM([(COUNT(iso%trac == iso%trac(it)//'_'//iso%zone(iz)), iz=1, iso%nzone)])
+         IF(nz == iso%nzone) CYCLE
+         WRITE(msg1,'("Found ",i0," tagging zones for ",s," instead of ",i0)')nz, iso%trac(it), iso%nzone
+         CALL abort_gcm(modname, msg1, 1)
+      END DO
+   END DO
+   nqtottr = COUNT(tracers%iso_iName == 0)
+
+END IF
+
+   !=== DISPLAY THE RESULTING LIST
+   t => tracers
+   CALL msg('Information stored in infotrac :')
+   IF(dispTable('issssiii', ['iq      ', 'name    ', 'longName', 'gen0Name', 'parent  ', 'iadv    ', 'iqParent', 'iGenerat'], &
+                cat(t%name, t%longName, t%gen0Name, t%parent), cat([(iq, iq=1, nqtot)], t%iadv, t%iqParent, t%iGeneration)))  &
+      CALL abort_gcm(modname, "problem with the tracers table content", 1)
+
+   !--- Some aliases to be removed later
+   ntraciso       => iso%ntiso
+   ntraceurs_zone => iso%nzone
+   qperemin       =  min_qParent
+   masseqmin      =  min_qMass
+   ratiomin       =  min_ratio
+   CALL msg('end', modname)
+
+END SUBROUTINE infotrac_init
+
+
+
+SUBROUTINE infotrac_setHeredity
+   !--- Purpose: Set fields %iqParent, %nqChilds, %iGeneration, %iqDescen, %nqDescen (old method)
+   USE strings_mod, ONLY: strIdx
+   INTEGER               :: iq, ipere, ifils
+   INTEGER, ALLOCATABLE  :: iqfils(:,:)
+   CHARACTER(LEN=maxlen) :: msg1, modname='infotrac_init'
+   INCLUDE "iniprint.h"
+
+   !=== SET FIELDS %iqParent, %nqChilds
+   ALLOCATE(iqfils(nqtot,nqtot)); iqfils(:,:) = 0
+
+   DO iq = 1, nqtot
+      msg1 = 'Tracer nr. '//TRIM(int2str(iq))//', called "'//TRIM(tracers(iq)%name)//'" is '
+
+      !--- IS IT A GENERATION 0 TRACER ? IF SO, tracers(iq)%iqParent KEEPS ITS DEFAULT VALUE (0)
+      IF(fmsg(TRIM(msg1)//' a parent', modname, tracers(iq)%parent == tran0)) CYCLE
+
+      !--- TRACERS OF GENERATION > 0 ; FIND ITS PARENT INDEX
+      ipere = strIdx(tracers(:)%name, tracers(iq)%parent)
+      IF(ipere == 0)  CALL abort_gcm('infotrac_init', TRIM(msg1)//' an orphan', 1)
+      IF(iq == ipere) CALL abort_gcm('infotrac_init', TRIM(msg1)//' its own parent',1)
+
+      CALL msg(TRIM(msg1)//' the child of '//TRIM(tracers(ipere)%name), modname)
+      tracers(iq)%iqParent    = ipere
+      tracers(ipere)%nqChilds = tracers(ipere)%nqChilds+1
+      iqfils(tracers(ipere)%nqChilds,ipere) = iq
+   END DO
+   CALL msg('nqGen0   = '//int2str(COUNT(tracers(:)%parent == 'air')), modname)
+   CALL msg('nqChilds = '//strStack(int2str(tracers(:)%nqChilds)),     modname)
+   CALL msg('iqParent = '//strStack(int2str(tracers(:)%iqParent)),     modname)
+   WRITE(lunout,*)TRIM(modname)//': iqfils = ',iqfils
+
+   !=== SET FIELDS %iGeneration, %iqDescen, %nqDescen
+   tracers(:)%iGeneration = 0
+   DO iq = 1, nqtot
+      ifils = iq
+      DO WHILE(tracers(ifils)%iqParent > 0)
+         ipere = tracers(ifils)%iqParent
+         tracers(ipere)%nqDescen = tracers(ipere)%nqDescen+1   
+         tracers(iq)%iGeneration = tracers(iq)%iGeneration+1
+         iqfils(tracers(ipere)%nqDescen,ipere) = iq
+         ifils = ipere
+      END DO
+      msg1 = 'Tracer nr. '//TRIM(int2str(iq))//', called "'//TRIM(tracers(iq)%name)//'" is '
+      CALL msg(TRIM(msg1)//' of generation '//TRIM(int2str(tracers(iq)%iGeneration)), modname)
+   END DO
+   DO iq=1,nqtot
+      tracers(iq)%iqDescen = iqfils(1:tracers(iq)%nqDescen,iq)
+   END DO
+
+   CALL msg('nqDescen = '//TRIM(strStack(int2str(tracers(:)%nqDescen))), modname)
+   CALL msg('nqDescen_tot = ' //TRIM(int2str(SUM(tracers(:)%nqDescen))), modname)
+   WRITE(lunout,*)TRIM(modname)//': iqfils = ',iqfils
+
+END SUBROUTINE infotrac_setHeredity
+
+
+
+SUBROUTINE infotrac_isoinit(tnom_0, nqtrue)
+
+#ifdef CPP_IOIPSL
+   USE IOIPSL
 #else
-          nqINCA=0
-#endif
-          nbtr=nqINCA+nqCO2
-          nqtrue=nbtr+nqo
-          WRITE(lunout,*) trim(modname),': nqo    = ',nqo
-          WRITE(lunout,*) trim(modname),': nbtr   = ',nbtr
-          WRITE(lunout,*) trim(modname),': nqtrue = ',nqtrue
-          WRITE(lunout,*) trim(modname),': nqCO2 = ',nqCO2
-          WRITE(lunout,*) trim(modname),': nqINCA = ',nqINCA
-          ALLOCATE(hadv_inca(nqINCA), vadv_inca(nqINCA), conv_flg_inca(nqINCA), pbl_flg_inca(nqINCA), solsym_inca(nqINCA))
-    END SELECT
-!>jyg
-
-    IF ((planet_type=="earth").and.(nqtrue < 2)) THEN
-       WRITE(lunout,*) trim(modname),': nqtrue=',nqtrue, ' is not allowed. 2 tracers is the minimum'
-       CALL abort_gcm('infotrac_init','Not enough tracers',1)
-    ENDIF
-    
-!jyg<
-       
-!
-! Allocate variables depending on nqtrue
-!
-    ALLOCATE(tnom_0(nqtrue), hadv(nqtrue), vadv(nqtrue),tnom_transp(nqtrue))
-
-
-!-----------------------------------------------------------------------
-! 2)     Choix  des schemas d'advection pour l'eau et les traceurs
-!
-!     iadv = 1    schema  transport type "humidite specifique LMD"
-!     iadv = 2    schema   amont
-!     iadv = 14   schema  Van-leer + humidite specifique 
-!                            Modif F.Codron
-!     iadv = 10   schema  Van-leer (retenu pour l'eau vapeur et liquide)
-!     iadv = 11   schema  Van-Leer pour hadv et version PPM (Monotone) pour vadv
-!     iadv = 12   schema  Frederic Hourdin I
-!     iadv = 13   schema  Frederic Hourdin II
-!     iadv = 16   schema  PPM Monotone(Collela & Woodward 1984)
-!     iadv = 17   schema  PPM Semi Monotone (overshoots autorises)
-!     iadv = 18   schema  PPM Positif Defini (overshoots undershoots autorises)
-!     iadv = 20   schema  Slopes
-!     iadv = 30   schema  Prather
-!
-!        Dans le tableau q(ij,l,iq) : iq = 1  pour l'eau vapeur
-!                                     iq = 2  pour l'eau liquide
-!       Et eventuellement             iq = 3,nqtot pour les autres traceurs
-!
-!        iadv(1): choix pour l'eau vap. et  iadv(2) : choix pour l'eau liq.
-!------------------------------------------------------------------------
-!
-!    Get choice of advection schema from file tracer.def or from INCA
-!---------------------------------------------------------------------
-    IF (ANY(['lmdz', 'repr', 'coag', 'co2i'] == type_trac)) THEN
-
-       ! Continue to read tracer.def
-       DO iq=1,nqtrue
-
-          write(*,*) 'infotrac 237: iq=',iq
-          ! CRisi: ajout du nom du fluide transporteur
-          ! mais rester retro compatible
-          READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine
-          write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq)
-          write(lunout,*) 'tchaine=',trim(tchaine)
-          write(*,*) 'infotrac 238: IOstatus=',IOstatus
-          if (IOstatus.ne.0) CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1)
-          ! Y-a-t-il 1 ou 2 noms de traceurs separes par un espace ?
-          iiq = INDEX(tchaine(1:LEN_TRIM(tchaine)),' ')
-          nouveau_traceurdef=iiq/=0
-          write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef
-          if (nouveau_traceurdef) then
-             IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def"
-             tnom_0     (iq) = tchaine(1:iiq-1)
-             tnom_transp(iq) = tchaine(iiq+1:)
-          else
-             IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def: traceurs d'air uniquement"
-             tnom_0     (iq) = tchaine
-             tnom_transp(iq) = 'air'
-          endif
-          write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>'
-          write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>'
-       ENDDO!DO iq=1,nqtrue
-
-       CLOSE(90)  
-
-       WRITE(lunout,*) trim(modname),': Valeur de traceur.def :'
-       WRITE(lunout,*) trim(modname),': nombre total de traceurs ',nqtrue
-       DO iq=1,nqtrue
-          WRITE(lunout,*) hadv(iq),vadv(iq),' ',trim(tnom_0(iq)),' ',trim(tnom_transp(iq))
-       END DO
-
-       IF ( planet_type=='earth') THEN
-         !CR: nombre de traceurs de l eau
-         nqo=2; IF (tnom_0(3) == 'H2Oi') nqo=3
-         ! For Earth, water vapour & liquid tracers are not in the physics
-         nbtr=nqtrue-nqo
-       ELSE
-         ! Other planets (for now); we have the same number of tracers
-         ! in the dynamics than in the physics
-         nbtr=nqtrue
-       ENDIF
-
-    ENDIF
-!jyg<
-!
-
-! Transfert number of tracers to Reprobus
-#ifdef REPROBUS
-    IF (type_trac == 'repr') CALL Init_chem_rep_trac(nbtr,nqo,tnom_0)
-#endif
-!
-! Allocate variables depending on nbtr
-!
-    ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), solsym(nbtr))
-    conv_flg(:) = 1 ! convection activated for all tracers
-    pbl_flg(:)  = 1 ! boundary layer activated for all tracers
-
-    IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN   ! config_inca='aero' ou 'chem'
-!>jyg
-! le module de chimie fournit les noms des traceurs et les schemas d'advection associes.
-! excepte pour ceux lus dans traceur.def 
-
-#ifdef INCA
-       CALL init_transport(hadv_inca, vadv_inca, conv_flg_inca, pbl_flg_inca, solsym_inca)
-       ! DC passive CO2 tracer is at index 1: H2O was removed ; nqCO2/=0 in "inco" case only
-       conv_flg(1:nqCO2) = 1;   conv_flg(1+nqCO2:nbtr) = conv_flg_inca
-        pbl_flg(1:nqCO2) = 1;    pbl_flg(1+nqCO2:nbtr) =  pbl_flg_inca
-         solsym(1:nqCO2) = 'CO2'; solsym(1+nqCO2:nbtr) =   solsym_inca
-#endif
-
-       itr = 0
-       DO iq = 1, nqtot
-          IF(iq > nqo+nqCO2) THEN
-             itr = itr+1
-             hadv  (iq) = hadv_inca  (itr)
-             vadv  (iq) = vadv_inca  (itr) 
-             tnom_0(iq) = solsym_inca(itr)
-             tnom_transp(iq) = 'air'
-             CYCLE
-          END IF
-          write(*,*) 'infotrac 237: iq=',iq
-          ! CRisi: ajout du nom du fluide transporteur en restant retro-compatible
-          READ(90,'(I2,X,I2,X,A)',IOSTAT=IOstatus) hadv(iq),vadv(iq),tchaine
-          write(lunout,*) 'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq)
-          write(lunout,*) 'tchaine=',trim(tchaine)
-          write(*,*) 'infotrac 238: IOstatus=',IOstatus
-          if (IOstatus.ne.0) CALL abort_gcm('infotrac_init','Pb dans la lecture de traceur.def',1)
-          ! Y-a-t-il 1 ou 2 noms de traceurs separes par un espace ?
-          iiq = INDEX(tchaine(1:LEN_TRIM(tchaine)),' ')
-          nouveau_traceurdef=iiq/=0
-          write(*,*) 'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef
-          if (nouveau_traceurdef) then
-             IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def"
-             tnom_0     (iq) = tchaine(1:iiq-1)
-             tnom_transp(iq) = tchaine(iiq+1:)
-          else
-             IF(iq==1) write(lunout,*) "Nouvelle version de traceur.def: traceurs d'air uniquement"
-             tnom_0     (iq) = tchaine
-             tnom_transp(iq) = 'air'
-          endif
-          write(lunout,*) 'tnom_0(iq)=<',trim(tnom_0(iq)),'>'
-          write(lunout,*) 'tnom_transp(iq)=<',trim(tnom_transp(iq)),'>'
-       END DO
-       CLOSE(90)  
-    ENDIF ! (type_trac == 'inca' or 'inco')
-
-!-----------------------------------------------------------------------
-!
-! 3) Verify if advection schema 20 or 30 choosen
-!    Calculate total number of tracers needed: nqtot
-!    Allocate variables depending on total number of tracers
-!-----------------------------------------------------------------------
-    new_iq=0
-    DO iq=1,nqtrue
-       ! Add tracers for certain advection schema
-       IF (hadv(iq)<20 .AND. vadv(iq)<20 ) THEN
-          new_iq=new_iq+1  ! no tracers added
-       ELSE IF (hadv(iq)==20 .AND. vadv(iq)==20 ) THEN
-          new_iq=new_iq+4  ! 3 tracers added
-       ELSE IF (hadv(iq)==30 .AND. vadv(iq)==30 ) THEN
-          new_iq=new_iq+10 ! 9 tracers added
-       ELSE
-          WRITE(lunout,*) trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
-          CALL abort_gcm('infotrac_init','Bad choice of advection schema - 1',1)
-       ENDIF
-    END DO
-    
-    IF (new_iq /= nqtrue) THEN
-       ! The choice of advection schema imposes more tracers
-       ! Assigne total number of tracers
-       nqtot = new_iq
-
-       WRITE(lunout,*) trim(modname),': The choice of advection schema for one or more tracers'
-       WRITE(lunout,*) 'makes it necessary to add tracers'
-       WRITE(lunout,*) trim(modname)//': ',nqtrue,' is the number of true tracers'
-       WRITE(lunout,*) trim(modname)//': ',nqtot, ' is the total number of tracers needed'
-
-    ELSE
-       ! The true number of tracers is also the total number
-       nqtot = nqtrue
-    ENDIF
-
-!
-! Allocate variables with total number of tracers, nqtot
-!
-    ALLOCATE(tracers(nqtot))
-
-!-----------------------------------------------------------------------
-!
-! 4) Determine iadv, long and short name
-!
-!-----------------------------------------------------------------------
-    new_iq=0
-    DO iq=1,nqtrue
-       new_iq=new_iq+1
-
-       ! Verify choice of advection schema
-       IF (hadv(iq)==vadv(iq)) THEN
-          tracers(new_iq)%iadv=hadv(iq)
-       ELSE IF (hadv(iq)==10 .AND. vadv(iq)==16) THEN
-          tracers(new_iq)%iadv=11
-       ELSE
-          WRITE(lunout,*)trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
-
-          CALL abort_gcm('infotrac_init','Bad choice of advection schema - 2',1)
-       ENDIF
-      
-       str1=tnom_0(iq)
-       tracers(new_iq)%name = TRIM(tnom_0(iq))
-       tracers(new_iq)%parent = TRIM(tnom_transp(iq))
-       IF (tracers(new_iq)%iadv==0) THEN
-          tracers(new_iq)%longName=trim(str1)
-       ELSE
-          tracers(new_iq)%longName=trim(tnom_0(iq))//descrq(tracers(new_iq)%iadv)
-       ENDIF
-
-       ! schemas tenant compte des moments d'ordre superieur
-       str2=TRIM(tracers(new_iq)%longName)
-       IF (tracers(new_iq)%iadv==20) THEN
-          DO jq=1,3
-             new_iq=new_iq+1
-             tracers(new_iq)%iadv=-20
-             tracers(new_iq)%longName=trim(str2)//txts(jq)
-             tracers(new_iq)%name=trim(str1)//txts(jq)
-          END DO
-       ELSE IF (tracers(new_iq)%iadv==30) THEN
-          DO jq=1,9
-             new_iq=new_iq+1
-             tracers(new_iq)%iadv=-30
-             tracers(new_iq)%longName=trim(str2)//txtp(jq)
-             tracers(new_iq)%name=trim(str1)//txtp(jq)
-          END DO
-       ENDIF
-    END DO
-
-    WRITE(lunout,*) trim(modname),': Information stored in infotrac :'
-    WRITE(lunout,*) trim(modname),': iadv  name  long_name :'
-
-    DO iq=1,nqtot
-       WRITE(lunout,*) tracers(iq)%iadv,' ',trim(tracers(iq)%name),' ',trim(tracers(iq)%longName)
-    END DO
-
-!
-! Test for advection schema. 
-! This version of LMDZ only garantees iadv=10 and iadv=14 (14 only for water vapour) .
-!
-    DO iq=1,nqtot
-       iadv=tracers(iq)%iadv
-       IF (ALL([10, 14, 0]/=iadv)) THEN
-          WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv,' is not tested in this version of LMDZ'
-          CALL abort_gcm('infotrac_init','In this version only iadv=10 and iadv=14 is tested!',1)
-       ELSE IF (iadv==14 .AND. iq/=1) THEN
-          WRITE(lunout,*)trim(modname),'STOP : The option iadv=',iadv,' is not tested in this version of LMDZ'
-          CALL abort_gcm('infotrac_init','In this version iadv=14 is only permitted for water vapour!',1)
-       ENDIF
-    END DO
-
-
-! CRisi: quels sont les traceurs fils et les traceurs peres.
-! initialiser tous les tableaux d'indices lies aux traceurs familiaux
-! + verifier que tous les peres sont ecrits en premieres positions
-    ALLOCATE(iqfils(nqtot,nqtot))   
-    iqfils(:,:)=0
-    tracers(:)%iqParent=0
-    DO iq=1,nqtot
-      if (tnom_transp(iq) == 'air') then
-        ! ceci est un traceur pere
-        WRITE(lunout,*) 'Le traceur',iq,', appele ',trim(tnom_0(iq)),', est un pere'
-        tracers(iq)%iqParent=0
-      else !if (tnom_transp(iq) == 'air') then
-        ! ceci est un fils. Qui est son pere?
-        WRITE(lunout,*) 'Le traceur',iq,', appele ',trim(tnom_0(iq)),', est un fils'
-        continu=.true.
-        ipere=1
-        do while (continu)           
-          if (tnom_transp(iq) == tnom_0(ipere)) then
-            ! Son pere est ipere
-            WRITE(lunout,*) 'Le traceur',iq,'appele ', &
-      &          trim(tnom_0(iq)),' est le fils de ',ipere,'appele ',trim(tnom_0(ipere))
-            if (iq.eq.ipere) then
-                CALL abort_gcm('infotrac_init','Un fils est son propre pere',1)
-            endif
-            tracers(ipere)%nqChilds = tracers(ipere)%nqChilds+1  
-            iqfils(tracers(ipere)%nqChilds,ipere)=iq
-            tracers(iq)%iqParent=ipere         
-            continu=.false.
-          else !if (tnom_transp(iq) == tnom_0(ipere)) then
-            ipere=ipere+1 
-            if (ipere.gt.nqtot) then
-                WRITE(lunout,*) 'Le traceur',iq,'appele ', &
-      &          trim(tnom_0(iq)),', est orphelin.'
-                CALL abort_gcm('infotrac_init','Un traceur est orphelin',1)
-            endif !if (ipere.gt.nqtot) then
-          endif !if (tnom_transp(iq) == tnom_0(ipere)) then
-        enddo !do while (continu)
-      endif !if (tnom_transp(iq) == 'air') then
-    enddo !DO iq=1,nqtot
-    WRITE(lunout,*) 'infotrac: nqGen0=',COUNT(tracers(:)%parent == 'air')
-    WRITE(lunout,*) 'nqChilds=',tracers(:)%nqChilds
-    WRITE(lunout,*) 'iqParent=',tracers(:)%iqParent
-    WRITE(lunout,*) 'iqfils=',iqfils
-
-! Calculer le nombre de descendants a partir de iqfils et de nbfils
-    DO iq=1,nqtot    
-      tracers(iq)%iGeneration=0
-      continu=.true.
-      ifils=iq
-      do while (continu)
-        ipere=tracers(ifils)%iqParent
-        if (ipere.gt.0) then
-         tracers(ipere)%nqDescen = tracers(ipere)%nqDescen+1   
-         iqfils(tracers(ipere)%nqDescen,ipere)=iq
-         ifils=ipere
-         tracers(iq)%iGeneration=tracers(iq)%iGeneration+1
-        else !if (ipere.gt.0) then
-         continu=.false.
-        endif !if (ipere.gt.0) then
-      enddo !do while (continu)    
-      WRITE(lunout,*) 'Le traceur ',iq,', appele ',trim(tnom_0(iq)), &
-        ' est un traceur de generation: ',tracers(iq)%iGeneration
-    enddo !DO iq=1,nqtot
-    DO iq=1,nqtot
-      ALLOCATE(tracers(iq)%iqDescen(tracers(iq)%nqDescen))
-      tracers(iq)%iqDescen(:) = iqfils(1:tracers(iq)%nqDescen,iq)
-    END DO
-
-    WRITE(lunout,*) 'infotrac: nqDescen=',tracers(:)%nqDescen
-    WRITE(lunout,*) 'iqfils=',iqfils
-    WRITE(lunout,*) 'nqDescen_tot=',SUM(tracers(:)%nqDescen)
-
-! Interdire autres schemas que 10 pour les traceurs fils, et autres schemas
-! que 10 et 14 si des peres ont des fils
-    do iq=1,nqtot
-      if (tracers(iq)%iqParent > 0) then
-        ! ce traceur a un pere qui n'est pas l'air
-        ! Seul le schema 10 est autorise
-        iadv=tracers(iq)%iadv
-        if (iadv/=10) then
-           WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv,' is not implemented for sons'
-          CALL abort_gcm('infotrac_init','Sons should be advected by scheme 10',1)
-        endif
-        ! Le traceur pere ne peut etre advecte que par schema 10 ou 14:
-        IF (ALL([10,14]/=tracers(tracers(iq)%iqParent)%iadv)) THEN
-          WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv,' is not implemented for fathers'
-          CALL abort_gcm('infotrac_init','Fathers should be advected by scheme 10 ou 14',1)
-        endif
-     endif
-    enddo !do iq=1,nqtot
-    tracers(:)%gen0Name = ancestor(tracers)      !--- Name of the first generation ancestor
-    tracers(:)%isAdvected = tracers(:)%iadv  >   0
-!    tracers(:)%isH2Ofamily = delPhase(tracers(:)%gen0Name) == 'H2O'
-    tracers(:)%isH2Ofamily = [(tracers(iq)%gen0Name(1:3) == 'H2O', iq=1, nqtot)]
-
-! detecter quels sont les traceurs isotopiques parmi des traceurs
-    call infotrac_isoinit(tnom_0,nqtrue)
-
-!    if (ntraciso.gt.0) then
-! le 18 sep 2020: on enleve la condition ntraciso.gt.0 car nqtottr doit etre
-! connu meme si il n'y a pas d'isotopes!
-        write(lunout,*) 'infotrac 702: nbtr,ntraciso=',nbtr,ntraciso
-! retrancher les traceurs isotopiques de la liste des traceurs qui passent dans
-! phytrac
-        nbtr=nbtr-nqo*ntraciso
-
-! faire un tableau d'indice des traceurs qui passeront dans phytrac
-        nqtottr=nqtot-nqo*(1+ntraciso)
-        write(lunout,*) 'infotrac 704: nqtottr,nqtot,nqo=',nqtottr,nqtot,nqo
-        ! Rq: nqtottr n'est pas forcement egal a nbtr dans le cas ou new_iq /= nqtrue
-!        if (COUNT(tracers(:)%iso_iName == 0) /= nqtottr) &
-!            CALL abort_gcm('infotrac_init','pb dans le calcul de nqtottr',1)
-!    endif !if (ntraciso.gt.0) then
-
-!-----------------------------------------------------------------------
-! Finalize :
-!
-    DEALLOCATE(tnom_0, hadv, vadv,tnom_transp)
-
-    WRITE(lunout,*) 'infotrac init fin'
-
-  END SUBROUTINE infotrac_init
-
-  SUBROUTINE infotrac_isoinit(tnom_0,nqtrue)
-
-#ifdef CPP_IOIPSL
-  use IOIPSL
-#else
-  ! if not using IOIPSL, we still need to use (a local version of) getin
-  use ioipsl_getincom
-#endif
-  implicit none
+   USE ioipsl_getincom
+#endif
+   IMPLICIT NONE
+   INTEGER,          INTENT(IN) :: nqtrue
+   CHARACTER(LEN=*), INTENT(IN) :: tnom_0(nqtrue)
+   CHARACTER(LEN=3)      :: tnom_iso(niso_possibles)
+   INTEGER, ALLOCATABLE  :: nb_iso(:,:), nb_traciso(:,:)
+   INTEGER               :: ii, ip, iq, it, iz, ixt, n, nb_isoind, nzone_prec
+   TYPE(isot_type), POINTER :: i
+   TYPE(trac_type), POINTER :: t(:)
+   CHARACTER(LEN=1)         :: p
+   CHARACTER(LEN=maxlen)    :: tnom_trac
+   CHARACTER(LEN=maxlen), ALLOCATABLE :: str(:)
+   INCLUDE "iniprint.h"
+
+   tnom_iso = ['eau', 'HDO', 'O18', 'O17', 'HTO']
+   ALLOCATE(nb_iso       (niso_possibles,nqo))
+   ALLOCATE(nb_traciso   (niso_possibles,nqo))
+   ALLOCATE(use_iso      (niso_possibles))
+   ALLOCATE(indnum_fn_num(niso_possibles))
+   ALLOCATE(iso_indnum(nqtot))
+     
+   iso_indnum   (:) = 0
+   use_iso      (:) = .FALSE.
+   indnum_fn_num(:) = 0
+   nb_iso     (:,:) = 0  
+   nb_traciso (:,:) = 0
+
+   DO iq=1, nqtot
+      IF(delPhase(tracers(iq)%name) == 'H2O' .OR. .NOT.tracers(iq)%isAdvected) CYCLE
+outer:DO ip = 1, nqo
+         nb_isoind = 0
+         DO ixt= 1,niso_possibles
+            tnom_trac = 'H2O'//old_phases(ip:ip)//'_'//TRIM(tnom_iso(ixt))
+            IF (tracers(iq)%name == tnom_trac) THEN
+               nb_iso(ixt,ip)         = nb_iso(ixt,ip)+1
+               nb_isoind              = nb_isoind+1
+               tracers(iq)%type       = 'tracer'
+               tracers(iq)%iso_iGroup = 1
+               tracers(iq)%iso_iName  = ixt
+               iso_indnum(iq)         = nb_isoind
+               indnum_fn_num(ixt)     = iso_indnum(iq)
+               tracers(iq)%iso_iPhase = ip
+               EXIT outer
+            ELSE IF(tracers(iq)%iqParent> 0) THEN
+               IF(tracers(tracers(iq)%iqParent)%name == tnom_trac) THEN
+                  nb_traciso(ixt,ip)  = nb_traciso(ixt,ip)+1
+                  iso_indnum(iq)         = indnum_fn_num(ixt)
+                  tracers(iq)%type    = 'tag'
+                  tracers(iq)%iso_iGroup = 1
+                  tracers(iq)%iso_iName  = ixt
+                  tracers(iq)%iso_iZone  = nb_traciso(ixt,ip)
+                  tracers(iq)%iso_iPhase = ip
+                  EXIT outer
+               END IF
+            END IF
+         END DO
+      END DO outer
+   END DO
+
+   niso = 0; nzone_prec = nb_traciso(1,1)
+   DO ixt = 1, niso_possibles
+      IF(nb_iso(ixt,1) == 0) CYCLE
+      IF(nb_iso(ixt,1) /= 1) CALL abort_gcm('infotrac_init', 'Isotopes are not well defined in traceur.def', 1)
+
+      ! on verifie que toutes les phases ont le meme nombre d'isotopes
+      IF(ANY(nb_iso(ixt,:) /= 1)) CALL abort_gcm('infotrac_init', 'Phases must have same number of isotopes', 1)
+
+      niso = niso+1
+      use_iso(ixt) = .TRUE.
+      nzone = nb_traciso(ixt,1)
+
+      ! on verifie que toutes les phases ont le meme nombre de traceurs d'isotopes
+      IF(ANY(nb_traciso(ixt,2:nqo) /= nzone)) CALL abort_gcm('infotrac_init','Phases must have same number of tracers',1)
+
+      ! on verifie que tous les isotopes ont le meme nombre de traceurs d'isotopes
+      IF(nzone /= nzone_prec) CALL abort_gcm('infotrac_init','Isotope tracers are not well defined in traceur.def',1)
+      nzone_prec = nzone
+   END DO
+
+   ! dimensions et flags isotopiques:
+   ntiso = niso*(nzone+1)
+   ok_isotopes = niso  > 0
+   ok_isotrac  = nzone > 0
  
-    ! inputs
-    INTEGER,INTENT(IN) :: nqtrue
-    CHARACTER(len=*),INTENT(IN) :: tnom_0(nqtrue)
-    
-    ! locals    
-    CHARACTER(len=3), DIMENSION(niso_possibles) :: tnom_iso
-    INTEGER, ALLOCATABLE,DIMENSION(:,:) :: nb_iso,nb_traciso
-    INTEGER, ALLOCATABLE,DIMENSION(:) :: nb_isoind
-    INTEGER :: ntraceurs_zone_prec,iq,phase,ixt,iiso,izone
-    CHARACTER(len=maxlen) :: tnom_trac
-    INCLUDE "iniprint.h"
-
-    tnom_iso=(/'eau','HDO','O18','O17','HTO'/)
-
-    ALLOCATE(nb_iso(niso_possibles,nqo))
-    ALLOCATE(nb_isoind(nqo))
-    ALLOCATE(nb_traciso(niso_possibles,nqo))
-    ALLOCATE(iso_indnum(nqtot))
-     
-    iso_indnum(:)=0
-    indnum_fn_num(:)=0
-    use_iso(:)=.false.  
-    nb_iso(:,:)=0  
-    nb_isoind(:)=0     
-    nb_traciso(:,:)=0
-    niso=0
-    ntraceurs_zone=0  
-    ntraceurs_zone_prec=0
-    ntraciso=0
-
-    do iq=nqo+1,nqtot
-!       write(lunout,*) 'infotrac 569: iq,tnom_0(iq)=',iq,tnom_0(iq)
-       do phase=1,nqo    
-        do ixt= 1,niso_possibles   
-         tnom_trac=trim(tnom_0(phase))//'_'
-         tnom_trac=trim(tnom_trac)//trim(tnom_iso(ixt))
-!         write(*,*) 'phase,ixt,tnom_trac=',phase,ixt,tnom_trac      
-         IF (tnom_0(iq) == tnom_trac) then
-!          write(lunout,*) 'Ce traceur est un isotope'
-          nb_iso(ixt,phase)=nb_iso(ixt,phase)+1   
-          nb_isoind(phase)=nb_isoind(phase)+1   
-          tracers(iq)%iso_iName=ixt
-          iso_indnum(iq)=nb_isoind(phase)
-          indnum_fn_num(ixt)=iso_indnum(iq)
-          tracers(iq)%iso_iPhase=phase
-          goto 20
-         else if ( tracers(iq)%iqParent> 0) then          
-          if (tnom_0(tracers(iq)%iqParent) == tnom_trac) then
-!           write(lunout,*) 'Ce traceur est le fils d''un isotope'
-           ! c'est un traceur d'isotope
-           nb_traciso(ixt,phase)=nb_traciso(ixt,phase)+1
-           tracers(iq)%iso_iName=ixt
-           iso_indnum(iq)=indnum_fn_num(ixt)
-           tracers(iq)%iso_iZone=nb_traciso(ixt,phase)
-           tracers(iq)%iso_iPhase=phase
-           goto 20
-          endif !if (tnom_0(tracers(iq)%iqParent) == trim(tnom_0(phase))//trim(tnom_iso(ixt))) then
-         endif !IF (tnom_0(iq) == trim(tnom_0(phase))//trim(tnom_iso(ixt))) then
-        enddo !do ixt= niso_possibles
-       enddo !do phase=1,nqo
-  20   continue
-      enddo !do iq=1,nqtot
-
-      do ixt= 1,niso_possibles  
-
-        if (nb_iso(ixt,1).eq.1) then
-          ! on verifie que toutes les phases ont le meme nombre de
-          ! traceurs
-          do phase=2,nqo
-            if (nb_iso(ixt,phase).ne.nb_iso(ixt,1)) then
-!              write(lunout,*) 'ixt,phase,nb_iso=',ixt,phase,nb_iso(ixt,phase)
-              CALL abort_gcm('infotrac_init','Phases must have same number of isotopes',1)
-            endif
-          enddo !do phase=2,nqo
-
-          niso=niso+1
-          use_iso(ixt)=.true.
-          ntraceurs_zone=nb_traciso(ixt,1)
-
-          ! on verifie que toutes les phases ont le meme nombre de
-          ! traceurs
-          do phase=2,nqo
-            if (nb_traciso(ixt,phase).ne.ntraceurs_zone) then
-              write(lunout,*) 'ixt,phase,nb_traciso=',ixt,phase,nb_traciso(ixt,phase)
-              write(lunout,*) 'ntraceurs_zone=',ntraceurs_zone
-              CALL abort_gcm('infotrac_init','Phases must have same number of tracers',1)
-            endif  
-          enddo  !do phase=2,nqo
-          ! on verifie que tous les isotopes ont le meme nombre de
-          ! traceurs
-          if (ntraceurs_zone_prec.gt.0) then               
-            if (ntraceurs_zone.eq.ntraceurs_zone_prec) then
-              ntraceurs_zone_prec=ntraceurs_zone
-            else !if (ntraceurs_zone.eq.ntraceurs_zone_prec) then
-              write(*,*) 'ntraceurs_zone_prec,ntraceurs_zone=',ntraceurs_zone_prec,ntraceurs_zone   
-              CALL abort_gcm('infotrac_init', &
-               &'Isotope tracers are not well defined in traceur.def',1)           
-            endif !if (ntraceurs_zone.eq.ntraceurs_zone_prec) then
-           endif !if (ntraceurs_zone_prec.gt.0) then
-
-        else if (nb_iso(ixt,1).ne.0) then
-           WRITE(lunout,*) 'nqo,ixt=',nqo,ixt
-           WRITE(lunout,*) 'nb_iso(ixt,1)=',nb_iso(ixt,1)    
-           CALL abort_gcm('infotrac_init','Isotopes are not well defined in traceur.def',1)     
-        endif   !if (nb_iso(ixt,1).eq.1) then       
-    enddo ! do ixt= niso_possibles
-
-    ! dimensions isotopique:
-    ntraciso=niso*(ntraceurs_zone+1)
-!    WRITE(lunout,*) 'niso=',niso
-!    WRITE(lunout,*) 'ntraceurs_zone,ntraciso=',ntraceurs_zone,ntraciso    
- 
-    ! flags isotopiques:
-    ok_isotopes = niso > 0
-!    WRITE(lunout,*) 'ok_isotopes=',ok_isotopes
- 
-    if (ok_isotopes) then
-        ok_iso_verif=.false.
-        call getin('ok_iso_verif',ok_iso_verif)
-        ok_init_iso=.false.
-        call getin('ok_init_iso',ok_init_iso)
-        tnat=(/1.0,155.76e-6,2005.2e-6,0.004/100.,0.0/)
-        alpha_ideal=(/1.0,1.01,1.006,1.003,1.0/)
-    endif !if (ok_isotopes) then  
-!    WRITE(lunout,*) 'ok_iso_verif=',ok_iso_verif
-!    WRITE(lunout,*) 'ok_init_iso=',ok_init_iso
-
-    if (ntraceurs_zone.gt.0) then
-        ok_isotrac=.true.
-    else
-        ok_isotrac=.false.
-    endif   
-!    WRITE(lunout,*) 'ok_isotrac=',ok_isotrac
-
-    ! remplissage du tableau iqiso(ntraciso,phase)
-    ALLOCATE(iqiso(ntraciso,nqo))   
-    iqiso(:,:)=0     
-    do iq=1,nqtot
-        if (tracers(iq)%iso_iName > 0) then
-          ixt=iso_indnum(iq)+tracers(iq)%iso_iZone*niso
-          iqiso(ixt,tracers(iq)%iso_iPhase)=iq
-        endif
-    enddo
-!    WRITE(lunout,*) 'iqiso=',iqiso
-
-    ! replissage du tableau index_trac(ntraceurs_zone,niso)
-    ALLOCATE(index_trac(ntraceurs_zone,niso))  
-    if (ok_isotrac) then
-        do iiso=1,niso
-          do izone=1,ntraceurs_zone 
-             index_trac(izone,iiso)=iiso+izone*niso
-          enddo
-        enddo
-    else !if (ok_isotrac) then      
-        index_trac(:,:)=0.0
-    endif !if (ok_isotrac) then
-!    write(lunout,*) 'index_trac=',index_trac    
-
-! Finalize :
-    DEALLOCATE(nb_iso)
-
-  END SUBROUTINE infotrac_isoinit
+   IF(ok_isotopes) THEN
+      ok_iso_verif = .FALSE.; CALL getin('ok_iso_verif', ok_iso_verif)
+      ok_init_iso  = .FALSE.; CALL getin('ok_init_iso',  ok_init_iso)
+   END IF
+      tnat        = [1.0, 155.76e-6, 2005.2e-6, 0.004/100., 0.0]
+      alpha_ideal = [1.0, 1.01,      1.006,     1.003,      1.0]
+!   END IF
+
+   ! remplissage du tableau iqiso(ntiso,phase)
+   ALLOCATE(iqiso(ntiso,nqo))   
+   iqiso(:,:)=0     
+   DO iq = 1, nqtot
+      IF(tracers(iq)%iso_iName <= 0) CYCLE
+      ixt = iso_indnum(iq) + tracers(iq)%iso_iZone*niso
+      iqiso(ixt, tracers(iq)%iso_iPhase) = iq
+   END DO
+
+   ! remplissage du tableau index_trac(nzone,niso)
+   ALLOCATE(index_trac(nzone, niso))  
+   IF(ok_isotrac) then
+      DO ii = 1, niso; index_trac(:, ii) = ii + niso*[(iz, iz=1, nzone)]; END DO
+   ELSE
+      index_trac(:,:)=0.0
+   END IF
+
+   ALLOCATE(isotopes(1))                                             !--- Only water
+   nbIso = 1
+   i => isotopes(1)
+   t => tracers
+   str = PACK(delPhase(t%name), MASK = t%type=='tracer' .AND. delPhase(t%parent) == 'H2O' .AND. t%phase == 'g')
+   i%parent = 'H2O'
+   i%niso  = SIZE(str)
+   i%nzone = nzone
+   i%nphas = nqo
+   FORALL(it = 1:i%niso) i%keys(it)%name = str(it)
+   i%zone = PACK(strTail(t%name,'_',.TRUE.), MASK = t%type=='tag' .AND. delPhase(t%gen0Name)=='H2O' .AND. t%iGeneration==3)
+   CALL strReduce(i%zone)
+   i%phase = strStack([(known_phases(ip:ip), ip=1, nphases)], MASK=[(strIdx(t%name,addPhase('H2O',known_phases(ip:ip)))/=0)])
+   i%iTraPha = RESHAPE([((strIdx(t(:)%name,addPhase(i%trac(it),i%phase(ip:ip))) ,it=1,i%ntiso),ip=1,i%nphas)],[i%ntiso,i%nphas])
+   i%iZonIso = RESHAPE([((strIdx(i%trac,TRIM(i%trac(it))//'_'//TRIM(i%zone(iz))),iz=1,i%nzone),it=1,i%niso )],[i%nzone,i%niso ])
+   DO it=1,ntiso
+      WRITE(lunout,'(a,i0,a)')TRIM('infotrac_init')//': iqiso  (',it,',:) = '//strStack(int2str(iqiso(it,:)))
+      WRITE(lunout,'(a,i0,a)')TRIM('infotrac_init')//': iTraPha(',it,',:) = '//strStack(int2str(i%iTraPha(it,:)))
+   END DO
+   DO iz=1,nzone
+      WRITE(lunout,'(a,i0,a)')TRIM('infotrac_init')//': index_trac(',iz,',:) = '//strStack(int2str(index_trac(iz,:)))
+      WRITE(lunout,'(a,i0,a)')TRIM('infotrac_init')//': iZonIso   (',iz,',:) = '//strStack(int2str(i%iZonIso(iz,:)))
+   END DO
+
+   ! Finalize :
+   DEALLOCATE(nb_iso)
+
+END SUBROUTINE infotrac_isoinit
+
+
+!==============================================================================================================================
+!=== THE ROUTINE isoSelect IS USED TO SWITCH FROM AN ISOTOPE FAMILY TO ANOTHER: ISOTOPES DEPENDENT PARAMETERS ARE UPDATED
+!     Single generic "isoSelect" routine, using the predefined index of the parent (fast version) or its name (first call).
+!==============================================================================================================================
+LOGICAL FUNCTION isoSelectByName(iName, lVerbose) RESULT(lerr)
+   IMPLICIT NONE
+   CHARACTER(LEN=*),  INTENT(IN)  :: iName
+   LOGICAL, OPTIONAL, INTENT(IN) :: lVerbose
+   INTEGER :: iIso
+   LOGICAL :: lV
+   lV = .FALSE.; IF(PRESENT(lVerbose)) lV = lVerbose
+   iIso = strIdx(isotopes(:)%parent, iName)
+   lerr = iIso == 0
+   CALL msg('no isotope family named "'//TRIM(iName)//'"', ll=lerr .AND. lV)
+   IF(lerr) RETURN
+   lerr = isoSelectByIndex(iIso, lV)
+END FUNCTION isoSelectByName
+!==============================================================================================================================
+LOGICAL FUNCTION isoSelectByIndex(iIso, lVerbose) RESULT(lerr)
+   IMPLICIT NONE
+   INTEGER,           INTENT(IN) :: iIso
+   LOGICAL, OPTIONAL, INTENT(IN) :: lVerbose
+   LOGICAL :: lv
+   lv = .FALSE.; IF(PRESENT(lVerbose)) lv = lVerbose
+   lerr = .FALSE.
+   IF(iIso == ixIso) RETURN                                      !--- Nothing to do if the index is already OK
+   lerr = iIso<=0 .OR. iIso>nbIso
+   CALL msg('Inconsistent isotopes family index '//TRIM(int2str(iIso))//': should be > 0 and <= '//TRIM(int2str(nbIso))//'"',&
+            ll=lerr .AND. lV)
+   IF(lerr) RETURN
+   ixIso = iIso                                                  !--- Update currently selected family index
+   isotope => isotopes(ixIso)                                    !--- Select corresponding component
+   isoKeys => isotope%keys;    niso     = isotope%niso
+   isoName => isotope%trac;    ntiso    = isotope%ntiso
+   isoZone => isotope%zone;    nzone    = isotope%nzone
+   isoPhas => isotope%phase;   nphas    = isotope%nphas
+   iZonIso => isotope%iZonIso; isoCheck = isotope%check
+   iTraPha => isotope%iTraPha
+END FUNCTION isoSelectByIndex
+!==============================================================================================================================
 
 END MODULE infotrac
Index: LMDZ6/trunk/libf/dyn3dmem/dynetat0_loc.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/dynetat0_loc.F90	(revision 4062)
+++ LMDZ6/trunk/libf/dyn3dmem/dynetat0_loc.F90	(revision 4063)
@@ -7,5 +7,6 @@
 !-------------------------------------------------------------------------------
   USE parallel_lmdz
-  USE infotrac,    ONLY: nqtot, tracers, iqiso, iso_indnum, tnat, alpha_ideal, ok_isotopes, maxlen
+  USE strings_mod, ONLY: maxlen
+  USE infotrac,    ONLY: nqtot, tracers, iqiso, iso_indnum, tnat, alpha_ideal, ok_isotopes
   USE netcdf, ONLY: NF90_OPEN,  NF90_INQUIRE_DIMENSION, NF90_INQ_VARID,        &
       NF90_NOWRITE, NF90_CLOSE, NF90_INQUIRE_VARIABLE,  NF90_GET_VAR, NF90_NoErr
Index: LMDZ6/trunk/libf/dyn3dmem/dynredem_loc.F90
===================================================================
--- LMDZ6/trunk/libf/dyn3dmem/dynredem_loc.F90	(revision 4062)
+++ LMDZ6/trunk/libf/dyn3dmem/dynredem_loc.F90	(revision 4063)
@@ -9,5 +9,6 @@
   USE parallel_lmdz
   USE mod_hallo
-  USE infotrac, ONLY: nqtot, tracers, maxlen
+  USE strings_mod, ONLY: maxlen
+  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,   &
@@ -174,5 +175,6 @@
   USE parallel_lmdz
   USE mod_hallo
-  USE infotrac, ONLY: nqtot, tracers, type_trac, maxlen
+  USE strings_mod, ONLY: maxlen
+  USE infotrac, ONLY: nqtot, tracers, type_trac
   USE control_mod
   USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_GET_VAR, NF90_INQ_VARID,  &
Index: LMDZ6/trunk/libf/misc/readTracFiles_mod.f90
===================================================================
--- LMDZ6/trunk/libf/misc/readTracFiles_mod.f90	(revision 4062)
+++ LMDZ6/trunk/libf/misc/readTracFiles_mod.f90	(revision 4063)
@@ -1,7 +1,7 @@
 MODULE readTracFiles_mod
 
-  USE strings_mod, ONLY:   msg, testFile,  strFind, strStack, strReduce,  strHead, strCount,   find, maxlen, fmsg, &
-            removeComment, cat, checkList, strIdx,  strParse, strReplace, strTail, reduceExpr, test, get_in, dispTable
-  USE trac_types_mod, ONLY : trac_type, isot_type, keys_type
+  USE strings_mod,    ONLY: msg, testFile,  strFind, strStack, strReduce,  strHead, strCount,   find, maxlen, fmsg, &
+             removeComment, cat, checkList, strIdx,  strParse, strReplace, strTail, reduceExpr, test, get_in, dispTable
+  USE trac_types_mod, ONLY: trac_type, isot_type, keys_type
 
   IMPLICIT NONE
@@ -9,6 +9,6 @@
   PRIVATE
 
-  PUBLIC :: initIsotopes, maxlen, trac_type, isot_type
-  PUBLIC :: readTracersFiles, aliasTracer, tracersSubset, indexUpdate!--- TOOLS ASSOCIATED TO TRACERS  DESCRIPTORS
+  PUBLIC :: initIsotopes, maxlen, trac_type, isot_type, keys_type
+  PUBLIC :: readTracersFiles, indexUpdate, setGeneration             !--- TOOLS ASSOCIATED TO TRACERS  DESCRIPTORS
   PUBLIC :: readIsotopesFile                                         !--- TOOLS ASSOCIATED TO ISOTOPES DESCRIPTORS
   PUBLIC :: getKey_init, getKey, setDirectKeys                       !--- GET/SET KEYS FROM/TO tracers & isotopes
@@ -45,7 +45,7 @@
   CHARACTER(LEN=maxlen), SAVE      :: phases_names(nphases) &        !--- Known phases names
                                 = ['gaseous', 'liquid ', 'solid  ']
-  CHARACTER(LEN=1),   SAVE      :: phases_sep  =  '_'                !--- Phase separator
-  LOGICAL,            SAVE      :: tracs_merge = .TRUE.              !--- Merge/stack tracers lists
-  LOGICAL,            SAVE      :: lSortByGen  = .TRUE.              !--- Sort by growing generation
+  CHARACTER(LEN=1), SAVE :: phases_sep  =  '_'                       !--- Phase separator
+  LOGICAL,          SAVE :: tracs_merge = .TRUE.                     !--- Merge/stack tracers lists
+  LOGICAL,          SAVE :: lSortByGen  = .TRUE.                     !--- Sort by growing generation
 
   !=== LOCAL COPIES OF THE TRACERS AND ISOTOPES DESCRIPTORS, USED BY getKey (INITIALIZED IN getKey_init)
@@ -76,7 +76,7 @@
 !     * The "keys" component (of type keys_type) is in principle enough to store everything we could need.
 !     But some variables are stored as direct-access keys to make the code more readable and because they are used often.
-!     * Most of the direct-access keys are set in this module, but some are not (lnam, iadv and itr for example).
+!     * Most of the direct-access keys are set in this module, but some are not (longName, iadv, isAdvected for now).
 !     * Some of the direct-access keys must be updated (using the routine "setDirectKeys") is a subset of "tracers(:)"
-!     is extracted: the indexes are no longer valid for a subset (examples: tracers(:)%iqParent or tracers(:)%ichld).
+!     is extracted: the indexes are no longer valid for a subset (examples: iqParent, iqDescen).
 !     * If you need to convert a %key/%val pair into a direct-access key, add the corresponding line in "setDirectKeys".
 !==============================================================================================================================
@@ -87,6 +87,6 @@
   TYPE(trac_type), ALLOCATABLE, INTENT(OUT) :: tracs(:)
   CHARACTER(LEN=maxlen),  ALLOCATABLE ::  s(:), sections(:), trac_files(:)
-  CHARACTER(LEN=maxlen) :: str, fname, mesg
-  INTEGER               :: is, nsec, ierr, it, ntrac, ns, ip
+  CHARACTER(LEN=maxlen) :: str, fname, mesg, oldH2O, newH2O
+  INTEGER               :: is, nsec, ierr, it, ntrac, ns, ip, ix
   LOGICAL, ALLOCATABLE  :: ll(:), lGen3(:)
 !------------------------------------------------------------------------------------------------------------------------------
@@ -111,4 +111,7 @@
   END IF
 
+  !--- CHECK WHETHER type_trac AND FILE TYPE ARE COMPATIBLE
+  IF(test(fmsg('No multiple sections for the old format "traceur.def"', ll = SIZE(sections)>1 .AND. fType==1), lerr)) RETURN
+
   !--- TELLS WHAT WAS IS ABOUT TO BE USED
   IF (fmsg('No adequate tracers description file(s) found ; default values will be used',          modname, fType==0)) RETURN
@@ -118,61 +121,67 @@
 
   !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-  IF(fType==1) THEN                                                  !=== OLD FORMAT "traceur.def"
-  !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-    !--- OPEN THE "traceur.def" FILE
-    OPEN(90, FILE="traceur.def", FORM='formatted', STATUS='old', IOSTAT=ierr)
-
-    !--- GET THE TRACERS NUMBER
-    READ(90,'(i3)',IOSTAT=ierr)ntrac                                 !--- Number of lines/tracers
-    IF(test(fmsg('Invalid format for "'//TRIM(fname)//'"', modname, ierr /= 0), lerr)) RETURN
-
-    !--- READ THE REMAINING LINES: <hadv> <vadv> <tracer> [<transporting fluid>]
-    ALLOCATE(tracs(ntrac))
-    DO it=1,ntrac                                                    !=== READ RAW DATA: loop on the line/tracer number
-      READ(90,'(a)',IOSTAT=ierr) str
-      IF(test(fmsg('Invalid format for "' //TRIM(fname)//'"', modname, ierr>0), lerr)) RETURN
-      IF(test(fmsg('Not enough lines in "'//TRIM(fname)//'"', modname, ierr<0), lerr)) RETURN
-      ll = strParse(str, ' ', s, n=ns)
-      tracs(it)%keys%key = ['hadv', 'vadv']
-      tracs(it)%keys%val = s(1:2)
-      CALL msg('This file is for air tracers only',           modname, ns == 3 .AND. it == 1)
-      CALL msg('This files specifies the transporting fluid', modname, ns == 4 .AND. it == 1)
-      tracs(it)%name = TRIM(s(3))                                    !--- Name of the tracer
-      tracs(it)%phase = known_phases(1:1)                            !--- Phase (default: "g" for gazeous)
+  SELECT CASE(fType)                         !--- Set %name, %genOName, %parent, %type, %phase, %component, %iGeneration, %keys
+  !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+    CASE(1)                                                               !=== OLD FORMAT "traceur.def"
+    !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+      !--- OPEN THE "traceur.def" FILE
+      OPEN(90, FILE="traceur.def", FORM='formatted', STATUS='old', IOSTAT=ierr)
+
+      !--- GET THE TRACERS NUMBER
+      READ(90,'(i3)',IOSTAT=ierr)ntrac                               !--- Number of lines/tracers
+      IF(test(fmsg('Invalid format for "'//TRIM(fname)//'"', modname, ierr /= 0), lerr)) RETURN
+
+      !--- READ THE REMAINING LINES: <hadv> <vadv> <tracer> [<transporting fluid>]
+      ALLOCATE(tracs(ntrac))
+      DO it=1,ntrac                                                  !=== READ RAW DATA: loop on the line/tracer number
+        READ(90,'(a)',IOSTAT=ierr) str
+        IF(test(fmsg('Invalid format for "' //TRIM(fname)//'"', modname, ierr>0), lerr)) RETURN
+        IF(test(fmsg('Not enough lines in "'//TRIM(fname)//'"', modname, ierr<0), lerr)) RETURN
+        ll = strParse(str, ' ', s, n=ns)
+        CALL msg('This file is for air tracers only',           modname, ns == 3 .AND. it == 1)
+        CALL msg('This files specifies the transporting fluid', modname, ns == 4 .AND. it == 1)
+        tracs(it)%name = TRIM(s(3))                                  !--- Set %name:   name of the tracer
+        tracs(it)%parent = tran0                                     !--- Set %parent: transporting fluid
+        IF(ns == 4) tracs(it)%parent = s(4)                          !---     default: 'air' or defined in the file
+        tracs(it)%phase = known_phases(1:1)                          !--- Set %phase:  tracer phase (default: "g"azeous)
+        tracs(it)%component = TRIM(type_trac)                        !--- Set %component: model component name
+        tracs(it)%keys%key = ['hadv', 'vadv']                        !--- Set %keys%key
+        tracs(it)%keys%val = s(1:2)                                  !--- Set %keys%val
+      END DO
+      CLOSE(90)
       DO ip = 1, nphases                                             !--- Deal with old water names
-        IF(s(3) /= 'H2O'//old_phases(ip:ip)) CYCLE
-        tracs(it)%phase = known_phases(ip:ip); tracs(it)%name = 'H2O'//phases_sep//TRIM(tracs(it)%phase)
+        oldH2O = 'H2O'//old_phases(ip:ip)
+        newH2O = 'H2O'//phases_sep//known_phases(ip:ip)
+        ix = strIdx(tracs(:)%name, oldH2O)
+        IF(ix == 0) CYCLE
+        tracs(ix)%name  = newH2O                                     !--- Set %name:   name of the tracer
+        WHERE(tracs(:)%parent == oldH2O) tracs(:)%parent = newH2O    !--- Set %parent: transporting fluid
+        tracs(ix)%phase = known_phases(ip:ip)                        !--- Set %phase:  tracer phase
       END DO
-      tracs(it)%parent = tran0                                       !--- Default transporting fluid: Air
-      IF(ns == 4) tracs(it)%parent = s(4)                            !--- Transporting fluid name
-    END DO
-    CLOSE(90)
-
-    lGen3 = tracs%iGeneration==3
-    CALL setGeneration(tracs)                                        !--- Determine tracs(:)%iGeneration values
-    IF(test(checkTracers(tracs,      fname,fname),lerr)) RETURN      !--- Detect orphans and check phases
-    IF(test(checkUnique (tracs,lGen3,fname,fname),lerr)) RETURN      !--- Detect repeated tracers
-    CALL sortTracers  (tracs)                                        !--- Sort the tracers
-    CALL setDirectKeys(tracs)                                        !--- Set the directly accessible keys
-    tracs(:)%keys%name = tracs(:)%name                               !--- Copy tracers names in keys components
-    RETURN
-  !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+      CALL setGeneration(tracs)                                      !--- Set %iGeneration and %gen0Name
+      WHERE(tracs%iGeneration == 3) tracs%type = 'tag'               !--- Set %type:        'tracer' or 'tag'
+      IF(test(checkTracers(tracs, fname, fname), lerr)) RETURN       !--- Detect orphans and check phases
+      IF(test(checkUnique (tracs, fname, fname), lerr)) RETURN       !--- Detect repeated tracers
+      CALL sortTracers  (tracs)                                      !--- Sort the tracers
+      tracs(:)%keys%name = tracs(:)%name                             !--- Copy tracers names in keys components
+    !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+    CASE(2); IF(test(feedDBase(["tracer.def"],[type_trac]), lerr)) RETURN  !=== SINGLE FILE, COMA-SEPARATED SECTIONS LIST
+    !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+    CASE(3); IF(test(feedDBase(  trac_files  , sections  ), lerr)) RETURN  !=== MULTIPLE FILES, ONE SECTION EACH FILE
+  !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+  END SELECT
+  !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+  IF(ANY([2,3] == fType) .AND. nsec > 1) THEN
+    IF(tracs_merge) THEN
+      CALL msg('The multiple required sections will be MERGED.',    modname)
+      IF(test(mergeTracers(dBase, tracs), lerr)) RETURN
+    ELSE
+      CALL msg('The multiple required sections will be CUMULATED.', modname)
+      IF(test(cumulTracers(dBase, tracs), lerr)) RETURN
+    END IF
+    WHERE(tracs%gen0Name(1:3) == 'H2O') tracs%isH2Ofamily=.TRUE.     !--- Set %isH2Ofamily: belongs to H2O family
+    CALL setDirectKeys(tracs)                                        !--- Set %iqParent, %iqDescen, %nqDescen, %nqChilds
   END IF
-  !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-  !=== USING NEW FORMAT TRACERS DESCRIPTION FILES WITH POSSIBLY SEVERAL SECTIONS
-  CALL msg('The multiple required sections will be MERGED.',    modname, nsec > 1 .AND.      tracs_merge)
-  CALL msg('The multiple required sections will be CUMULATED.', modname, nsec > 1 .AND. .NOT.tracs_merge)
-
-  !=== FEED THE DATABASE WITH THE RAW CONTENT OF THE FILE
-  SELECT CASE(fType)
-    CASE(2); lerr = feedDBase(["tracer.def"],[type_trac])            !--- Single file, coma-separated sections list
-    CASE(3); lerr = feedDBase(trac_files,     sections  )            !--- Multiple files, one section name each file
-  END SELECT
-  IF(lerr) RETURN
-  IF(     tracs_merge) lerr = mergeTracers(dBase, tracs)             !--- MERGE    THE COMPONENTS OF THE DATABASE
-  IF(.NOT.tracs_merge) lerr = cumulTracers(dBase, tracs)             !--- CUMULATE THE COMPONENTS OF THE DATABASE
-  IF(lerr) RETURN
-  CALL setDirectKeys(tracs)                                          !--- Set the directly accessible keys
 
 END FUNCTION readTracersFiles
@@ -201,5 +210,5 @@
   ll = strCount(snames, ',', ndb)                                    !--- Number of sections for each file
   ALLOCATE(ixf(SUM(ndb)))
-  DO i=1, SIZE(fnames)
+  DO i=1, SIZE(fnames)                                               !--- Set %name, %keys
     IF(test(readSections(fnames(i), snames(i), 'default'), lerr)) RETURN
     ixf(1+SUM(ndb(1:i-1)):SUM(ndb(1:i))) = i                         !--- File index for each section of the expanded list
@@ -208,11 +217,10 @@
   DO idb=1,SIZE(dBase)                                               !--- LOOP ON THE LOADED SECTIONS
   !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-    fnm = fnames(ixf(idb)); snm = dBase(idb)%name
-    IF(test(expandSection(dBase(idb)%trac,   snm, fnm),lerr)) RETURN !--- EXPAND NAMES AND PARENTS LISTS
-    CALL setGeneration   (dBase(idb)%trac)                           !--- DETERMINE GENERATION NUMBER
-    IF(test(checkTracers (dBase(idb)%trac,   snm, fnm),lerr)) RETURN !--- CHECK ORPHANS AND PHASES
-    lTg = dBase(idb)%trac(:)%type == 'tag'                           !--- Flag for tagging tracers
-    IF(test(checkUnique  (dBase(idb)%trac,lTg,snm,fnm),lerr)) RETURN !--- CHECK TRACERS UNIQUENESS
-    CALL expandPhases    (dBase(idb)%trac)                           !--- EXPAND THE PHASES
+    fnm = fnames(ixf(idb)); snm = dBase(idb)%name                    !--- FILE AND SECTION NAMES
+    IF(test(expandSection(dBase(idb)%trac, snm, fnm), lerr)) RETURN  !--- EXPAND NAMES ;  set %parent, %type, %component
+    CALL setGeneration   (dBase(idb)%trac)                           !---                 set %iGeneration,   %genOName
+    IF(test(checkTracers (dBase(idb)%trac, snm, fnm), lerr)) RETURN  !--- CHECK ORPHANS AND PHASES
+    IF(test(checkUnique  (dBase(idb)%trac, snm, fnm), lerr)) RETURN  !--- CHECK TRACERS UNIQUENESS
+    CALL expandPhases    (dBase(idb)%trac)                           !--- EXPAND PHASES ; set %phase
     CALL sortTracers     (dBase(idb)%trac)                           !--- SORT TRACERS
   !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -283,8 +291,8 @@
       ll = strParse(str,' ', keys = s, vals = v, n = n)              !--- Parse <key>=<val> pairs
       tt = dBase(ndb)%trac(:)
-      tmp%name = s(1); tmp%component=secn; tmp%keys = keys_type(s(1), s(2:n), v(2:n))
+      tmp%name = s(1); tmp%keys = keys_type(s(1), s(2:n), v(2:n))    !--- Set %name and %keys
       dBase(ndb)%trac = [tt(:), tmp]
       DEALLOCATE(tt)
-!      dBase(ndb)%trac = [dBase(ndb)%trac(:), tra(name=s(1), comp=secn, keys=keys_type(s(1), s(2:n), v(2:n)))]
+!      dBase(ndb)%trac = [dBase(ndb)%trac(:), tra(name=s(1), keys=keys_type(s(1), s(2:n), v(2:n)))]
     END IF
   END DO
@@ -421,24 +429,21 @@
 !------------------------------------------------------------------------------------------------------------------------------
 ! Purpose: Determine, for each tracer of "tr(:)":
-!   * the generation number 
-!   * the first generation ancestor name
-!------------------------------------------------------------------------------------------------------------------------------
-! Arguments:
-  TYPE(trac_type), INTENT(INOUT) :: tr(:)                            !--- Tracer derived type vector
-!------------------------------------------------------------------------------------------------------------------------------
-! Local variables:
-  INTEGER :: iq, nq, ig
+!   * %iGeneration: the generation number 
+!   * %gen0Name:    the generation 0 ancestor name
+!------------------------------------------------------------------------------------------------------------------------------
+  TYPE(trac_type),     INTENT(INOUT) :: tr(:)                        !--- Tracer derived type vector
+  INTEGER                            :: iq, nq, ig
   LOGICAL,               ALLOCATABLE :: lg(:)
   CHARACTER(LEN=maxlen), ALLOCATABLE :: prn(:)
 !------------------------------------------------------------------------------------------------------------------------------
-  tr(:)%iGeneration = 0                                              !--- error if 0
+  tr(:)%iGeneration = -1                                             !--- error if -1
   nq = SIZE(tr, DIM=1)                                               !--- Number of tracers lines
   lg = tr(:)%parent == tran0                                         !--- First generation tracers flag
-  WHERE(lg) tr(:)%iGeneration = 1                                    !--- First generation tracers
+  WHERE(lg) tr(:)%iGeneration = 0                                    !--- First generation tracers
 
   !=== Determine generation for each tracer
-  ig=0; prn = [tran0]
+  ig=-1; prn = [tran0]
   DO                                                                 !--- Update current generation flag
-    IF(ig/=0) prn = PACK( tr(:)%name, MASK=tr(:)%iGeneration == ig)
+    IF(ig/=-1) prn = PACK( tr(:)%name, MASK=tr(:)%iGeneration == ig)
     lg(:) = [(ANY(prn(:) == tr(iq)%parent), iq=1, nq)]               !--- Current generation tracers flag
     IF( ALL( .NOT. lg ) ) EXIT                                       !--- Empty current generation
@@ -470,8 +475,8 @@
 
   !=== CHECK FOR ORPHAN TRACERS
-  IF(test(checkList(tr%name, tr%iGeneration==0, mesg, 'tracers', 'orphan'), lerr)) RETURN
+  IF(test(checkList(tr%name, tr%iGeneration==-1, mesg, 'tracers', 'orphan'), lerr)) RETURN
 
   !=== CHECK PHASES
-  DO iq=1,nq; IF(tr(iq)%iGeneration/=1) CYCLE                        !--- Generation 1 only is checked
+  DO iq=1,nq; IF(tr(iq)%iGeneration/=0) CYCLE                        !--- Generation O only is checked
     pha = fgetKey(iq, 'phases', tr(:)%keys, 'g')                     !--- Phases
     np = LEN_TRIM(pha); bp(iq)=' '
@@ -479,15 +484,14 @@
     IF(TRIM(bp(iq)) /= '') bp(iq) = TRIM(tr(iq)%name)//': '//TRIM(bp(iq))
   END DO
-  lerr = checkList(bp, tr%iGeneration==1 .AND. bp/='', mesg, 'tracers phases', 'unknown')
+  lerr = checkList(bp, tr%iGeneration==0 .AND. bp/='', mesg, 'tracers phases', 'unknown')
 END FUNCTION checkTracers
 !==============================================================================================================================
 
 !==============================================================================================================================
-LOGICAL FUNCTION checkUnique(tr, lTag, sname, fname) RESULT(lerr)
+LOGICAL FUNCTION checkUnique(tr, sname, fname) RESULT(lerr)
 !------------------------------------------------------------------------------------------------------------------------------
 ! Purpose: Make sure that tracers are not repeated.
 !------------------------------------------------------------------------------------------------------------------------------
   TYPE(trac_type),            INTENT(IN) :: tr(:)                    !--- Tracer derived type vector
-  LOGICAL,                    INTENT(IN) :: lTag(:)                  !--- Tagging tracer flag
   CHARACTER(LEN=*),           INTENT(IN) :: sname                    !--- Section name
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: fname                    !--- File name
@@ -502,5 +506,5 @@
   nq=SIZE(tr,DIM=1); lerr=.FALSE.                                    !--- Number of lines ; error flag
   tdup(:) = ''
-  DO iq=1,nq; IF(lTag(iq)) CYCLE                                     !--- Tags can be repeated
+  DO iq=1,nq; IF(tr(iq)%type == 'tag') CYCLE                         !--- Tags can be repeated
     tnam = TRIM(tr(iq)%name)
     ll = tr(:)%name==TRIM(tnam)                                      !--- Mask for current tracer name
@@ -585,16 +589,25 @@
 !------------------------------------------------------------------------------------------------------------------------------
 ! Purpose: Sort tracers:
+!  * Put water at first places, in the "known_phases" order.
 !  * lGrowGen == T: in ascending generations numbers.
 !  * lGrowGen == F: tracer + its childs sorted by growing generation, one after the other.
+!   TO BE ADDED IF NECESSARY: HIGHER MOMENTS AT THE END
 !------------------------------------------------------------------------------------------------------------------------------
   TYPE(trac_type), ALLOCATABLE, INTENT(INOUT) :: tr(:)               !--- Tracer derived type vector
-  INTEGER :: ig, ng, iq, jq, n, ix(SIZE(tr)), k
+  INTEGER :: ig, ng, iq, jq, ip, nq, n, ix(SIZE(tr)), k
   INTEGER, ALLOCATABLE :: iy(:), iz(:)
 !------------------------------------------------------------------------------------------------------------------------------
+  nq = SIZE(tr)
+  iy = [(k, k=1, nq)]
+  DO ip = nphases, 1, -1
+    iq = strIdx(tracers(:)%name, 'H2O'//phases_sep//known_phases(ip:ip))
+    IF(iq/=0) iy = [iq, iy(1:iq-1), iy(iq:nq)]
+  END DO
+  tr = tr(iy)                                                        !--- Water displaces at first positions
   iq = 1
   IF(lSortByGen) THEN
     ng = MAXVAL(tr(:)%iGeneration, MASK=.TRUE., DIM=1)               !--- Number of generations
     DO ig = 0, ng                                                    !--- Loop on generations
-      iy = PACK([(k, k=1, SIZE(tr))], MASK=tr(:)%iGeneration==ig)    !--- Generation ig tracers indexes
+      iy = PACK([(k, k=1, nq)], MASK=tr(:)%iGeneration==ig)          !--- Generation ig tracers indexes
       n = SIZE(iy)
       ix(iq:iq+n-1) = iy                                             !--- Stack growing generations idxs
@@ -602,5 +615,5 @@
     END DO
   ELSE
-    DO jq = 1, SIZE(tr,DIM=1)                                        !--- Loop on first generation tracers
+    DO jq = 1, nq                                                    !--- Loop on first generation tracers
       IF(tr(jq)%iGeneration /= 1) CYCLE                              !--- Skip generations >= 1
       ix(iq) = jq                                                    !--- First generation ancestor index first
@@ -727,7 +740,11 @@
 SUBROUTINE setDirectKeys(tr)
   TYPE(trac_type), INTENT(INOUT) :: tr(:)
-  CALL indexUpdate(tr)                                               !--- Update iqParent and iqDescen indexes vectors
+
+  !--- Update %iqParent, %iqDescen, %nqDescen, %nqChilds
+  CALL indexUpdate(tr)
+
+  !--- Extract some direct-access keys
 !  DO iq = 1, SIZE(tr)
-!    tr(iq)%keys%<key> = getKey_prv(it, "<key>", tr%keys,  tran0 )   !--- For additional keys
+!    tr(iq)%keys%<key> = getKey_prv(it, "<key>", tr%keys, <default_value> )
 !  END DO
 END SUBROUTINE setDirectKeys
@@ -829,5 +846,5 @@
 !=== NOTES:                                                                                                                ====
 !===  * Most of the "isot" components have been defined in the calling routine (initIsotopes):                             ====
-!===      prnt,   nzon, zone(:),   niso, keys(:)%name,   nitr, trac(:),   npha, phas,  iTraPha(:,:),  iZonPhi(:,:)         ====
+!===      parent,  nzone, zone(:),  niso, keys(:)%name,  ntiso, trac(:),  nphas, phas,  iTraPha(:,:),  iZonPhi(:,:)        ====
 !===  * Same syntax for isotopes file and "tracer.def": a tracers section contains one line for each of its isotopes       ====
 !===  * Each tracers section can contain a "params" virtual isotope line of isotopes parameters default values             ====
@@ -939,5 +956,5 @@
     s%zone = PACK(strTail(t(:)%name,'_',lFirst=.TRUE.), MASK = ll)   !--- Tagging zones names  for isotopes category "iname"
     CALL strReduce(s%zone)
-    s%nzon = SIZE(s%zone)                                            !--- Tagging zones number for isotopes category "iname"
+    s%nzone = SIZE(s%zone)                                           !--- Tagging zones number for isotopes category "iname"
 
     !=== Geographic tracers of the isotopes childs of tracer "iname" (same for each phase of "iname")
@@ -945,13 +962,13 @@
     str = PACK(delPhase(t(:)%name), MASK=ll)
     CALL strReduce(str)
-    s%nitr = s%niso + SIZE(str)                                      !--- Number of isotopes + their geographic tracers [ntraciso]
-    ALLOCATE(s%trac(s%nitr))
+    s%ntiso = s%niso + SIZE(str)                                     !--- Number of isotopes + their geographic tracers [ntraciso]
+    ALLOCATE(s%trac(s%ntiso))
     FORALL(it = 1:s%niso) s%trac(it) = s%keys(it)%name
-    FORALL(it = s%niso+1:s%nitr) s%trac(it) = str(it-s%niso)
+    FORALL(it = s%niso+1:s%ntiso) s%trac(it) = str(it-s%niso)
 
     !=== Phases for tracer "iname"
     s%phase = ''
     DO ip = 1, nphases; ph = known_phases(ip:ip); IF(strIdx(t%name,addPhase(iname, ph)) /= 0) s%phase = TRIM(s%phase)//ph; END DO
-    s%npha = LEN_TRIM(s%phase)                                        !--- Equal to "nqo" for water
+    s%nphas = LEN_TRIM(s%phase)                                       !--- Equal to "nqo" for water
 
     !=== Tables giving the index in a table of effectively found items for each dynamical tracer (1<=iq<=nqtot)
@@ -968,10 +985,10 @@
     !=== Table used to get iq (index in dyn array, size nqtot) from the isotope and phase indexes ; the full isotopes list
     !    (including tagging tracers) is sorted this way:  iso1, iso2, ..., iso1_zone1, iso2_zone1, ..., iso1_zoneN, iso2_zoneN
-    s%iTraPha = RESHAPE( [( (strIdx(t(:)%name,  addPhase(s%trac(it),s%phase(ip:ip))),    it=1, s%nitr), ip=1, s%npha)], &
-                         [s%nitr, s%npha] )
-
-    !=== Table used to get ix (index in tagging tracers isotopes list, size nitr) from the zone and isotope indexes
-    s%iZonIso = RESHAPE( [( (strIdx(s%trac(:), TRIM(s%trac(it))//'_'//TRIM(s%zone(iz))), iz=1, s%nzon), it=1, s%niso)], &
-                         [s%nzon, s%niso] )
+    s%iTraPha = RESHAPE( [( (strIdx(t(:)%name,  addPhase(s%trac(it),s%phase(ip:ip))),    it=1, s%ntiso), ip=1, s%nphas)], &
+                         [s%ntiso, s%nphas] )
+
+    !=== Table used to get ix (index in tagging tracers isotopes list, size ntiso) from the zone and isotope indexes
+    s%iZonIso = RESHAPE( [( (strIdx(s%trac(:), TRIM(s%trac(it))//'_'//TRIM(s%zone(iz))), iz=1, s%nzone), it=1, s%niso )], &
+                         [s%nzone, s%niso] )
   END DO
 
@@ -1240,4 +1257,8 @@
   out = s
   IF(s == '') RETURN                                                           !--- Empty string: nothing to do
+
+  !--- Special case: old phases for water, no phases separator
+  IF(ANY([('H2O'//old_phases(ix:ix), ix=1, nphases)] == s)) THEN; out='H2O'; RETURN; END IF
+
   !--- Index of found phase in "known_phases"
   ix = MAXLOC( [(i, i=1,nphases)], MASK=[( INDEX(s, phases_sep//known_phases(i:i))/=0, i=1, nphases)], DIM=1 )
@@ -1252,22 +1273,28 @@
 END FUNCTION delPhase
 !------------------------------------------------------------------------------------------------------------------------------
-CHARACTER(LEN=maxlen) FUNCTION addPhase_1(s,pha) RESULT(out)
-  CHARACTER(LEN=*), INTENT(IN) :: s
-  CHARACTER(LEN=1), INTENT(IN) :: pha
+CHARACTER(LEN=maxlen) FUNCTION addPhase_1(s,pha,ph_sep) RESULT(out)
+  CHARACTER(LEN=*),           INTENT(IN) :: s
+  CHARACTER(LEN=1),           INTENT(IN) :: pha
+  CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: ph_sep
+  CHARACTER(LEN=1) :: psep
   INTEGER :: l, i
   out = s
   IF(s == '') RETURN                                                           !--- Empty string: nothing to do
+  psep = phases_sep; IF(PRESENT(ph_sep)) psep = ph_sep
   i = INDEX(s, '_')                                                            !--- /=0 for <var>_<tag> tracers names
   l = LEN_TRIM(s)
-  IF(i == 0) out =  TRIM(s)//phases_sep//pha                                   !--- <var>       => return <var><sep><pha>
-  IF(i /= 0) out = s(1:i-1)//phases_sep//pha//'_'//s(i+1:l)                    !--- <var>_<tag> => return <var><sep><pha>_<tag>
+  IF(i == 0) out =  TRIM(s)//TRIM(psep)//pha                                   !--- <var>       => return <var><sep><pha>
+  IF(i /= 0) out = s(1:i-1)//TRIM(psep)//pha//'_'//s(i+1:l)                    !--- <var>_<tag> => return <var><sep><pha>_<tag>
 END FUNCTION addPhase_1
 !------------------------------------------------------------------------------------------------------------------------------
-FUNCTION addPhase_m(s,pha) RESULT(out)
-  CHARACTER(LEN=*),      INTENT(IN)  :: s(:)
-  CHARACTER(LEN=1),      INTENT(IN)  :: pha
-  CHARACTER(LEN=maxlen), ALLOCATABLE :: out(:)  
+FUNCTION addPhase_m(s,pha,ph_sep) RESULT(out)
+  CHARACTER(LEN=*),           INTENT(IN) :: s(:)
+  CHARACTER(LEN=1),           INTENT(IN) :: pha
+  CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: ph_sep
+  CHARACTER(LEN=maxlen),     ALLOCATABLE :: out(:)
+  CHARACTER(LEN=1) :: psep
   INTEGER :: k
-  out = [( addPhase_1(s(k), pha), k=1, SIZE(s) )]
+  psep = phases_sep; IF(PRESENT(ph_sep)) psep = ph_sep
+  out = [( addPhase_1(s(k), pha, psep), k=1, SIZE(s) )]
 END FUNCTION addPhase_m
 !------------------------------------------------------------------------------------------------------------------------------
@@ -1282,5 +1309,5 @@
   INTEGER, OPTIONAL, INTENT(IN) :: igen
   INTEGER :: ig, ix
-  ig = 1; IF(PRESENT(igen)) ig = igen
+  ig = 0; IF(PRESENT(igen)) ig = igen
   ix = idxAncestor_1(t, tname, ig)
   out = ''; IF(ix /= 0) out = t(ix)%name
@@ -1294,5 +1321,5 @@
   INTEGER, ALLOCATABLE :: ix(:)
   INTEGER :: ig
-  ig = 1; IF(PRESENT(igen)) ig = igen
+  ig = 0; IF(PRESENT(igen)) ig = igen
   IF(     PRESENT(tname)) ix = idxAncestor_m(t, tname,     ig)
   IF(.NOT.PRESENT(tname)) ix = idxAncestor_m(t, t(:)%name, ig)
@@ -1307,13 +1334,13 @@
 !==============================================================================================================================
 INTEGER FUNCTION idxAncestor_1(t, tname, igen) RESULT(out)
-! Return the name of the generation "igen" ancestor of "tname"
+! Return the name of the generation "igen" (>=0) ancestor of "tname"
   TYPE(trac_type),   INTENT(IN) :: t(:)
   CHARACTER(LEN=*),  INTENT(IN) :: tname
   INTEGER, OPTIONAL, INTENT(IN) :: igen
   INTEGER :: ig
-  ig = 1; IF(PRESENT(igen)) ig = igen
+  ig = 0; IF(PRESENT(igen)) ig = igen
   out = strIdx(t(:)%name, tname)
-  IF(out == 0)          RETURN
-  IF(t(out)%iGeneration <= ig) RETURN
+  IF(out == 0)                 RETURN            !--- Tracer not found
+  IF(t(out)%iGeneration <= ig) RETURN            !--- Tracer has a lower generation number than asked generation 'igen"
   DO WHILE(t(out)%iGeneration > ig); out = strIdx(t(:)%name, t(out)%parent); END DO
 END FUNCTION idxAncestor_1
@@ -1325,5 +1352,5 @@
   INTEGER,          OPTIONAL, INTENT(IN) :: igen
   INTEGER :: ig, ix
-  ig = 1; IF(PRESENT(igen)) ig = igen
+  ig = 0; IF(PRESENT(igen)) ig = igen
   IF(     PRESENT(tname)) out = [(idxAncestor_1(t, tname(ix),  ig), ix=1, SIZE(tname))]
   IF(.NOT.PRESENT(tname)) out = [(idxAncestor_1(t, t(ix)%name, ig), ix=1, SIZE(t))]
Index: LMDZ6/trunk/libf/misc/strings_mod.F90
===================================================================
--- LMDZ6/trunk/libf/misc/strings_mod.F90	(revision 4062)
+++ LMDZ6/trunk/libf/misc/strings_mod.F90	(revision 4063)
@@ -106,5 +106,5 @@
   INTEGER,          OPTIONAL, INTENT(IN) :: unit
   INTEGER :: unt
-  IF(PRESENT(ll)) THEN; IF(ll) RETURN; END IF
+  IF(PRESENT(ll)) THEN; IF(.NOT.ll) RETURN; END IF
   unt = lunout; IF(PRESENT(unit)) unt = unit
   IF(PRESENT(modname)) THEN
@@ -124,17 +124,17 @@
   CHARACTER(LEN=maxlen), ALLOCATABLE :: s(:)
   INTEGER :: unt, nmx, k
-  LOGICAL :: lerr
-  lerr = .TRUE.; IF(PRESENT(ll))  lerr = ll
-  unt = lunout ; IF(PRESENT(unit)) unt = unit
-  nmx = 128;     IF(PRESENT(nmax)) nmx = nmax
+  LOGICAL :: l
+  l   = .TRUE.; IF(PRESENT(ll))     l = ll
+  unt = lunout; IF(PRESENT(unit)) unt = unit
+  nmx = 128;    IF(PRESENT(nmax)) nmx = nmax
   s = strStackm(str, ', ', nmx)
   IF(PRESENT(modname)) THEN
-    DO k=1,SIZE(s); CALL msg_1(s(k), modname, lerr, unt); END DO
+    DO k=1,SIZE(s); CALL msg_1(s(k), modname, l, unt); END DO
   ELSE
-    DO k=1,SIZE(s); CALL msg_1(s(k), ll=lerr, unit=unt);  END DO
+    DO k=1,SIZE(s); CALL msg_1(s(k), ll=l, unit=unt);  END DO
   END IF
 END SUBROUTINE msg_m
 !==============================================================================================================================
-LOGICAL FUNCTION fmsg_1(str, modname, ll, unit) RESULT(lerr)
+LOGICAL FUNCTION fmsg_1(str, modname, ll, unit) RESULT(l)
   CHARACTER(LEN=*),           INTENT(IN) :: str
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: modname
@@ -142,14 +142,14 @@
   INTEGER,          OPTIONAL, INTENT(IN) :: unit
   INTEGER :: unt
-  lerr = .TRUE.; IF(PRESENT(ll))  lerr = ll
-  unt = lunout ; IF(PRESENT(unit)) unt = unit
+  l   = .TRUE.; IF(PRESENT(ll))     l = ll
+  unt = lunout; IF(PRESENT(unit)) unt = unit
   IF(PRESENT(modname)) THEN
-    CALL msg_1(str, modname, lerr, unt)
+    CALL msg_1(str, modname, l, unt)
   ELSE
-    CALL msg_1(str, ll=lerr, unit=unt)
+    CALL msg_1(str, ll=l, unit=unt)
   END IF
 END FUNCTION fmsg_1
 !==============================================================================================================================
-LOGICAL FUNCTION fmsg_m(str, modname, ll, unit, nmax) RESULT(lerr)
+LOGICAL FUNCTION fmsg_m(str, modname, ll, unit, nmax) RESULT(l)
   CHARACTER(LEN=*),           INTENT(IN)  :: str(:)
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: modname
@@ -158,11 +158,11 @@
   INTEGER,          OPTIONAL, INTENT(IN)  :: nmax
   INTEGER :: unt, nmx
-  lerr = .TRUE.; IF(PRESENT(ll))  lerr = ll
-  unt = lunout ; IF(PRESENT(unit)) unt = unit
-  nmx = 128;     IF(PRESENT(nmax)) nmx = nmax
+  l   = .TRUE.; IF(PRESENT(ll))     l = ll
+  unt = lunout; IF(PRESENT(unit)) unt = unit
+  nmx = 128;    IF(PRESENT(nmax)) nmx = nmax
   IF(PRESENT(modname)) THEN
-    CALL msg_m(str, modname, lerr, unt, nmx)
+    CALL msg_m(str, modname, l, unt, nmx)
   ELSE
-    CALL msg_m(str, ll=lerr, unit=unt, nmax=nmx)
+    CALL msg_m(str, ll=l, unit=unt, nmax=nmx)
   END IF
 END FUNCTION fmsg_m
@@ -267,13 +267,20 @@
 !=== Concatenates the strings "str(:)" with separator "sep" into a single string using a separator (',' by default). ==========
 !==============================================================================================================================
-FUNCTION strStack(str, sep) RESULT(out)
+FUNCTION strStack(str, sep, mask) RESULT(out)
   CHARACTER(LEN=:),          ALLOCATABLE :: out
   CHARACTER(LEN=*),           INTENT(IN) :: str(:)
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: sep
+  LOGICAL,          OPTIONAL, INTENT(IN) :: mask(:)
   CHARACTER(LEN=:), ALLOCATABLE :: s
-  INTEGER :: is
+  INTEGER :: is, i0
   IF(SIZE(str) == 0) THEN; out = ''; RETURN; END IF
   ALLOCATE(s, SOURCE=', '); IF(PRESENT(sep)) s=sep
-  out = str(1); DO is=2,SIZE(str, DIM=1); out = TRIM(out)//s//TRIM(str(is)); END DO
+  IF(PRESENT(mask)) THEN
+    IF(ALL(.NOT.mask)) THEN; out = ''; RETURN; END IF
+    i0 = 0; DO WHILE(.NOT.mask(i0+1)); i0 = i0+1; END DO
+    out = str(i0); DO is=i0+1,SIZE(str, DIM=1); IF(.NOT.mask(is)) CYCLE; out = TRIM(out)//s//TRIM(str(is)); END DO
+  ELSE
+    out = str(1); DO is=2,SIZE(str, DIM=1); out = TRIM(out)//s//TRIM(str(is)); END DO
+  END IF
 END FUNCTION strStack
 !==============================================================================================================================
Index: LMDZ6/trunk/libf/misc/trac_types_mod.F90
===================================================================
--- LMDZ6/trunk/libf/misc/trac_types_mod.F90	(revision 4062)
+++ LMDZ6/trunk/libf/misc/trac_types_mod.F90	(revision 4063)
@@ -22,5 +22,5 @@
     CHARACTER(LEN=maxlen) :: component                     !--- Coma-separated list of components (Ex: lmdz,inca)
     INTEGER               :: iadv        = 10              !--- Advection scheme used
-    INTEGER               :: iGeneration = 1               !--- Generation number (>=1)
+    INTEGER               :: iGeneration = -1              !--- Generation number (>=0)
     LOGICAL               :: isAdvected  = .FALSE.         !--- "true" tracers: iadv > 0 . COUNT(     isAdvected) =nqtrue
     LOGICAL               :: isH2Ofamily = .FALSE.         !--- H2O tracers/isotopes/tags. COUNT(.NOT.isH2Ofamily)=nqtottr
@@ -40,14 +40,14 @@
     LOGICAL                            :: check=.FALSE.    !--- Triggering of the checking routines
     TYPE(keys_type),       ALLOCATABLE :: keys(:)          !--- Isotopes keys/values pairs list     (length: niso)
-    CHARACTER(LEN=maxlen), ALLOCATABLE :: trac(:)          !--- Isotopes + tagging tracers list     (length: nitr)
-    CHARACTER(LEN=maxlen), ALLOCATABLE :: zone(:)          !--- Geographic tagging zones names list (length: nzon)
-    CHARACTER(LEN=maxlen)              :: phase = 'g'      !--- Phases list: [g][l][s]              (length: npha)
-    INTEGER                            :: niso = 0         !--- Number of isotopes, excluding tagging tracers
-    INTEGER                            :: nzon = 0         !--- Number of geographic tagging zones
-    INTEGER                            :: nitr = 0         !--- Number of isotopes, including tagging tracers
-    INTEGER                            :: npha = 0         !--- Number phases
-    INTEGER,               ALLOCATABLE :: iTraPha(:,:)     !--- Idx in "trac(1:niso)" = f(name(1:nitr)),phas)
+    CHARACTER(LEN=maxlen), ALLOCATABLE :: trac(:)          !--- Isotopes + tagging tracers list     (length: ntiso)
+    CHARACTER(LEN=maxlen), ALLOCATABLE :: zone(:)          !--- Geographic tagging zones names list (length: nzone)
+    CHARACTER(LEN=maxlen)              :: phase = 'g'      !--- Phases list: [g][l][s]              (length: nphas)
+    INTEGER                            :: niso  = 0        !--- Number of isotopes, excluding tagging tracers
+    INTEGER                            :: nzone = 0        !--- Number of geographic tagging zones
+    INTEGER                            :: ntiso = 0        !--- Number of isotopes, including tagging tracers
+    INTEGER                            :: nphas = 0        !--- Number phases
+    INTEGER,               ALLOCATABLE :: iTraPha(:,:)     !--- Idx in "trac(1:niso)" = f(name(1:ntiso)),phas)
                                                            !---        "iTraPha" former name: "iqiso"
-    INTEGER,               ALLOCATABLE :: iZonIso(:,:)     !--- Idx in "trac(1:nitr)" = f(zone, name(1:niso))
+    INTEGER,               ALLOCATABLE :: iZonIso(:,:)     !--- Idx in "trac(1:ntiso)" = f(zone, name(1:niso))
                                                            !---        "iZonIso" former name: "index_trac"
   END TYPE isot_type
