Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 462)
+++ /trunk/LMDZ.MARS/README	(revision 463)
@@ -1325,2 +1325,8 @@
                                 (default is "jmars.20111014")
 
+
+== 09/12/2011 == EM
+>> more updates for photochemistry from FL: improved aeronomars/surfacearea.F ,
+  with a change in arguments.
+
+
Index: /trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F
===================================================================
--- /trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F	(revision 462)
+++ /trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F	(revision 463)
@@ -1,4 +1,6 @@
-      subroutine surfacearea(ngrid, nlay, pplay, pzlay, pt, pq, nq,
-     $                       rdust, rice, tau, tauscaling,
+      subroutine surfacearea(ngrid, nlay, ptimestep,
+     $                       pplay, pzlay, 
+     $                       pt, pq, pdq, nq, rdust, rice, tau, 
+     $                       tauscaling,
      $                       surfdust, surfice)
 
@@ -10,5 +12,5 @@
 !
 !     Franck Lefevre
-!     version 1.0 november 2011
+!     version 1.1 november 2011
 !==========================================================================
 
@@ -24,19 +26,21 @@
 ! input
 
-      integer ngrid, nlay
-      integer nq                   ! number of tracers
-      real pplay(ngrid,nlay)       ! pressure at mid-layers (Pa)
-      real pzlay(ngrid,nlay)       ! altitude at mid-layers (m)
-      real pt(ngrid,nlay)          ! temperature at mid-layers (K)
-      real pq(ngrid,nlay,nq)       ! tracers (kg/kg)
-      real rdust(ngrid,nlay)       ! dust geometric mean radius (m)
-      real rice(ngrid,nlay)        ! ice mass mean radius (m)
-      real tau(ngrid,naerkind)     ! column dust optical depth at each point
-      real tauscaling(ngrid)       ! conversion factor for dust amount
+      integer,intent(in) :: ngrid, nlay
+      integer,intent(in) :: nq               ! number of tracers
+      real,intent(in) :: ptimestep           ! physics time step (s)
+      real,intent(in) :: pplay(ngrid,nlay)   ! pressure at mid-layers (Pa)
+      real,intent(in) :: pzlay(ngrid,nlay)   ! altitude at mid-layers (m)
+      real,intent(in) :: pt(ngrid,nlay)      ! temperature at mid-layers (K)
+      real,intent(in) :: pq(ngrid,nlay,nq)   ! tracers (kg/kg)
+      real,intent(in) :: pdq(ngrid,nlay,nq)  ! physical tendency (kg/kg.s-1)
+      real,intent(in) :: rdust(ngrid,nlay)   ! dust geometric mean radius (m)
+      real,intent(in) :: rice(ngrid,nlay)    ! ice mass mean radius (m)
+      real,intent(in) :: tau(ngrid,naerkind) ! column dust optical depth at each point
+      real,intent(in) :: tauscaling(ngrid)   ! conversion factor for dust amount
 
 ! output
 
-      real surfdust(ngrid,nlay)    ! dust surface area (m2/m3)
-      real surfice(ngrid,nlay)     ! water-ice surface area (m2/m3)
+      real,intent(out) :: surfdust(ngrid,nlay) ! dust surface area (m2/m3)
+      real,intent(out) :: surfice(ngrid,nlay)  ! water-ice surface area (m2/m3)
 
 ! local
@@ -44,4 +48,6 @@
       integer l, ig
       real rho                     ! density (kg/m3)
+      real dustnd                  ! uodated dust number density (kg/kg)
+      real icend                   ! uodated ice number density (kg/kg)
       real ccntyp                  ! typical dust number density (#/kg)
                                    ! (microphys = false)
@@ -54,18 +60,28 @@
          do l = 1,nlay
             do ig = 1,ngrid
+!              atmospheric density
                rho = pplay(ig,l)/(rnew(ig,l)*pt(ig,l))
-               surfdust(ig,l) = pq(ig,l,igcm_dust_number)*rho
-     $                          *tauscaling(ig)
+!              updated dust number density
+               dustnd = pq(ig,l,igcm_dust_number)
+     $                + pdq(ig,l,igcm_dust_number)*ptimestep
+!              updated ice number density
+               icend  = pq(ig,l,igcm_ccn_number)
+     $                + pdq(ig,l,igcm_ccn_number)*ptimestep
+!              dust surface area
+               surfdust(ig,l) = dustnd*rho*tauscaling(ig)
      $                          *4.*pi*rdust(ig,l)**2
-               surfice(ig,l)  = pq(ig,l,igcm_ccn_number)*rho
-     $                          *tauscaling(ig)
+!              ice surface area
+               surfice(ig,l)  = icend*rho*tauscaling(ig)
      $                          *4.*pi*rice(ig,l)**2
             end do
          end do
-      else            ! simpleclouds
+      else               ! simpleclouds
          do l = 1,nlay
             do ig = 1,ngrid
+!              atmospheric density
                rho = pplay(ig,l)/(rnew(ig,l)*pt(ig,l))
+!              typical dust radius
                rdusttyp = max(.8e-6*exp(-pzlay(ig,l)/18000.),1.e-9)
+!              typical dust number density
                ccntyp = 1.3e+8*max(tau(ig,1),0.001)/0.1
      $                  *exp(-pzlay(ig,l)/10000.)
Index: /trunk/LMDZ.MARS/libf/phymars/physiq.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 462)
+++ /trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 463)
@@ -308,5 +308,5 @@
       real rho(ngridmx,nlayermx)  ! density
       real vmr(ngridmx,nlayermx)  ! volume mixing ratio
-      !real colden(ngridmx,nqmx)   ! vertical column                      !FL
+      REAL colden(ngridmx,nqmx)   ! vertical column of tracers
       REAL mtot(ngridmx)          ! Total mass of water vapor (kg/m2)
       REAL icetot(ngridmx)        ! Total mass of water ice (kg/m2)
@@ -1088,5 +1088,6 @@
 
 !           dust and ice surface area
-            call surfacearea(ngrid, nlayer, pplay, zzlay, pt, pq, nq, 
+            call surfacearea(ngrid, nlayer, ptimestep, pplay, zzlay, 
+     $                       pt, pq, pdq, nq, 
      $                       rdust, rice, tau, tauscaling, 
      $                       surfdust, surfice)
@@ -1487,28 +1488,35 @@
              if (thermochem.or.photochem) then
                 do iq=1,nq
-                   if ((noms(iq).eq."o").or.(noms(iq).eq."co2").or.
-     .                (noms(iq).eq."co").or.(noms(iq).eq."n2").or.
-     .                (noms(iq).eq."h2").or.
-     .                (noms(iq).eq."o3")) then
-                        do l=1,nlayer
-                          do ig=1,ngrid
-                            vmr(ig,l)=zq(ig,l,iq)*mmean(ig,l)/mmol(iq)
-                          end do
-                        end do
-                        call wstats(ngrid,"vmr_"//trim(noms(iq)),
-     .                     "Volume mixing ratio","mol/mol",3,vmr)
-                   endif
-!                   do ig = 1,ngrid
-!                      colden(ig,iq) = 0.                             !FL
-!                   end do
-!                   do l=1,nlayer                                     !FL
-!                      do ig=1,ngrid                                  !FL
-!                         colden(ig,iq) = colden(ig,iq) + zq(ig,l,iq) !FL
-!     $                                  *(pplev(ig,l)-pplev(ig,l+1)) !FL
-!     $                                  *6.022e22/(mmol(iq)*g)       !FL
-!                      end do                                         !FL
-!                   end do                                            !FL
-!                   call wstats(ngrid,"c_"//trim(noms(iq)),           !FL
-!     $                         "column","mol cm-2",2,colden(1,iq))   !FL
+                   if (noms(iq) .ne. "dust_mass" .and.
+     $                 noms(iq) .ne. "dust_number" .and.
+     $                 noms(iq) .ne. "ccn_mass" .and.
+     $                 noms(iq) .ne. "ccn_number") then
+                   do l=1,nlayer
+                      do ig=1,ngrid
+                         vmr(ig,l)=zq(ig,l,iq)*mmean(ig,l)/mmol(iq)
+                      end do
+                   end do
+                   call wstats(ngrid,"vmr_"//trim(noms(iq)),
+     $                         "Volume mixing ratio","mol/mol",3,vmr)
+                   if ((noms(iq).eq."o") .or. (noms(iq).eq."co2").or.
+     $                 (noms(iq).eq."o3")) then                     
+                      call writediagfi(ngrid,"vmr_"//trim(noms(iq)), 
+     $                         "Volume mixing ratio","mol/mol",3,vmr)
+                   end if
+                   do ig = 1,ngrid
+                      colden(ig,iq) = 0.                           
+                   end do
+                   do l=1,nlayer                                    
+                      do ig=1,ngrid                                  
+                         colden(ig,iq) = colden(ig,iq) + zq(ig,l,iq)
+     $                                  *(pplev(ig,l)-pplev(ig,l+1)) 
+     $                                  *6.022e22/(mmol(iq)*g)       
+                      end do                                        
+                   end do                                          
+                   call wstats(ngrid,"c_"//trim(noms(iq)),           
+     $                         "column","mol cm-2",2,colden(1,iq))  
+                   call writediagfi(ngrid,"c_"//trim(noms(iq)),  
+     $                             "column","mol cm-2",2,colden(1,iq))
+                   end if
                 end do
              end if ! of if (thermochem.or.photochem)
@@ -1635,13 +1643,4 @@
          call WRITEDIAGFI(ngrid,"co2col","CO2 column","kg.m-2",2,
      &                  co2col)
-!!!!! FL
-!            do iq = 1,nq
-!               if (noms(iq) .ne. "dust_mass" .and.
-!     $             noms(iq) .ne. "dust_number") then
-!               call writediagfi(ngrid,"c_"//trim(noms(iq)),         
-!     $                         "column","mol cm-2",2,colden(1,iq))
-!               end if
-!            end do
-!!!!! FL
          endif ! of if (tracer.and.(igcm_co2.ne.0))
 
