Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 320)
+++ /trunk/LMDZ.MARS/README	(revision 321)
@@ -1086,2 +1086,9 @@
   are put in the diagfi.nc file (as was the case before).
  
+== 21/10/2011 == EM
+- Corrected small bug in newstart: initracer was not always used and thus
+  some tracer indexes (igm_co2, igcm_h2o_vap,...) were not set. This
+  however means that we now also call inifis from newstart and that we read
+  in flags set in 'callphys.def' (required for sanity checks in initracer).
+  Also adapted 'inichim_readcallphys': removed some obsolescent tests on
+  number of tracers for given combinations of options.
Index: /trunk/LMDZ.MARS/libf/aeronomars/inichim_readcallphys.F
===================================================================
--- /trunk/LMDZ.MARS/libf/aeronomars/inichim_readcallphys.F	(revision 320)
+++ /trunk/LMDZ.MARS/libf/aeronomars/inichim_readcallphys.F	(revision 321)
@@ -209,8 +209,8 @@
 
 ! Test of incompatibility:
-! if doubleq is used, then dustbin should be 1
-
-         if (doubleq.and.(dustbin.ne.1)) then
-           print*,'if doubleq is used, then dustbin should be 1'
+! if doubleq is used, then dustbin should be at least 2
+
+         if (doubleq.and.(dustbin.lt.2)) then
+           print*,'if doubleq is used, then dustbin should be > 1'
            stop
          endif
@@ -451,6 +451,6 @@
          print*,' 1 water vapour tracer'
          print*,' 1 water ice tracer'
-         if (nqmx.ne.4) then
-           print*,'nqmx should be 4 with these options.'
+         if (nqmx.lt.4) then
+           print*,'nqmx should be at least 4 with these options.'
 		   print*,'(or check callphys.def)'
            stop
@@ -458,60 +458,60 @@
        endif
 
-       if ((doubleq).and..not.(h2o)) then
+!       if ((doubleq).and..not.(h2o)) then
 !         print*,' 1: dust ; 2: dust (doubleq)'
-         print*,' 2 dust tracers (doubleq)'
-         if (nqmx.ne.2) then
-           print*,'nqmx should be 2 with these options...'
-		   print*,'(or check callphys.def)'
-           stop
-         endif
-       endif
-
-       if (.not.(doubleq).and.(h2o).and.
-     $     (chem)) then
-         if (dustbin.gt.0) then
+!         print*,' 2 dust tracers (doubleq)'
+!         if (nqmx.ne.2) then
+!           print*,'nqmx should be 2 with these options...'
+!		   print*,'(or check callphys.def)'
+!           stop
+!         endif
+!       endif
+
+!       if (.not.(doubleq).and.(h2o).and.
+!     $     (chem)) then
+!         if (dustbin.gt.0) then
 !           print*,' 1 to ',dustbin,': dust bins'
-           print*,dustbin,' dust bins'
-         endif
+!           print*,dustbin,' dust bins'
+!         endif
 !         print*,nqchem_min,' to ',nqmx-2,': chemistry'
 !         print*,nqmx-1,': water ice ; ',nqmx,': water vapor'
-         print*,nqmx-2-dustbin,' chemistry tracers'
-         print*,' 1 water vapour tracer'
-         print*,' 1 water ice tracer'
-       endif
-
-       if (.not.(doubleq).and.(h2o).and.
-     $     .not.(chem)) then
-         if (dustbin.gt.0) then
+!         print*,nqmx-2-dustbin,' chemistry tracers'
+!         print*,' 1 water vapour tracer'
+!         print*,' 1 water ice tracer'
+!       endif
+
+!       if (.not.(doubleq).and.(h2o).and.
+!     $     .not.(chem)) then
+!         if (dustbin.gt.0) then
 !           print*,' 1 to ',dustbin,': dust bins'
-           print*,dustbin,' dust bins'
-         endif
+!           print*,dustbin,' dust bins'
+!         endif
 !         print*,nqmx-1,': water ice ; ',nqmx,': water vapor'
-         print*,' 1 water vapour tracer'
-         print*,' 1 water ice tracer'
-         if (nqmx.ne.(dustbin+2)) then
-           print*,'nqmx should be ',(dustbin+2),
-     $            ' with these options...'
-		   print*,'(or check callphys.def)'
-           stop
-         endif
-       endif
-
-       if (.not.(doubleq).and..not.(h2o)) then
-         if (dustbin.gt.0) then
+!         print*,' 1 water vapour tracer'
+!         print*,' 1 water ice tracer'
+!         if (nqmx.ne.(dustbin+2)) then
+!           print*,'nqmx should be ',(dustbin+2),
+!     $            ' with these options...'
+!		   print*,'(or check callphys.def)'
+!           stop
+!         endif
+!       endif
+
+!       if (.not.(doubleq).and..not.(h2o)) then
+!         if (dustbin.gt.0) then
 !           print*,' 1 to ',dustbin,': dust bins'
-           print*,dustbin,' dust bins'
-           if (nqmx.ne.dustbin) then
-             print*,'nqmx should be ',dustbin,
-     $              ' with these options...'
-             print*,'(or check callphys.def)'
-             stop
-           endif
-         else
-           print*,'dustbin=',dustbin,
-     $            ': tracer should be F with these options...'
-     $           ,'UNLESS you just want to move tracers around '
-         endif
-       endif
+!           print*,dustbin,' dust bins'
+!           if (nqmx.ne.dustbin) then
+!             print*,'nqmx should be ',dustbin,
+!     $              ' with these options...'
+!             print*,'(or check callphys.def)'
+!             stop
+!           endif
+!         else
+!           print*,'dustbin=',dustbin,
+!     $            ': tracer should be F with these options...'
+!     $           ,'UNLESS you just want to move tracers around '
+!         endif
+!       endif
 
       endif ! of if (tracer)
Index: /trunk/LMDZ.MARS/libf/dyn3d/newstart.F
===================================================================
--- /trunk/LMDZ.MARS/libf/dyn3d/newstart.F	(revision 320)
+++ /trunk/LMDZ.MARS/libf/dyn3d/newstart.F	(revision 321)
@@ -347,4 +347,10 @@
       CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
 
+! also initialize various physics flags/settings which might be needed
+!    (for instance initracer needs to know about some flags, and/or
+!      'datafile' path may be changed by user)
+      call inifis(ngridmx,llm,day_ini,daysec,dtphys,
+     &                latfi,lonfi,airefi,rad,g,r,cpp)
+
 c=======================================================================
 c   lecture topographie, albedo, inertie thermique, relief sous-maille
@@ -361,8 +367,4 @@
         relief="mola"
 c     enddo
-
-! before using datareadnc, "datafile" must be set (normaly done in inifis)
-      datafile="/u/forget/WWW/datagcm/datafile" ! default value
-      call getin("datadir",datafile) ! in case user specified another path
 
       CALL datareadnc(relief,phis,alb,surfith,z0S,
@@ -457,4 +459,7 @@
         tnom(1:nqmx)=noms(1:nqmx)
         write(*,*) 'Newstart: updated tracer names'
+      else
+       ! initialize tracer names and indexes (igcm_co2, igcm_h2o_vap, ...)
+        call initracer(qsurf,co2ice)
       endif
 
@@ -883,7 +888,9 @@
           DO l=1,llm
             DO j=1,jjp1
-              DO i=1,iip1
+              DO i=1,iip1-1
                 q(i,j,l,igcm_h2o_vap)=150.e-6 * (rlatu(j)+pi/2.) / pi
               ENDDO
+              ! We want to have the very same value at lon -180 and lon 180
+              q(iip1,j,l,igcm_h2o_vap) = q(1,j,l,igcm_h2o_vap)
             ENDDO
           ENDDO
