Index: trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F	(revision 561)
+++ trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F	(revision 563)
@@ -770,18 +770,17 @@
           read(*,*) tmpval
           qsurfold(1:imold+1,1:jmold+1,iq)=tmpval
-        ENDIF
-#ifdef NC_DOUBLE
-        ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,
+        ELSE ! tracer exists in file, load it
+#ifdef NC_DOUBLE
+          ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,
      &          qsurfold(1,1,iq))
 #else
-        ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,
+          ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,
      &          qsurfold(1,1,iq))
 #endif
-        IF (ierr .NE. NF_NOERR) THEN
-          PRINT*, "lect_start_archive: ",
+          IF (ierr .NE. NF_NOERR) THEN
+            PRINT*, "lect_start_archive: ",
      &             " Failed loading <",trim(txt),">"
-          print*, "which (constant) value should it be initialized to?"
-          read(*,*) tmpval
-          qsurfold(1:imold+1,1:jmold+1,iq)=tmpval
+            stop
+          ENDIF
         ENDIF
 
@@ -952,16 +951,15 @@
           read(*,*) tmpval
           qold(1:imold+1,1:jmold+1,1:lmold,iq)=tmpval
-        ENDIF
-#ifdef NC_DOUBLE
-        ierr=NF_GET_VARA_DOUBLE(nid,nvarid,start,count,qold(1,1,1,iq))
-#else
-        ierr=NF_GET_VARA_REAL(nid,nvarid,start,count,qold(1,1,1,iq))
-#endif
-        IF (ierr .NE. NF_NOERR) THEN
-          PRINT*, "lect_start_archive: ",
+        ELSE ! tracer exists in file, load it
+#ifdef NC_DOUBLE
+         ierr=NF_GET_VARA_DOUBLE(nid,nvarid,start,count,qold(1,1,1,iq))
+#else
+         ierr=NF_GET_VARA_REAL(nid,nvarid,start,count,qold(1,1,1,iq))
+#endif
+          IF (ierr .NE. NF_NOERR) THEN
+            PRINT*, "lect_start_archive: ",
      &             "  Failed loading <",trim(txt),">"
-          print*, "which (constant) value should it be initialized to?"
-          read(*,*) tmpval
-          qold(1:imold+1,1:jmold+1,1:lmold,iq)=tmpval
+            stop
+          ENDIF
         ENDIF
 
@@ -1044,5 +1042,7 @@
       write(*,*)'Old grid: mass of CO2 ice:',co2icetotalold
       write(*,*)'New grid: mass of CO2 ice:',co2icetotal
-      write(*,*)'Ratio new ice / old ice =',co2icetotal/co2icetotalold
+      if (co2icetotalold.ne.0.) then
+       write(*,*)'Ratio new ice / old ice =',co2icetotal/co2icetotalold
+      endif
       write(*,*)
 
Index: trunk/LMDZ.MARS/libf/dyn3d/newstart.F
===================================================================
--- trunk/LMDZ.MARS/libf/dyn3d/newstart.F	(revision 561)
+++ trunk/LMDZ.MARS/libf/dyn3d/newstart.F	(revision 563)
@@ -155,6 +155,7 @@
       
       INTEGER :: nq,numvanle
-      character(len=20) :: txt ! to store some text
+      character(len=50) :: txt ! to store some text
       integer :: count
+      real :: profile(llm+1) ! to store an atmospheric profile + surface value
 
 ! MONS data:
@@ -482,4 +483,5 @@
       write(*,*) 'q=0 : ALL tracer =zero'
       write(*,*) 'q=x : give a specific uniform value to one tracer'
+      write(*,*) 'q=profile : specify a profile for a tracer'
       write(*,*) 'ini_q : tracers initialisation for chemistry, water an
      $d ice   '
@@ -779,4 +781,53 @@
                  qsurf(ig,iq)=val
              ENDDO
+
+c       q=profile : initialize tracer with a given profile
+c       --------------------------------------------------
+        else if (trim(modif) .eq. 'q=profile') then
+             write(*,*) 'Tracer profile will be sought in ASCII file'
+             write(*,*) "'profile_tracer' where 'tracer' is tracer name"
+             write(*,*) "(one value per line in file; starting with"
+             write(*,*) "surface value, the 1st atmospheric layer"
+             write(*,*) "followed by 2nd, etc. up to top of atmosphere)"
+             write(*,*) 'Which tracer do you want to set?'
+             do iq=1,nqmx
+               write(*,*)iq,' : ',trim(tnom(iq))
+             enddo
+             write(*,*) '(choose between 1 and ',nqmx,')'
+             read(*,*) iq 
+             if ((iq.lt.1).or.(iq.gt.nqmx)) then
+               ! wrong value for iq, go back to menu
+               write(*,*) "wrong input value:",iq
+               cycle
+             endif
+             ! look for input file 'profile_tracer'
+             txt="profile_"//trim(tnom(iq))
+             open(41,file=trim(txt),status='old',form='formatted',
+     &            iostat=ierr)
+             if (ierr.eq.0) then
+               ! OK, found file 'profile_...', load the profile
+               do l=1,llm+1
+                 read(41,*,iostat=ierr) profile(l)
+                 if (ierr.ne.0) then ! something went wrong
+                   exit ! quit loop
+                 endif
+               enddo
+               if (ierr.eq.0) then
+                 ! initialize tracer values
+                 qsurf(:,iq)=profile(1)
+                 do l=1,llm
+                   q(:,:,l,iq)=profile(l+1)
+                 enddo
+                 write(*,*)'OK, tracer ',trim(tnom(iq)),' initialized ',
+     &                     'using values from file ',trim(txt)
+               else
+                 write(*,*)'problem reading file ',trim(txt),' !'
+                 write(*,*)'No modifications to tracer ',trim(tnom(iq))
+               endif
+             else
+               write(*,*)'Could not find file ',trim(txt),' !'
+               write(*,*)'No modifications to tracer ',trim(tnom(iq))
+             endif
+             
 
 c       ini_q : Initialize tracers for chemistry
