Index: /readTracFiles_mod.f90
===================================================================
--- /readTracFiles_mod.f90	(revision 3)
+++ /readTracFiles_mod.f90	(revision 4)
@@ -138,5 +138,6 @@
       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 = s(3); tracs(it)%phase = known_phases(1:1)     !--- Default: name, gazeous phase "g"
+      tracs(it)%name = TRIM(s(3))                                    !--- Name of the tracer
+      tracs(it)%phase = known_phases(1:1)                            !--- Phase (default: "g" for gazeous)
       DO ip = 1, nphases                                             !--- Deal with old water names
         IF(s(3) /= 'H2O'//old_phases(ip:ip)) CYCLE
@@ -401,5 +402,5 @@
       DO itr=1,ntr                                                   !--- Loop on tracers list elts
         i = iq+itr-1+(ipr-1)*ntr
-        ttr(i)%name = ta(itr); ttr(i)%parent = pa(ipr)
+        ttr(i)%name = TRIM(ta(itr)); ttr(i)%parent = pa(ipr)
         ttr(i)%keys = keys_type(ta(itr), tr(it)%keys%key, tr(it)%keys%val)
       END DO
@@ -502,6 +503,6 @@
   tdup(:) = ''
   DO iq=1,nq; IF(lTag(iq)) CYCLE                                     !--- Tags can be repeated
-    tnam = tr(iq)%name
-    ll = tr(:)%name==tnam                                            !--- Mask for current tracer name
+    tnam = TRIM(tr(iq)%name)
+    ll = tr(:)%name==TRIM(tnam)                                      !--- Mask for current tracer name
     IF(COUNT(ll)==1 ) CYCLE                                          !--- Tracer is not repeated
     IF(tr(iq)%iGeneration>1) THEN
@@ -548,5 +549,5 @@
   DO iq = 1, nq                                                      !--- Loop on "tr(:)" indexes
     lTg = tr(iq)%type=='tag'                                         !--- Current tracer is a tag
-    i0 = strFind(tr(:)%name, tr(iq)%gen0Name, n)                     !--- Indexes of first generation ancestor copies
+    i0 = strFind(tr(:)%name, TRIM(tr(iq)%gen0Name), n)               !--- Indexes of first generation ancestor copies
     np = SUM( [( LEN_TRIM(tr(i0(i))%phase),i=1,n )],1)               !--- Number of phases for current tracer tr(iq)
     lEx = np>1                                                       !--- Need of a phase suffix
@@ -562,6 +563,6 @@
         IF(lTg) nam = TRIM(nam)//'_'//TRIM(trn)                      !--- <parent>_<name> for tags
         ttr(it) = tr(iq)                                             !--- Same <key>=<val> pairs
-        ttr(it)%name = nam                                           !--- Name with possibly phase suffix
-        ttr(it)%keys%name = nam                                      !--- Name inside the keys decriptor
+        ttr(it)%name = TRIM(nam)                                     !--- Name with possibly phase suffix
+        ttr(it)%keys%name = TRIM(nam)                                !--- Name inside the keys decriptor
         ttr(it)%phase = pha(ip:ip)                                   !--- Single phase entry
         IF(lEx.AND.tr(iq)%iGeneration>1) THEN
@@ -605,5 +606,5 @@
       ix(iq) = jq                                                    !--- First generation ancestor index first
       iq = iq + 1
-      iy = strFind(tr(:)%gen0Name, tr(jq)%name)                      !--- Indexes of "tr(jq)" childs in "tr(:)"
+      iy = strFind(tr(:)%gen0Name, TRIM(tr(jq)%name))                !--- Indexes of "tr(jq)" childs in "tr(:)"
       ng = MAXVAL(tr(iy)%iGeneration, MASK=.TRUE., DIM=1)            !--- Generations number of the "tr(jq)" family
       DO ig = 2, ng                                                  !--- Loop   on generations for the tr(jq) family
@@ -641,5 +642,5 @@
     CALL msg(t1(PACK(ixct, MASK = ixct/=0))%name, modname, nmax=128) !--- Display duplicates (the 128 first at most)
     !--------------------------------------------------------------------------------------------------------------------------
-    DO i2=1,nt2; tnam = t2(i2)%name                                  !=== LOOP ON COMMON TRACERS
+    DO i2=1,nt2; tnam = TRIM(t2(i2)%name)                            !=== LOOP ON COMMON TRACERS
     !--------------------------------------------------------------------------------------------------------------------------
       i1 = ixct(i2); IF(i1 == 0) CYCLE                               !--- Idx in t1(:) ; skip new tracers
@@ -707,10 +708,10 @@
     DO iq=1, nt(is)                                                  !=== LOOP ON TRACERS
     !--------------------------------------------------------------------------------------------------------------------------
-      tnam = t1(iq)%name                                             !--- Original name
+      tnam = TRIM(t1(iq)%name)                                       !--- Original name
       IF(COUNT(t1%name == tnam) == 1) CYCLE                          !--- Current tracer is not duplicated: finished
       tnam_new = TRIM(tnam)//phases_sep//TRIM(sections(is)%name)     !--- Same with section extension
       nq = SUM(nt(1:is-1))                                           !--- Number of tracers in previous sections
       ns = nt(is)                                                    !--- Number of tracers in the current section
-      tr(iq + nq)%name = tnam_new                                    !--- Modify tracer name
+      tr(iq + nq)%name = TRIM(tnam_new)                              !--- Modify tracer name
       WHERE(tr(1+nq:ns+nq)%parent==tnam) tr(1+nq:ns+nq)%parent=tnam_new  !--- Modify parent name
     !--------------------------------------------------------------------------------------------------------------------------
Index: /strings_mod.F90
===================================================================
--- /strings_mod.F90	(revision 3)
+++ /strings_mod.F90	(revision 4)
@@ -178,5 +178,5 @@
   out = str
   DO k=1,LEN_TRIM(str)
-    IF(str(k:k)>='A'.OR.str(k:k)<='Z') out(k:k)=ACHAR(IACHAR(str(k:k))-32)
+    IF(str(k:k)>='A'.OR.str(k:k)<='Z') out(k:k)=ACHAR(IACHAR(str(k:k))+32)
   END DO
 END FUNCTION strLower
@@ -187,5 +187,5 @@
   out = str
   DO k=1,LEN_TRIM(str)
-    IF(str(k:k)>='a'.OR.str(k:k)<='z') out(k:k)=ACHAR(IACHAR(str(k:k))+32)
+    IF(str(k:k)>='a'.OR.str(k:k)<='z') out(k:k)=ACHAR(IACHAR(str(k:k))-32)
   END DO
 END FUNCTION strUpper
Index: /trac_types_mod.F90
===================================================================
--- /trac_types_mod.F90	(revision 3)
+++ /trac_types_mod.F90	(revision 4)
@@ -14,23 +14,23 @@
 !------------------------------------------------------------------------------------------------------------------------------
   TYPE :: trac_type                                        !=== TYPE FOR A SINGLE TRACER NAMED "name"
-    CHARACTER(LEN=maxlen) :: name        = ''      	   !--- Name of the tracer
-    CHARACTER(LEN=maxlen) :: gen0Name    = ''      	   !--- First generation ancestor name
-    CHARACTER(LEN=maxlen) :: parent      = ''      	   !--- Parent name
-    CHARACTER(LEN=maxlen) :: longName    = ''      	   !--- Long name (with advection scheme suffix)
-    CHARACTER(LEN=maxlen) :: type        = 'tracer'	   !--- Type  (so far: 'tracer' / 'tag')
-    CHARACTER(LEN=maxlen) :: phase       = 'g'     	   !--- Phase ('g'as / 'l'iquid / 's'olid)
-    CHARACTER(LEN=maxlen) :: component             	   !--- Coma-separated list of components (Ex: lmdz,inca)
-    INTEGER               :: iadv        = 10      	   !--- Advection scheme used
-    INTEGER               :: iGeneration = 1       	   !--- Generation number (>=1)
-    LOGICAL               :: isAdvected  = .FALSE. 	   !--- "true" tracers: iadv > 0 . COUNT(     isAdvected) =nqtrue
-    LOGICAL               :: isH2Ofamily = .FALSE. 	   !--- H2O tracers/isotopes/tags. COUNT(.NOT.isH2Ofamily)=nqtottr
-    INTEGER               :: iqParent    = 0       	   !--- Parent index
-    INTEGER,  ALLOCATABLE :: iqDescen(:)           	   !--- Descendants index (in growing generation order)
-    INTEGER               :: nqDescen    = 0       	   !--- Number of descendants (all generations)
-    INTEGER               :: nqChilds    = 0       	   !--- Number of childs    (first generation)
-    INTEGER               :: iso_iGroup  = 0       	   !--- Isotopes group index in isotopes(:)
-    INTEGER               :: iso_iName   = 0       	   !--- Isotope  name  index in isotopes(iso_iGroup)%trac(:)
-    INTEGER               :: iso_iZone   = 0       	   !--- Isotope  zone  index in isotopes(iso_iGroup)%zone(:)
-    INTEGER               :: iso_iPhase  = 0       	   !--- Isotope  phase index in isotopes(iso_iGroup)%phas
+    CHARACTER(LEN=maxlen) :: name        = ''              !--- Name of the tracer
+    CHARACTER(LEN=maxlen) :: gen0Name    = ''              !--- First generation ancestor name
+    CHARACTER(LEN=maxlen) :: parent      = ''              !--- Parent name
+    CHARACTER(LEN=maxlen) :: longName    = ''              !--- Long name (with advection scheme suffix)
+    CHARACTER(LEN=maxlen) :: type        = 'tracer'        !--- Type  (so far: 'tracer' / 'tag')
+    CHARACTER(LEN=maxlen) :: phase       = 'g'             !--- Phase ('g'as / 'l'iquid / 's'olid)
+    CHARACTER(LEN=maxlen) :: component                     !--- Coma-separated list of components (Ex: lmdz,inca)
+    INTEGER               :: iadv        = 10              !--- Advection scheme used
+    INTEGER               :: iGeneration = 1               !--- Generation number (>=1)
+    LOGICAL               :: isAdvected  = .FALSE.         !--- "true" tracers: iadv > 0 . COUNT(     isAdvected) =nqtrue
+    LOGICAL               :: isH2Ofamily = .FALSE.         !--- H2O tracers/isotopes/tags. COUNT(.NOT.isH2Ofamily)=nqtottr
+    INTEGER               :: iqParent    = 0               !--- Parent index
+    INTEGER,  ALLOCATABLE :: iqDescen(:)                   !--- Descendants index (in growing generation order)
+    INTEGER               :: nqDescen    = 0               !--- Number of descendants (all generations)
+    INTEGER               :: nqChilds    = 0               !--- Number of childs    (first generation)
+    INTEGER               :: iso_iGroup  = 0               !--- Isotopes group index in isotopes(:)
+    INTEGER               :: iso_iName   = 0               !--- Isotope  name  index in isotopes(iso_iGroup)%trac(:)
+    INTEGER               :: iso_iZone   = 0               !--- Isotope  zone  index in isotopes(iso_iGroup)%zone(:)
+    INTEGER               :: iso_iPhase  = 0               !--- Isotope  phase index in isotopes(iso_iGroup)%phas
     TYPE(keys_type)       :: keys                          !--- <key>=<val> pairs vector
   END TYPE trac_type
