Index: /LMDZ6/trunk/libf/dyn3d_common/infotrac.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3d_common/infotrac.F90	(revision 4402)
+++ /LMDZ6/trunk/libf/dyn3d_common/infotrac.F90	(revision 4403)
@@ -379,16 +379,14 @@
 
    !=== DISPLAY THE RESULTS
-   IF(prt_level > 1) THEN
-      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)
-      CALL msg('niso   = '//TRIM(int2str(niso)),   modname)
-      CALL msg('ntiso  = '//TRIM(int2str(ntiso)),  modname)
+   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)
+   CALL msg('niso   = '//TRIM(int2str(niso)),   modname)
+   CALL msg('ntiso  = '//TRIM(int2str(ntiso)),  modname)
 #ifdef INCA
-      CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
-      CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
-#endif
-   END IF
+   CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
+   CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
+#endif
    t => tracers
    CALL msg('Information stored in infotrac :', modname)
Index: /LMDZ6/trunk/libf/misc/readTracFiles_mod.f90
===================================================================
--- /LMDZ6/trunk/libf/misc/readTracFiles_mod.f90	(revision 4402)
+++ /LMDZ6/trunk/libf/misc/readTracFiles_mod.f90	(revision 4403)
@@ -1167,5 +1167,5 @@
     !=== Geographic tagging tracers descending on tracer "iname": mask, names, number
     ll = t(:)%type=='tag'    .AND. delPhase(t(:)%gen0Name) == iname .AND. t(:)%iGeneration == 2
-    i%zone = PACK(strTail(t(:)%name,'_'), MASK = ll)                 !--- Tagging zones names  for isotopes category "iname"
+    i%zone = PACK(strTail(t(:)%name,'_',.TRUE.), MASK = ll)          !--- Tagging zones names  for isotopes category "iname"
     CALL strReduce(i%zone)
     i%nzone = SIZE(i%zone)                                           !--- Tagging zones number for isotopes category "iname"
@@ -1190,6 +1190,6 @@
       IF(delPhase(t1%gen0Name)/=iname .OR. t1%iGeneration==0) CYCLE  !--- Only deal with tracers descending on "iname"
       t1%iso_iGroup = ic                                             !--- Isotopes family       idx in list "isotopes(:)%parent"
-      t1%iso_iName  = strIdx(i%trac, delPhase(strHead(t1%name,'_'))) !--- Current isotope       idx in effective isotopes list
-      t1%iso_iZone  = strIdx(i%zone,          strTail(t1%name,'_') ) !--- Current isotope zone  idx in effective zones    list
+      t1%iso_iName  = strIdx(i%trac, strHead(delPhase(t1%name),'_',.TRUE.)) !--- Current isotope       idx in effective isotopes list
+      t1%iso_iZone  = strIdx(i%zone,          strTail(t1%name, '_',.TRUE.)) !--- Current isotope zone  idx in effective zones    list
       t1%iso_iPhase =  INDEX(i%phase,TRIM(t1%phase))                 !--- Current isotope phase idx in effective phases   list
       IF(t1%iGeneration /= 2) t1%iso_iZone = 0                       !--- Skip possible generation 1 tagging tracers
@@ -1441,5 +1441,5 @@
 !------------------------------------------------------------------------------------------------------------------------------
   CHARACTER(LEN=maxlen) :: tnam
-  tnam = strHead(delPhase(tname),'_',.FALSE.)                                            !--- Remove tag and phase
+  tnam = strHead(delPhase(tname),'_',.TRUE.)                                             !--- Remove phase and tag
   IF(PRESENT(ky)) THEN                                                                   !=== KEY FROM "ky"
                val = fgetKeyNam_s1(tname, keyn, ky,           lerr=lerr)                 !--- "ky" and "tname"
@@ -1824,5 +1824,5 @@
 !------------------------------------------------------------------------------------------------------------------------------
   INTEGER :: ip
-  phase = TRIM(strHead(strTail(tname, phases_sep, .TRUE.), '_', .TRUE.))
+  phase = TRIM(strHead(strTail(tname, phases_sep), '_', .TRUE.))     !--- <nam><sep><pha>[_<tag>] -> <pha>[_<tag>] -> <pha>
   IF(     PRESENT(phases)) ip = INDEX(      phases, phase)
   IF(.NOT.PRESENT(phases)) ip = INDEX(known_phases, phase)
@@ -1854,7 +1854,7 @@
   ELSE
     ix = strIdx(oldH2OIso, tmp(2))                                             !--- Index in the known isotopes list
-    IF(ix /= 0) tmp(2) = newH2OIso(ix)                                         !--- Move to new isotope name
-    IF(ip /= 0) tmp(2) = addPhase(tmp(2), ip)                                  !--- Add phase to isotope name
-    newName = TRIM(strStack(tmp(2:nt), '_'))                                   !=== WATER ISOTOPE OR TAGGING TRACER
+    IF(ix /= 0) newName = newH2OIso(ix)                                        !--- Move to new isotope name
+    IF(ip /= 0) newName = addPhase(newName, ip)                                !--- Add phase to isotope name
+    IF(nt == 3) newName = TRIM(newName)//'_'//TRIM(tmp(3))                     !=== WATER ISOTOPE OR TAGGING TRACER
   END IF
 END FUNCTION old2newH2O_1
@@ -1881,21 +1881,15 @@
   CHARACTER(LEN=maxlen) :: var
   oldName = newName
-  IF(PRESENT(iPhase)) iPhase = 1                                               !--- Default: gaseous phase
   ip = getiPhase(newName)                                                      !--- Phase index
-  IF(ip /= 0 .AND. PRESENT(iPhase)) iPhase = ip                                !--- Returning phase index
-  ix = strIdx(newH2OIso, strHead(newName, '_'))                                !--- Index in the known H2O isotopes list
-  IF(ix /= 0) THEN
-    oldName = 'H2O'//'_'//TRIM(oldH2OIso(ix))                                  !=== WATER ISOTOPE WITHOUT PHASE
-    IF(newH2OIso(ix)/=newName) oldName=TRIM(oldName)//'_'//strTail(newName,'_')!=== WATER ISOTOPIC TAGGING TRACER WITHOUT PHASE
-  END IF
-  IF(ix /= 0 .OR. ip == 0)           RETURN
-  oldName = 'H2O'//old_phases(ip:ip)
-  IF(newName == addPhase('H2O', ip)) RETURN                                    !=== WATER WITH PHASE
-  var = TRIM(strHead(newName, phases_sep, .TRUE.))                             !--- Head variable name   (no phase)
+  IF(PRESENT(iPhase)) iPhase = MAX(ip, 1)                                      !--- Return phase index ; default: 1 (gazeous)
+  var = TRIM(strHead(newName, phases_sep, .TRUE.))                             !--- Variable without phase and tag
   ix = strIdx(newH2OIso, var)                                                  !--- Index in the known H2O isotopes list
-  IF(ix == 0)                        RETURN                                    !=== H2O[vli]_<var> (<var> /= H2O isotope)
-  oldName = TRIM(oldName)//'_'//TRIM(oldH2OIso(ix))                            !=== WATER ISOTOPE WITH PHASE
-  var = addPhase(var, ip)                                                      !--- Head variable with phase
-  IF(newName /= var) oldName = TRIM(oldName)//strTail(newName, TRIM(var))      !=== WATER ISOTOPIC TAGGING TRACER
+  IF(ix == 0 .AND. var /= 'H2O') RETURN                                        !--- Neither H2O nor an H2O isotope => finished
+  oldName = 'H2O'
+  IF(ip /= 0) oldName = TRIM(oldName)//old_phases(ip:ip)                       !--- Add phase if needed
+  IF(ix /= 0) oldName = TRIM(oldName)//'_'//oldH2OIso(ix)                      !--- H2O isotope name
+  IF(newName /= addPhase(var, ip)) &
+    oldName = TRIM(oldName)//strTail(newName, '_', .TRUE.)                     !--- Add the tag suffix
+  IF(ip == 0 .AND. ix /= 0) oldName = strTail(oldName, '_')                    !--- Isotope with no phase: remove 'H2O_' prefix
 END FUNCTION new2oldH2O_1
 !==============================================================================================================================
Index: /LMDZ6/trunk/libf/misc/strings_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/misc/strings_mod.F90	(revision 4402)
+++ /LMDZ6/trunk/libf/misc/strings_mod.F90	(revision 4403)
@@ -194,73 +194,73 @@
 
 !==============================================================================================================================
-!=== Extract the substring in front of the last (first if lFirst==TRUE) occurrence of separator "sep" in "str" ================
+!=== Extract the substring in front of the first (last if lBackward==TRUE) occurrence of "sep" in "str"        ================
 !=== Examples for str='a_b_c' and sep='_' and the bash command with the same effect:                           ================
 !===    * strHead(..,.FALSE.) = 'a'           ${str%%$sep*}                                                    ================
 !===    * strHead(..,.TRUE.)  = 'a_b'         ${str%$sep*}                                                     ================
 !==============================================================================================================================
-CHARACTER(LEN=maxlen) FUNCTION strHead_1(str,sep,lFirst) RESULT(out)
+CHARACTER(LEN=maxlen) FUNCTION strHead_1(str, sep, lBackward) RESULT(out)
   CHARACTER(LEN=*),           INTENT(IN) :: str
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: sep
-  LOGICAL,          OPTIONAL, INTENT(IN) :: lFirst
-!------------------------------------------------------------------------------------------------------------------------------
-  LOGICAL :: lf
-  lf = .FALSE.; IF(PRESENT(lFirst)) lf=lFirst
+  LOGICAL,          OPTIONAL, INTENT(IN) :: lBackward
+!------------------------------------------------------------------------------------------------------------------------------
   IF(PRESENT(sep)) THEN
-    out = str(1:INDEX(str,sep,.NOT.lf)-1)
+    IF(     PRESENT(lBackWard)) out = str(1:INDEX(str,sep,lBackWard)-1)
+    IF(.NOT.PRESENT(lBackWard)) out = str(1:INDEX(str,sep)-1)
   ELSE
-    out = str(1:INDEX(str,'/',.NOT.lf)-1)
+    IF(     PRESENT(lBackWard)) out = str(1:INDEX(str,'/',lBackWard)-1)
+    IF(.NOT.PRESENT(lBackWard)) out = str(1:INDEX(str,'/')-1)
   END IF
   IF(out == '') out = str
 END FUNCTION strHead_1
 !==============================================================================================================================
-FUNCTION strHead_m(str,sep,lFirst) RESULT(out)
+FUNCTION strHead_m(str, sep, lBackward) RESULT(out)
   CHARACTER(LEN=maxlen),     ALLOCATABLE :: out(:)
   CHARACTER(LEN=*),           INTENT(IN) :: str(:)
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: sep
-  LOGICAL,          OPTIONAL, INTENT(IN) :: lFirst
-!------------------------------------------------------------------------------------------------------------------------------
-  LOGICAL :: lf
+  LOGICAL,          OPTIONAL, INTENT(IN) :: lBackward
+!------------------------------------------------------------------------------------------------------------------------------
   INTEGER :: k
-  lf = .FALSE.; IF(PRESENT(lFirst)) lf=lFirst
   IF(PRESENT(sep)) THEN
-    out = [(strHead_1(str(k), sep,   lf), k=1, SIZE(str))]
+    IF(     PRESENT(lBackWard)) out = [(strHead_1(str(k), sep, lBackWard), k=1, SIZE(str))]
+    IF(.NOT.PRESENT(lBackWard)) out = [(strHead_1(str(k), sep),            k=1, SIZE(str))]
   ELSE
-    out = [(strHead_1(str(k), lFirst=lf), k=1, SIZE(str))]
+    IF(     PRESENT(lBackWard)) out = [(strHead_1(str(k), '/', lBackWard), k=1, SIZE(str))]
+    IF(.NOT.PRESENT(lBackWard)) out = [(strHead_1(str(k), '/'),            k=1, SIZE(str))]
   END IF
 END FUNCTION strHead_m
 !==============================================================================================================================
-!=== Extract the substring following the last (first if lFirst==TRUE) occurrence of separator "sep" in "str"   ================
+!=== Extract the substring following the first (last if lBackward==TRUE) occurrence of "sep" in "str"          ================
 !=== Examples for str='a_b_c' and sep='_' and the bash command with the same effect:                           ================
-!===    * strTail(..,.FALSE.) = 'c'           ${str#*$sep}                                                     ================
-!===    * strTail(..,.TRUE.)  = 'b_c'         ${str##*$sep}                                                    ================
-!==============================================================================================================================
-CHARACTER(LEN=maxlen) FUNCTION strTail_1(str,sep,lFirst) RESULT(out)
+!===    * strTail(str, '_', .FALSE.) = 'b_c'         ${str#*$sep}                                              ================
+!===    * strTail(str, '_', .TRUE.)  = 'c'           ${str##*$sep}                                             ================
+!==============================================================================================================================
+CHARACTER(LEN=maxlen) FUNCTION strTail_1(str, sep, lBackWard) RESULT(out)
   CHARACTER(LEN=*),           INTENT(IN) :: str
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: sep
-  LOGICAL,          OPTIONAL, INTENT(IN) :: lFirst
-!------------------------------------------------------------------------------------------------------------------------------
-  LOGICAL :: lf
-  lf = .FALSE.; IF(PRESENT(lFirst)) lf=lFirst
+  LOGICAL,          OPTIONAL, INTENT(IN) :: lBackWard
+!------------------------------------------------------------------------------------------------------------------------------
   IF(PRESENT(sep)) THEN
-    out = str(INDEX(str,sep,.NOT.lf)+LEN(sep):LEN_TRIM(str))
+    IF(     PRESENT(lBackWard)) out = str(INDEX(str,sep,lBackWard)+LEN(sep):LEN_TRIM(str))
+    IF(.NOT.PRESENT(lBackWard)) out = str(INDEX(str,sep)          +LEN(sep):LEN_TRIM(str))
   ELSE
-    out = str(INDEX(str,'/',.NOT.lf)+1:LEN_TRIM(str))
+    IF(     PRESENT(lBackWard)) out = str(INDEX(str,'/',lBackWard)+1:LEN_TRIM(str))
+    IF(.NOT.PRESENT(lBackWard)) out = str(INDEX(str,'/')          +1:LEN_TRIM(str))
   END IF
   IF(out == '') out = str
 END FUNCTION strTail_1
 !==============================================================================================================================
-FUNCTION strTail_m(str,sep,lFirst) RESULT(out)
+FUNCTION strTail_m(str, sep, lBackWard) RESULT(out)
   CHARACTER(LEN=maxlen),     ALLOCATABLE :: out(:)
   CHARACTER(LEN=*),           INTENT(IN) :: str(:)
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: sep
-  LOGICAL,          OPTIONAL, INTENT(IN) :: lFirst
-!------------------------------------------------------------------------------------------------------------------------------
-  LOGICAL :: lf
+  LOGICAL,          OPTIONAL, INTENT(IN) :: lBackWard
+!------------------------------------------------------------------------------------------------------------------------------
   INTEGER :: k
-  lf = .FALSE.; IF(PRESENT(lFirst)) lf=lFirst
   IF(PRESENT(sep)) THEN
-    out = [(strTail_1(str(k), sep,   lf), k=1, SIZE(str))]
+    IF(     PRESENT(lBackWard)) out = [(strTail_1(str(k), sep, lBackWard), k=1, SIZE(str))]
+    IF(.NOT.PRESENT(lBackWard)) out = [(strTail_1(str(k), sep),            k=1, SIZE(str))]
   ELSE
-    out = [(strTail_1(str(k), lFirst=lf), k=1, SIZE(str))]
+    IF(     PRESENT(lBackWard)) out = [(strTail_1(str(k), '/', lBackWard), k=1, SIZE(str))]
+    IF(.NOT.PRESENT(lBackWard)) out = [(strTail_1(str(k), '/'),            k=1, SIZE(str))]
   END IF
 END FUNCTION strTail_m
Index: /LMDZ6/trunk/libf/phylmd/infotrac_phy.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/infotrac_phy.F90	(revision 4402)
+++ /LMDZ6/trunk/libf/phylmd/infotrac_phy.F90	(revision 4403)
@@ -386,16 +386,14 @@
 
    !=== DISPLAY THE RESULTS
-!   IF(prt_level > 1) THEN
-      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)
-      CALL msg('niso   = '//TRIM(int2str(niso)),   modname)
-      CALL msg('ntiso  = '//TRIM(int2str(ntiso)),  modname)
+   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)
+   CALL msg('niso   = '//TRIM(int2str(niso)),   modname)
+   CALL msg('ntiso  = '//TRIM(int2str(ntiso)),  modname)
 #ifdef INCA
-      CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
-      CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
-#endif
-!   END IF
+   CALL msg('nqCO2  = '//TRIM(int2str(nqCO2)),  modname)
+   CALL msg('nqINCA = '//TRIM(int2str(nqINCA)), modname)
+#endif
    t => tracers
    CALL msg('Information stored in infotrac_phy :', modname)
Index: /LMDZ6/trunk/libf/phylmdiso/isotopes_routines_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/isotopes_routines_mod.F90	(revision 4402)
+++ /LMDZ6/trunk/libf/phylmdiso/isotopes_routines_mod.F90	(revision 4403)
@@ -16516,9 +16516,9 @@
 #endif
      xtrain_fall, xtsnow_fall, ql_ancien, xtl_ancien, qs_ancien, xts_ancien, fxtevap, xtsol
-   USE indice_sol_mod,    ONLY: nbsrf  
+   USE indice_sol_mod,    ONLY: nbsrf
    USE isotopes_mod,      ONLY: isoName,iso_HDO,iso_eau
    USE phyetat0_get_mod,  ONLY: phyetat0_get, phyetat0_srf
    USE readTracFiles_mod, ONLY: new2oldH2O
-   USE strings_mod,       ONLY: strIdx, strHead, strTail, maxlen, msg, int2str
+   USE strings_mod,       ONLY: strIdx, strTail, maxlen, msg, int2str
 #ifdef ISOVERIF
    USE isotopes_verif_mod
@@ -16558,5 +16558,5 @@
 
       outiso = isoName(ixt)
-      oldIso = strTail(new2oldH2O(outiso), '_', lFirst=.TRUE.)
+      oldIso = strTail(new2oldH2O(outiso), '_')            !--- Remove "H2O_" from "H2O_<iso>[_<tag>]"
       ! on lit seulement si ixt<=niso ou si on initialise les traceurs d'après fichier:
 #ifdef ISOTRAC
Index: /LMDZ6/trunk/libf/phylmdiso/isotrac_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/isotrac_mod.F90	(revision 4402)
+++ /LMDZ6/trunk/libf/phylmdiso/isotrac_mod.F90	(revision 4403)
@@ -149,5 +149,5 @@
    USE isotopes_mod, ONLY: iso_eau, ntracisoOR, initialisation_iso
    USE dimphy,       ONLY: klon, klev
-   USE  strings_mod, ONLY: int2str, strStack, strTail, strHead, fmsg
+   USE  strings_mod, ONLY: int2str, strStack, strTail, strHead, strIdx, fmsg
 
    IMPLICIT NONE
@@ -658,6 +658,6 @@
    END DO
 
-   index_zone = [(INDEX(isoZone, strTail(         isoName(ixt) ,'_')), ixt=1, ntiso)]
-   index_iso  = [(INDEX(isoName, strHead(delPhase(isoName(ixt)),'_')), ixt=1, ntiso)]
+   index_zone = [(strIdx(isoZone, strTail(isoName(ixt) ,'_',.TRUE.)), ixt=1, ntiso)]
+   index_iso  = [(strIdx(isoName, strHead(isoName(ixt) ,'_',.TRUE.)), ixt=1, ntiso)]
    itZonIso_loc = itZonIso(:,:)
 #ifdef ISOVERIF
