Index: LMDZ6/trunk/libf/dyn3d_common/infotrac.f90
===================================================================
--- LMDZ6/trunk/libf/dyn3d_common/infotrac.f90	(revision 5748)
+++ LMDZ6/trunk/libf/dyn3d_common/infotrac.f90	(revision 5756)
@@ -3,9 +3,9 @@
 MODULE infotrac
 
-   USE       strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str,  strStack, strParse, strCount, strIdx
-   USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers,  addPhase,  addKey, iH2O,  &
-       isoSelect,  indexUpdate, isot_type, testTracersFiles, isotope,  delPhase,  getKey, tran0, &
-       isoKeys, isoName, isoZone, isoPhas, processIsotopes,  isoCheck, itZonIso,  nbIso,         &
-          niso,   ntiso,   nzone,   nphas,   maxTableWidth,  iqIsoPha, iqWIsoPha, ixIso, new2oldH2O, newHNO3, oldHNO3
+   USE       strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str, strStack, strParse, strCount, strIdx, maxTableWidth
+   USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers,  addPhase,  addKey, iH2O,    &
+       isoSelect,  indexUpdate, isot_type, testTracersFiles, isotope,  delPhase,  getKey, tran0,   &
+       isoKeys, isoName, isoZone, isoPhas, processIsotopes,  isoCheck, itZonIso,  nbIso, newHNO3,  &
+          niso,   ntiso,   nzone,   nphas, isoF=>isoFamilies,iqIsoPha, iqWIsoPha, ixIso, oldHNO3, new2oldH2O
    IMPLICIT NONE
 
@@ -22,5 +22,5 @@
    !=== FOR ISOTOPES: General
    PUBLIC :: isot_type, nbIso                              !--- Derived type, full isotopes families database + nb of families
-   PUBLIC :: isoSelect, ixIso                              !--- Isotopes family selection tool + selected family index
+   PUBLIC :: isoSelect, ixIso, isoFamilies                 !--- Isotopes families selection tool + selected family index
    !=== FOR ISOTOPES: Specific to water
    PUBLIC :: iH2O                                          !--- Value of "ixIso" for "H2O" isotopes class
@@ -81,5 +81,5 @@
 !  | 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                |
+!  | iso_iPhase  | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
 !  +-------------+------------------------------------------------------+-------------+------------------------+
 !
@@ -98,7 +98,8 @@
 !  +-----------------+--------------------------------------------------+--------------------+-----------------+
 
+   !=== THRESHOLDS FOR WATER
    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
+   !=== DIMENSIONS OF THE TRACERS TABLES, TRACERS TYPE(S)
    INTEGER, SAVE :: nqtot                                       !--- Tracers nb in dynamics (incl. higher moments + H2O)
    INTEGER, SAVE :: nbtr                                        !--- Tracers nb in physics  (excl. higher moments + H2O)
@@ -111,4 +112,7 @@
    INTEGER, SAVE, ALLOCATABLE :: conv_flg(:), pbl_flg(:)        !--- Convection / boundary layer activation (nbtr)
 
+   !=== LIST OF DEFINED ISOTOPES FAMILIES
+   CHARACTER(LEN=maxlen), SAVE, ALLOCATABLE :: isoFamilies(:)   !--- Generation 0 tracer name for each isotopes family (nbIso)
+
 CONTAINS
 
@@ -116,8 +120,9 @@
    USE iniprint_mod_h
    USE control_mod, ONLY: planet_type
+   USE ioipsl, ONLY: getin
    USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_trac
    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS, CPPKEY_STRATAER
    USE dimensions_mod, ONLY: iim, jjm, llm, ndm
-IMPLICIT NONE
+   IMPLICIT NONE
 !==============================================================================================================================
 !
@@ -152,5 +157,5 @@
    INTEGER :: nqtrue                                                 !--- Tracers nb from tracer.def (no higher order moments)
    INTEGER :: iad                                                    !--- Advection scheme number
-   INTEGER :: iq, jq, nt, im, nm, ig                                 !--- Indexes and temporary variables
+   INTEGER :: iq, jq, it, nt, im, nm, ig                             !--- Indexes and temporary variables
    LOGICAL :: lerr
    TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:)
@@ -284,5 +289,5 @@
       IF(iad == -1) CALL abort_gcm(modname, msg1, 1)
 
-      !--- SET FIELDS longName and iadv
+      !--- SET FIELDS longName AND iadv
       t1%longName   = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad)
       t1%iadv       = iad
@@ -329,7 +334,15 @@
    END DO
 
-   !=== READ PHYSICAL PARAMETERS FOR ISOTOPES ; DONE HERE BECAUSE dynetat0 AND iniacademic NEED "tnat" AND "alpha_ideal"
-   niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE.
+   !=== DETERMINE ISOTOPES RELATED PARAMETERS ; DEFINE THE EXPLICIT KEYS iso_i*
    IF(processIsotopes()) CALL abort_gcm(modname, 'problem when processing isotopes parameters', 1)
+   iH2O = -1
+   IF(nbIso /= 0) THEN
+      IF(isoSelect('H2O', .TRUE.)) THEN
+         IF(isoSelect(1, .TRUE.)) CALL abort_physic(modname, "Can't select the first isotopes family", 1)
+      ELSE
+         iH2O = ixIso; CALL getin('ok_iso_verif', isotope%check)
+      END IF
+   END IF
+   isoFamilies = isoF(:)
 
    !--- Convection / boundary layer activation for all tracers
@@ -362,9 +375,13 @@
    CALL msg('No isotopes identified.', modname, nbIso == 0)
    IF(nbIso == 0) RETURN
-   CALL msg('For isotopes family "H2O":', modname)
-   CALL msg('  isoKeys%name = '//strStack(isoKeys%name), modname)
-   CALL msg('  isoName = '//strStack(isoName),      modname)
-   CALL msg('  isoZone = '//strStack(isoZone),      modname)
-   CALL msg('  isoPhas = '//TRIM(isoPhas),          modname)
+   DO it = 1, nbIso
+      IF(isoSelect(it, .TRUE.)) CALL abort_physic(modname, 'Problem when selecting isotopes class', 1)
+      CALL msg('For isotopes family "'//TRIM(isoFamilies(it))//'":', modname)
+      CALL msg('  isoKeys%name = '//strStack(isoKeys%name), modname)
+      CALL msg('  isoName = '//strStack(isoName), modname)
+      CALL msg('  isoZone = '//strStack(isoZone), modname)
+      CALL msg('  isoPhas = '//TRIM(isoPhas),     modname)
+   END DO
+   IF(isoSelect(iH2O, .TRUE.)) lerr = isoSelect(1, .TRUE.)
 
 END SUBROUTINE init_infotrac
