Index: trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/lect_start_archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/lect_start_archive.F	(revision 2825)
+++ trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/lect_start_archive.F	(revision 2828)
@@ -1,5 +1,5 @@
       SUBROUTINE lect_start_archive(ngrid,nlayer,nqtot,
      &     date,tsurf,tsoil,albedo,emis,q2,
-     &     t,ucov,vcov,ps,co2ice,h,phisold_newgrid,
+     &     t,ucov,vcov,ps,h,phisold_newgrid,
      &     q,qsurf,tauscaling,totcloudfrac,surfith,nid,
      &     watercap)
@@ -46,5 +46,4 @@
       REAL,INTENT(OUT) :: tsurf(ngrid) ! surface temperature
       REAL,INTENT(OUT) :: tsoil(ngrid,nsoilmx) ! soil temperature
-      REAL,INTENT(OUT) :: co2ice(ngrid) ! CO2 ice layer
       REAL,INTENT(OUT) :: albedo(ngrid,2) ! surface albedo
       REAL,INTENT(OUT) :: emis(ngrid) ! ground emissivity
@@ -193,4 +192,5 @@
       logical :: oldtracernames=.false.
       integer :: counter
+      integer :: igcm_co2
       character(len=30) :: txt ! to store some text
       real :: tmpval ! to store a temporary variable/value
@@ -702,7 +702,7 @@
       count=(/imold+1,jmold+1,1,0/)
        
-      ierr = NF_INQ_VARID (nid, "co2ice", nvarid)
-      IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: <co2ice> is missing"
+      ierr = NF_INQ_VARID (nid, "co2", nvarid)
+      IF (ierr .NE. NF_NOERR) THEN
+         PRINT*, "lect_start_archive: <co2> is missing"
          CALL abort
       ENDIF
@@ -713,5 +713,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Failed loading <co2ice>"
+         PRINT*, "lect_start_archive: Failed loading <co2>"
          PRINT*, NF_STRERROR(ierr)
          CALL abort
@@ -875,4 +875,7 @@
             write(*,*) 'lect_start_archive: loading surface tracer',
      &                     ' h2o_ice instead of h2o_vap'
+          endif
+          if(txt.eq."co2_surf") then
+            igcm_co2=iq
           endif
         ENDIF ! of IF (oldtracernames)
@@ -1466,5 +1469,5 @@
       enddo
       
-      call gr_dyn_fi (1,iim+1,jjm+1,ngrid,co2ices,co2ice)
+      call gr_dyn_fi (1,iim+1,jjm+1,ngrid,co2ices,qsurf(:,igcm_co2))
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F
===================================================================
--- trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F	(revision 2825)
+++ trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F	(revision 2828)
@@ -29,5 +29,5 @@
       use surfdat_h, only: phisfi, z0, zmea, zstd, zsig, zgam, zthe,
      &                     albedodat, z0_default, qsurf, tsurf,
-     &                     co2ice, emis, hmons, summit, base, watercap
+     &                     emis, hmons, summit, base, watercap
       use comsoil_h, only: inertiedat, layer, mlayer, nsoilmx, tsoil
       use control_mod, only: day_step, iphysiq, anneeref, planet_type
@@ -420,5 +420,5 @@
         CALL lect_start_archive(ngridmx,llm,nqtot,
      &   date,tsurf,tsoil,albedo,emis,q2,
-     &   t,ucov,vcov,ps,co2ice,teta,phisold_newgrid,q,qsurf,
+     &   t,ucov,vcov,ps,teta,phisold_newgrid,q,qsurf,
      &   tauscaling,totcloudfrac,surfith,nid,watercap)
         write(*,*) "OK, read start_archive file"
@@ -442,5 +442,5 @@
         CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,ngridmx,llm,nqtot,
      &        day_ini,time,tsurf,tsoil,albedo,emis,
-     &        q2,qsurf,co2ice,tauscaling,totcloudfrac,
+     &        q2,qsurf,tauscaling,totcloudfrac,
      &        wstar,watercap)
         
@@ -525,5 +525,6 @@
       write(*,*) 'isotherm     : Isothermal Temperatures, wind set to
      $ zero'
-      write(*,*) 'co2ice=0     : remove CO2 polar cap'
+      write(*,*) 'co2ice=0     : remove CO2 polar cap i.e. 
+     $ qsurf(co2)=0 '
       write(*,*) 'ptot         : change total pressure'
       write(*,*) 'therm_ini_s  : set soil thermal inertia to reference
@@ -688,5 +689,5 @@
                 patm = patm + ps(i,j)*aire(i,j)
                 airetot= airetot + aire(i,j)
-                pcap = pcap + aire(i,j)*co2ice(ig)*g
+                pcap = pcap + aire(i,j)*qsurf(ig,igcm_co2)*g
              ENDDO
           ENDDO
@@ -1322,5 +1323,5 @@
         else if (trim(modif) .eq. 'co2ice=0') then
            do ig=1,ngridmx
-              co2ice(ig)=0
+              qsurf(ig,igcm_co2)=0
               emis(ig)=emis(ngridmx/2)
            end do
@@ -1789,5 +1790,5 @@
       call physdem1("restartfi.nc",nsoilmx,ngridmx,llm,nqtot,
      &              dtphys,hour_ini,
-     &              tsurf,tsoil,co2ice,albedo,emis,q2,qsurf,tauscaling,
+     &              tsurf,tsoil,albedo,emis,q2,qsurf,tauscaling,
      &              totcloudfrac,wstar,watercap)
 
Index: trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F	(revision 2825)
+++ trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F	(revision 2828)
@@ -63,5 +63,4 @@
       REAL tsurf(ngridmx)        ! Surface temperature
       REAL tsoil(ngridmx,nsoilmx) ! Soil temperature
-      REAL co2ice(ngridmx)        ! CO2 ice layer
       REAL watercap(ngridmx)        ! h2o ice layer
       REAL tauscaling(ngridmx) ! dust conversion factor
@@ -82,5 +81,4 @@
       REAL tsoilS(ip1jmp1,nsoilmx)
       REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia
-      REAL co2iceS(ip1jmp1)
       REAL watercapS(ip1jmp1)
       REAL tauscalingS(ip1jmp1)
@@ -111,4 +109,5 @@
       character*80      fichnom
       integer :: ierr,ntime
+      integer :: igcm_co2
       integer :: nq,numvanle
       character(len=30) :: txt ! to store some text
@@ -163,5 +162,5 @@
 
       CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,ngridmx,llm,nqtot,
-     &      day_ini_fi,timefi,tsurf,tsoil,albedo,emis,q2,qsurf,co2ice,
+     &      day_ini_fi,timefi,tsurf,tsoil,albedo,emis,q2,qsurf,
      &      tauscaling,totcloudfrac,wstar,watercap)
 
@@ -246,5 +245,4 @@
 c
 c tsurf --> tsurfS
-c co2ice --> co2iceS
 c watercap --> watercapS
 c tsoil --> tsoilS
@@ -260,5 +258,4 @@
 
       call gr_fi_dyn(1,ngridmx,iip1,jjp1,tsurf,tsurfS)
-      call gr_fi_dyn(1,ngridmx,iip1,jjp1,co2ice,co2iceS)
       call gr_fi_dyn(1,ngridmx,iip1,jjp1,watercap,watercapS)
       call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,tsoil,tsoilS)
@@ -276,4 +273,10 @@
 c=======================================================================
 
+      DO iq=1,nqtot
+        if (trim(tname(iq)) .eq. "co2") then
+           igcm_co2=iq
+        endif
+      enddo
+
       ptotal =  0.
       co2icetotal = 0.
@@ -282,5 +285,5 @@
            ptotal=ptotal+aire(i+(iim+1)*(j-1))*ps(i+(iim+1)*(j-1))/g
            co2icetotal = co2icetotal + 
-     &            co2iceS(i+(iim+1)*(j-1))*aire(i+(iim+1)*(j-1))
+     &            qsurfS(i+(iim+1)*(j-1),igcm_co2)*aire(i+(iim+1)*(j-1))
          ENDDO
       ENDDO
@@ -357,6 +360,4 @@
 c-----------------------------------------------------------------------
 
-      call write_archive(nid,ntime,'co2ice','couche de glace co2',
-     &  'kg/m2',2,co2iceS)
       call write_archive(nid,ntime,'watercap','couche de glace h2o',
      &  'kg/m2',2,watercapS)
Index: trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive_SSO.F
===================================================================
--- trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive_SSO.F	(revision 2825)
+++ trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive_SSO.F	(revision 2828)
@@ -66,5 +66,4 @@
       REAL tsurf(ngridmx)        ! Surface temperature
       REAL tsoil(ngridmx,nsoilmx) ! Soil temperature
-      REAL co2ice(ngridmx)        ! CO2 ice layer
       REAL watercap(ngridmx)        ! h2o ice layer
       REAL tauscaling(ngridmx) ! dust conversion factor
@@ -88,5 +87,4 @@
       REAL tsoilS(ip1jmp1,nsoilmx)
       REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia
-      REAL co2iceS(ip1jmp1)
       REAL watercapS(ip1jmp1)
       REAL tauscalingS(ip1jmp1)
@@ -128,4 +126,5 @@
       character*80      fichnom
       integer :: ierr,ntime
+      integer :: igcm_co2
       integer :: nq,numvanle
       character(len=30) :: txt ! to store some text
@@ -180,5 +179,5 @@
 
       CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,ngridmx,llm,nqtot,
-     &      day_ini_fi,timefi,tsurf,tsoil,albedo,emis,q2,qsurf,co2ice,
+     &      day_ini_fi,timefi,tsurf,tsoil,albedo,emis,q2,qsurf,
      &      tauscaling,totcloudfrac,wstar,watercap)
 
@@ -263,5 +262,4 @@
 c
 c tsurf --> tsurfS
-c co2ice --> co2iceS
 c tsoil --> tsoilS
 c emis --> emisS
@@ -274,5 +272,4 @@
 
       call gr_fi_dyn(1,ngridmx,iip1,jjp1,tsurf,tsurfS)
-      call gr_fi_dyn(1,ngridmx,iip1,jjp1,co2ice,co2iceS)
       call gr_fi_dyn(1,ngridmx,iip1,jjp1,watercap,watercapS)
       call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,tsoil,tsoilS)
@@ -301,4 +298,10 @@
 c=======================================================================
 
+      DO iq=1,nqtot
+        if (trim(tname(iq)) .eq. "co2") then
+           igcm_co2=iq
+        endif
+      enddo
+
       ptotal =  0.
       co2icetotal = 0.
@@ -307,5 +310,5 @@
            ptotal=ptotal+aire(i+(iim+1)*(j-1))*ps(i+(iim+1)*(j-1))/g
            co2icetotal = co2icetotal + 
-     &            co2iceS(i+(iim+1)*(j-1))*aire(i+(iim+1)*(j-1))
+     &            qsurfS(i+(iim+1)*(j-1),igcm_co2)*aire(i+(iim+1)*(j-1))
          ENDDO
       ENDDO
@@ -382,6 +385,4 @@
 c-----------------------------------------------------------------------
 
-      call write_archive(nid,ntime,'co2ice','couche de glace co2',
-     &  'kg/m2',2,co2iceS)
       call write_archive(nid,ntime,'watercap','couche de glace h2o',
      &  'kg/m2',2,watercapS)
