Index: trunk/LMDZ.MARS/libf/phymars/aeropacity.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/aeropacity.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/aeropacity.F	(revision 1266)
@@ -56,10 +56,5 @@
 c
 c=======================================================================
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "comgeomfi.h"
-!#include "dimradmars.h"
-!#include "tracer.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F	(revision 1266)
@@ -28,7 +28,5 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
 #include "callkeys.h"
-!#include "dimradmars.h"
 
 c     Local variables 
Index: trunk/LMDZ.MARS/libf/phymars/albedocaps.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/albedocaps.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/albedocaps.F90	(revision 1266)
@@ -13,10 +13,5 @@
 
 #include"dimensions.h"
-#include"dimphys.h"
-!#include"surfdat.h"
 #include"callkeys.h"
-!#ifdef MESOSCALE
-!#include"comgeomfi.h"
-!#endif
 
 ! arguments:
@@ -100,7 +95,4 @@
 implicit none
 #include"dimensions.h"
-#include"dimphys.h"
-!#include"surfdat.h"
-!#include"comgeomfi.h"
 #include"datafile.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/blendrad.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/blendrad.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/blendrad.F	(revision 1266)
@@ -15,9 +15,5 @@
       use yomlw_h, only: nlaylte
       implicit none
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "nlteparams.h"
-!#include "yomlw.h"
 
 c     Input:
Index: trunk/LMDZ.MARS/libf/phymars/calldrag_noro.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/calldrag_noro.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/calldrag_noro.F	(revision 1266)
@@ -55,8 +55,4 @@
 c    ------------------
 c
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
-!#include "surfdat.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/callradite.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/callradite.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/callradite.F	(revision 1266)
@@ -82,5 +82,5 @@
 c   over layers 1..NFLEV (set in dimradmars_mod).  Returns zero for higher
 c   layers, if any.
-c   In other routines, nlayermx -> nflev.
+c   In other routines, nlayer -> nflev.
 c   Routines affected: lwflux, lwi, lwmain, lwxb, lwxd, lwxn.
 c
@@ -151,9 +151,5 @@
 c    -------------
 c
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "callkeys.h"
-!#include "yomlw.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/callsedim.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/callsedim.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/callsedim.F	(revision 1266)
@@ -30,7 +30,4 @@
 c   -------------
       
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "tracer.h"
 #include "callkeys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/co2snow.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/co2snow.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/co2snow.F	(revision 1266)
@@ -18,6 +18,4 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "surfdat.h"
 #include "callkeys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/conf_phys.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1266)
@@ -46,15 +46,7 @@
       IMPLICIT NONE
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "comsaison.h"
-!#include "comdiurn.h"
-!#include "comgeomfi.h"
 #include "callkeys.h"
-!#include "surfdat.h"
-!#include "dimradmars.h"
 #include "datafile.h"
-!#include "slope.h"
 #include "microphys.h"
-!#include "tracer.h"
 
       INTEGER,INTENT(IN) :: ngrid,nlayer,nq
Index: trunk/LMDZ.MARS/libf/phymars/convadj.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/convadj.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/convadj.F	(revision 1266)
@@ -32,8 +32,5 @@
 !     ------------
 
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "tracer.h"
 
 
Index: trunk/LMDZ.MARS/libf/phymars/dimphys.h
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dimphys.h	(revision 1264)
+++ 	(revision )
@@ -1,13 +1,0 @@
-!-----------------------------------------------------------------------
-!   INCLUDE 'dimphys.h'
-
-!!! -- no longer used. just kept for reference
-!!! ngridmx : number of horizontal grid points
-!!! note: the -1/jjm term will be 0; unless jj=1
-!!!      integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm)   
-! nlayermx : number of atmospheric layers
-      integer, parameter :: nlayermx = llm 
-! nsoilmx : number of subterranean layers
-!EM: old soil routine:      integer, parameter :: nsoilmx = 10
-!      integer, parameter :: nsoilmx = 18 ! nsoilmx is now in comsoil_h
-!-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/dimradmars_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dimradmars_mod.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/dimradmars_mod.F90	(revision 1266)
@@ -8,5 +8,5 @@
   ! NDLO2 and ndomainsz for the splitting in the physics call
   ! WARNING:  One must have  1 < ndomainsz =< ngrid
-  integer,save :: NFLEV !=nlayermx   ! with splitting
+  integer,save :: NFLEV !=nlayer   ! with splitting
   integer,save :: ndomainsz !=(ngrid-1)/20 + 1
   integer,save :: NDLON !=ndomainsz  ! with splitting
Index: trunk/LMDZ.MARS/libf/phymars/drag_noro.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/drag_noro.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/drag_noro.F	(revision 1266)
@@ -48,5 +48,4 @@
 C
 C     comcstfi.h
-C     dimphys.h
 C
 c
@@ -71,7 +70,4 @@
 c d_v-----output-R-increment de la vitesse v
 c======================================================================
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 c
 c ARGUMENTS
Index: trunk/LMDZ.MARS/libf/phymars/dustdevil.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dustdevil.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/dustdevil.F	(revision 1266)
@@ -30,10 +30,4 @@
 c   -------------
 
-!#include "dimensions.h"
-!#include "dimphys.h"
-c#include "comconst.h"        ! TEMPORAIRE AVEC ANLDEVIL !!!!
-!#include "surfdat.h"
-!#include "comgeomfi.h"
-!#include "tracer.h"
 c   arguments:
 c   ----------
Index: trunk/LMDZ.MARS/libf/phymars/dustlift.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/dustlift.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/dustlift.F	(revision 1266)
@@ -24,8 +24,4 @@
 c   declarations:
 c   -------------
-
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "tracer.h"
 
 c
Index: trunk/LMDZ.MARS/libf/phymars/eofdump_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/eofdump_mod.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/eofdump_mod.F90	(revision 1266)
@@ -22,5 +22,4 @@
 !
 #include "dimensions.h"
-!#include "dimphys.h"
 !
 
@@ -86,7 +85,5 @@
 !
 #include "dimensions.h"
-!#include "dimphys.h"
 #include "comvert.h"
-!#include "comgeomfi.h"
 
       integer,intent(in) :: ngrid ! total number of physics grid points
Index: trunk/LMDZ.MARS/libf/phymars/flusv.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/flusv.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/flusv.F	(revision 1266)
@@ -1,4 +1,4 @@
       SUBROUTINE flusv(KDLON,nsf,n,omega,g,tau,emis,bh,bsol,fah,fdh)
-      use dimradmars_mod, only: ndlo2, ndlon
+      use dimradmars_mod, only: ndlo2, ndlon, nflev
       IMPLICIT NONE
 c.......................................................................
@@ -37,6 +37,4 @@
 c 
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "dimradmars.h"
 c.......................................................................
 c  declaration des arguments 
@@ -52,16 +50,16 @@
       INTEGER iv,i,j
       REAL beta,gama1,gama2,amu1,grgama,b0,b1
-      REAL a(NDLON,4*nlayermx),b(NDLON,4*nlayermx)
-     &    ,d(NDLON,4*nlayermx),e(NDLON,4*nlayermx)
-     &    ,y(NDLON,4*nlayermx)
-     &    ,alambda(NDLON,2*nlayermx)
-     &    ,e1(NDLON,2*nlayermx),e2(NDLON,2*nlayermx)
-     &    ,e3(NDLON,2*nlayermx),e4(NDLON,2*nlayermx)
-     &    ,cah(NDLON,2*nlayermx),cab(NDLON,2*nlayermx)
-     &    ,cdh(NDLON,2*nlayermx),cdb(NDLON,2*nlayermx)
-      REAL grg(NDLON,2*nlayermx),grh(NDLON,2*nlayermx)
-     &    ,grj(NDLON,2*nlayermx),grk(NDLON,2*nlayermx)
-     &    ,alpha1(NDLON,2*nlayermx),alpha2(NDLON,2*nlayermx)
-     &    ,sigma1(NDLON,2*nlayermx),sigma2(NDLON,2*nlayermx)
+      REAL a(NDLON,4*nflev),b(NDLON,4*nflev)
+     &    ,d(NDLON,4*nflev),e(NDLON,4*nflev)
+     &    ,y(NDLON,4*nflev)
+     &    ,alambda(NDLON,2*nflev)
+     &    ,e1(NDLON,2*nflev),e2(NDLON,2*nflev)
+     &    ,e3(NDLON,2*nflev),e4(NDLON,2*nflev)
+     &    ,cah(NDLON,2*nflev),cab(NDLON,2*nflev)
+     &    ,cdh(NDLON,2*nflev),cdb(NDLON,2*nflev)
+      REAL grg(NDLON,2*nflev),grh(NDLON,2*nflev)
+     &    ,grj(NDLON,2*nflev),grk(NDLON,2*nflev)
+     &    ,alpha1(NDLON,2*nflev),alpha2(NDLON,2*nflev)
+     &    ,sigma1(NDLON,2*nflev),sigma2(NDLON,2*nflev)
       INTEGER nq
       PARAMETER (nq=8)
@@ -272,5 +270,5 @@
 
       SUBROUTINE sys3v(KDLON,n,a,b,d,e,y)
-      use dimradmars_mod, only: ndlon, ndlo2
+      use dimradmars_mod, only: ndlon, ndlo2, nflev
       IMPLICIT NONE
 c.......................................................................
@@ -291,10 +289,4 @@
 c
 c.......................................................................
-c  include des dimensions locales
-c 
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "dimradmars.h"
-c.......................................................................
 c  declaration des arguments 
 c
@@ -305,6 +297,6 @@
 c 
       INTEGER iv,i
-      REAL as(NDLON,4*nlayermx),ds(NDLON,4*nlayermx)
-     &    ,x(NDLON,4*nlayermx)
+      REAL as(NDLON,4*nflev),ds(NDLON,4*nflev)
+     &    ,x(NDLON,4*nflev)
 c.......................................................................
 c
Index: trunk/LMDZ.MARS/libf/phymars/getslopes.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/getslopes.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/getslopes.F90	(revision 1266)
@@ -7,8 +7,4 @@
 
 #include "dimensions.h"
-!#include "dimphys.h"
-!#include "slope.h"
-!#include "comgeomfi.h"
-
 
 ! This routine computes slope inclination and orientation for the GCM (callslope=.true. in callphys.def)
Index: trunk/LMDZ.MARS/libf/phymars/growthrate.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/growthrate.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/growthrate.F	(revision 1266)
@@ -20,7 +20,4 @@
 c   -------------
 
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
 #include "microphys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/gwprofil.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/gwprofil.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/gwprofil.F	(revision 1266)
@@ -58,7 +58,4 @@
 C
 
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "dimradmars.h"
       integer klon,klev,kidia,kfdia
 #include "yoegwd.h"
@@ -91,6 +88,6 @@
 
       integer ji,jk,jl,ilevh
-      REAL ZDZ2 (NDLO2,nlayermx) , ZNORM(NDLO2) , zoro(NDLO2)
-      REAL ZTAU (NDLO2,nlayermx+1)
+      REAL ZDZ2 (NDLO2,klev) , ZNORM(NDLO2) , zoro(NDLO2)
+      REAL ZTAU (NDLO2,klev+1)
 C
 C-----------------------------------------------------------------------
@@ -182,5 +179,5 @@
 c     write(*,*) 'ptau'
 c     write(*,99) ((ji,ilevh,ptau(ji,ilevh),ji=1,NDLO2),
-c    .                  ilevh=1,nlayermx+1)
+c    .                  ilevh=1,klev+1)
  99   FORMAT(i3,i3,f15.5)
 
Index: trunk/LMDZ.MARS/libf/phymars/gwstress.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/gwstress.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/gwstress.F	(revision 1266)
@@ -48,6 +48,4 @@
       implicit none
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "dimradmars.h"
       integer klon,klev,kidia,kfdia
 
Index: trunk/LMDZ.MARS/libf/phymars/improvedclouds.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/improvedclouds.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/improvedclouds.F	(revision 1266)
@@ -35,12 +35,6 @@
 c           A. Spiga, optimization (February 2012)
 c------------------------------------------------------------------
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "tracer.h"
-!#include "comgeomfi.h"
-!#include "dimradmars.h"
 #include "microphys.h"
-!#include "conc.h"
 c------------------------------------------------------------------
 c     Inputs:
Index: trunk/LMDZ.MARS/libf/phymars/ini_archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/ini_archive.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/ini_archive.F	(revision 1266)
@@ -38,5 +38,4 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
 #include "paramet.h"
 #include "comconst.h"
@@ -48,7 +47,4 @@
 #include "description.h"
 #include "serre.h"
-!#include "control.h"
-!#include"comsoil.h"
-
 #include "netcdf.inc"
 
Index: trunk/LMDZ.MARS/libf/phymars/initracer.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/initracer.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/initracer.F	(revision 1266)
@@ -27,12 +27,5 @@
 
 
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "tracer.h"
-!#include "advtrac.h"
-!#include "comgeomfi.h"
-
-!#include "surfdat.h"
 
       integer,intent(in) :: ngrid ! number of atmospheric columns
Index: trunk/LMDZ.MARS/libf/phymars/iniwrite.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/iniwrite.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/iniwrite.F	(revision 1266)
@@ -23,5 +23,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-!include "comconst.h"
 #include "comvert.h"
 #include "comgeom.h"
@@ -32,6 +31,4 @@
 #include "description.h"
 #include "serre.h"
-!#include"dimphys.h"
-!#include"comsoil.h"
 
 c   Arguments:
Index: trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/iniwritesoil.F90	(revision 1266)
@@ -11,8 +11,6 @@
 
 #include"dimensions.h"
-!#include"dimphys.h"
 #include"paramet.h"
 #include"comgeom.h"
-!#include"comsoil.h"
 #include"netcdf.inc"
 
@@ -51,5 +49,5 @@
 endif
 ierr=NF_DEF_DIM(nid,"depth",nsoilmx,idim_depth)
-! nsoilmx known from dimphys.h
+! nsoilmx known from comsoil_h
 if (ierr.ne.NF_NOERR) then
   write(*,*)"iniwritesoil: Error, could not define depth dimension"
Index: trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F	(revision 1266)
@@ -23,21 +23,13 @@
 
 #include "dimensions.h"
-!#include "dimphys.h"
-!#include "surfdat.h"
-!#include "comsoil.h"
-!#include "dimradmars.h"
 #include "paramet.h"
 #include "comconst.h"
 #include "comvert.h"
 #include "comgeom2.h"
-!#include "control.h"
 #include "logic.h"
 #include "description.h"
 #include "ener.h"
 #include "temps.h"
-!#include "lmdstd.h"
 #include "netcdf.inc"
-!#include "tracer.h"
-!#include"advtrac.h"
 c=======================================================================
 c   Declarations
@@ -337,5 +329,5 @@
       write(*,*) '    which implies that you want subterranean interpola
      &tion.'
-      write(*,*) '  Otherwise, set nsoilmx -in dimphys.h- to: ',nsoilold
+      write(*,*) '  Otherwise, set nsoilmx -in comsoil_h- to: ',nsoilold
       endif
       write(*,*) "time lenght: ",timelen
Index: trunk/LMDZ.MARS/libf/phymars/lwb.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwb.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwb.F	(revision 1266)
@@ -11,11 +11,4 @@
       implicit none
  
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
-!#include "callkeys.h"
-
-!#include "yomlw.h"
-
 c----------------------------------------------------------------------
 c         0.1   arguments
Index: trunk/LMDZ.MARS/libf/phymars/lwdiff.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwdiff.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwdiff.F	(revision 1266)
@@ -10,10 +10,6 @@
       IMPLICIT NONE
  
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "callkeys.h"
 
-!#include "yomlw.h"
 C-----------------------------------------------------------------------
 C
Index: trunk/LMDZ.MARS/libf/phymars/lwflux.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwflux.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwflux.F	(revision 1266)
@@ -15,12 +15,6 @@
       implicit none
  
-
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "callkeys.h"
 #include "comg1d.h"
- 
-!#include "yomlw.h"
 
 c----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/lwi.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwi.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwi.F	(revision 1266)
@@ -9,11 +9,6 @@
       implicit none
 
-
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "comg1d.h"
 #include "callkeys.h"
-!#include "yomlw.h"
  
 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Index: trunk/LMDZ.MARS/libf/phymars/lwmain.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwmain.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwmain.F	(revision 1266)
@@ -17,10 +17,6 @@
       implicit none
  
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "callkeys.h"
 #include "comg1d.h"
-!#include "yomlw.h"
 
 c----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/lwtt.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwtt.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwtt.F	(revision 1266)
@@ -10,9 +10,4 @@
       use yomlw_h, only: ga, gb, cst_voigt
       implicit none
-
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
-!#include "yomlw.h"
 
 c----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/lwu.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwu.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwu.F	(revision 1266)
@@ -37,10 +37,4 @@
       implicit none
 
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
-
-!#include "yomlw.h"
-
 #include "callkeys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/lwxb.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwxb.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwxb.F	(revision 1266)
@@ -36,11 +36,4 @@
       use yomlw_h, only: xi, nlaylte
       implicit none
-
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
-!#include "callkeys.h"
- 
-!#include "yomlw.h"
 
 c----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/lwxd.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwxd.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwxd.F	(revision 1266)
@@ -36,9 +36,4 @@
       implicit none
 
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
- 
-!#include "yomlw.h"
 #include "callkeys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/lwxn.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/lwxn.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/lwxn.F	(revision 1266)
@@ -74,9 +74,4 @@
       implicit none
 
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
- 
-!#include "yomlw.h"
 #include "callkeys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/newcondens.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/newcondens.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/newcondens.F	(revision 1266)
@@ -59,11 +59,6 @@
 c
 #include "dimensions.h"
-!#include "dimphys.h"
-!#include "surfdat.h"
-!#include "comgeomfi.h"
 #include "comvert.h"
-!#include "paramet.h"
 #include "callkeys.h"
-!#include "tracer.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/newsedim.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/newsedim.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/newsedim.F	(revision 1266)
@@ -14,7 +14,4 @@
 c   declarations:
 c   -------------
-
-!#include "dimensions.h"
-!#include "dimphys.h"
 
 c
Index: trunk/LMDZ.MARS/libf/phymars/newstart.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/newstart.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/newstart.F	(revision 1266)
@@ -39,24 +39,16 @@
 #include "dimensions.h"
       integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm) 
-#include "dimphys.h"
-!#include "surfdat.h"
-!#include "comsoil.h"
-!#include "dimradmars.h"
 #include "paramet.h"
 #include "comconst.h"
 #include "comvert.h"
 #include "comgeom2.h"
-!#include "control.h"
 #include "logic.h"
 #include "description.h"
 #include "ener.h"
 #include "temps.h"
-!#include "lmdstd.h"
 #include "comdissnew.h"
 #include "clesph0.h"
 #include "serre.h"
 #include "netcdf.inc"
-!#include"advtrac.h"
-!#include"tracer.h"
 #include "datafile.h"
 c=======================================================================
@@ -105,13 +97,5 @@
 c variable physique
 c------------------
-!      REAL tsurf(ngridmx)	! surface temperature 
-!      REAL tsoil(ngridmx,nsoilmx) ! soil temperature
-!      REAL co2ice(ngridmx)	! CO2 ice layer
-!      REAL emis(ngridmx)	! surface emissivity
-!      REAL tauscaling(ngridmx) ! dust conversion factor
       REAL tauscadyn(iip1,jjp1) ! dust conversion factor on the dynamics grid
-!      REAL,ALLOCATABLE :: qsurf(:,:)
-!      REAL q2(ngridmx,nlayermx+1)
-!      REAL rnaturfi(ngridmx)
       real alb(iip1,jjp1),albfi(ngridmx) ! albedos
       real ith(iip1,jjp1,nsoilmx),ithfi(ngridmx,nsoilmx) ! thermal inertia (3D)
@@ -203,5 +187,4 @@
 ! allocate arrays
       allocate(q(iip1,jjp1,llm,nqtot))
-!      allocate(qsurf(ngridmx,nqtot)) ! done in ini_surfdat_h
       allocate(coefvmr(nqtot))
 
Index: trunk/LMDZ.MARS/libf/phymars/nirco2abs.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nirco2abs.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/nirco2abs.F	(revision 1266)
@@ -47,10 +47,6 @@
 c    ------------------
 c
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "comdiurn.h"
 #include "nirdata.h"
-!#include "tracer.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F	(revision 1266)
@@ -34,9 +34,7 @@
 
       include "dimensions.h"
-      include "dimphys.h"
       include 'nlte_paramdef.h'
       include 'nlte_commons.h'
       include "chimiedata.h"
-!      include "conc.h"
 
 
@@ -1361,11 +1359,10 @@
      @     ( mmean_nlte,cpmean_nlte )         
       USE comcstfi_h
+      use param_v4_h, only: n_avog
       implicit none                           
       
-      include 'param.h'
-      
 c     argumentos                                    
-      real	mmean_nlte,cpmean_nlte
-      real 	hrkday_convert                           
+      real mmean_nlte,cpmean_nlte
+      real hrkday_convert                           
       
 ccccccccccccccccccccccccccccccccccccc
Index: trunk/LMDZ.MARS/libf/phymars/nltecool.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nltecool.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/nltecool.F	(revision 1266)
@@ -36,8 +36,5 @@
 #include "nltedata.h" ! (Equivalent to the reading of the "nlte_escape.dat" file)
 #include "dimensions.h"
-#include "dimphys.h"
 #include "chimiedata.h"
-!#include "conc.h" !Added to have "dynamic composition" in the scheme
-!#include "tracer.h" !"
 #include "callkeys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/nlthermeq.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlthermeq.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/nlthermeq.F	(revision 1266)
@@ -10,9 +10,5 @@
       use yomlw_h, only: nlaylte
       implicit none
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "nlteparams.h"
-!#include "yomlw.h"
 #include "callkeys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/nuclea.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nuclea.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/nuclea.F	(revision 1266)
@@ -16,6 +16,4 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
 #include "microphys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/orodrag.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/orodrag.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/orodrag.F	(revision 1266)
@@ -53,5 +53,4 @@
 C
 C     comcstfi.h
-C     dimphys.h
 C     yoegwd.h
 C
@@ -76,7 +75,4 @@
 C
 C
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "dimradmars.h"
       integer klon,klev,kidia
       parameter(kidia=1)
@@ -123,11 +119,11 @@
       real zconb,zabsv,zzd1,ratio,zust,zvst,zdis,ztemp
 C
-      REAL   ZTAU(NDLO2,nlayermx+1),
-     *       ZSTAB(NDLO2,nlayermx+1),
-     *       ZVPH(NDLO2,nlayermx+1),
-     *       ZRHO(NDLO2,nlayermx+1),
-     *       ZRI(NDLO2,nlayermx+1),
-     *       ZpsI(NDLO2,nlayermx+1),
-     *       Zzdep(NDLO2,nlayermx)
+      REAL   ZTAU(NDLO2,klev+1),
+     *       ZSTAB(NDLO2,klev+1),
+     *       ZVPH(NDLO2,klev+1),
+     *       ZRHO(NDLO2,klev+1),
+     *       ZRI(NDLO2,klev+1),
+     *       ZpsI(NDLO2,klev+1),
+     *       Zzdep(NDLO2,klev)
       REAL   ZDUDT(NDLO2),
      *       ZDVDT(NDLO2),
Index: trunk/LMDZ.MARS/libf/phymars/orosetup.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/orosetup.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/orosetup.F	(revision 1266)
@@ -51,7 +51,4 @@
 C
 
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "dimradmars.h"
       integer klon,klev,kidia,kfdia
 
@@ -83,10 +80,10 @@
 C
 C
-      LOGICAL LL1(NDLO2,nlayermx+1)
+      LOGICAL LL1(NDLO2,klev+1)
       integer kknu(NDLO2),kknu2(NDLO2),kknub(NDLO2),kknul(NDLO2),
      *        kentp(NDLO2),ncount(NDLO2)  
 C
-      REAL ZHCRIT(NDLO2,nlayermx),ZNCRIT(NDLO2,nlayermx),
-     *     ZVPF(NDLO2,nlayermx), ZDP(NDLO2,nlayermx)
+      REAL ZHCRIT(NDLO2,klev),ZNCRIT(NDLO2,klev),
+     *     ZVPF(NDLO2,klev), ZDP(NDLO2,klev)
       REAL ZNORM(NDLO2),zpsi(NDLO2),zb(NDLO2),zc(NDLO2),
      *      zulow(NDLO2),zvlow(NDLO2),znup(NDLO2),znum(NDLO2)
Index: trunk/LMDZ.MARS/libf/phymars/phyetat0.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/phyetat0.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/phyetat0.F90	(revision 1266)
@@ -21,14 +21,4 @@
 !         June 2013 TN : Possibility to read files with a time axis
 !         November 2013 EM : Enabeling parallel, using iostart module
-!======================================================================
-!#include "netcdf.inc"
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "comgeomfi.h"
-!#include "surfdat.h"
-!#include "dimradmars.h"
-!#include "tracer.h"
-!#include "advtrac.h"
-!#include "control.h"
 !======================================================================
   INTEGER nbsrf !Mars nbsrf a 1 au lieu de 4
Index: trunk/LMDZ.MARS/libf/phymars/physiq.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1266)
@@ -34,4 +34,7 @@
      &                     obliquit
       USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad, daysec
+      use param_v4_h, only: nreact,n_avog, 
+     &                      fill_data_thermos, allocate_param_thermos
+      use iono_h, only: allocate_param_iono
 #ifdef MESOSCALE
       use comsoil_h, only: mlayer,layer
@@ -144,26 +147,10 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "comgeomfi.h"
-!#include "surfdat.h"
-!#include "comsoil.h"
-!#include "comdiurn.h"
 #include "callkeys.h"
-!#include "comsaison.h"
-!#include "control.h"
-!#include "dimradmars.h"
 #include "comg1d.h"
-!#include "tracer.h"
 #include "nlteparams.h"
 #include "comvert.h"
-
 #include "chimiedata.h"
-#include "param.h"
-#include "param_v4.h"
-!#include "conc.h"
-
 #include "netcdf.inc"
-
-!#include "slope.h"
 
 c Arguments :
@@ -415,5 +402,5 @@
       PRINT*,'check: tracernames ', noms
       PRINT*,'check: emis ',emis(1),emis(ngrid)
-      PRINT*,'check: q2 ',q2(1,1),q2(ngrid,nlayermx+1)
+      PRINT*,'check: q2 ',q2(1,1),q2(ngrid,nlayer+1)
       PRINT*,'check: qsurf ',qsurf(1,1),qsurf(ngrid,nq)
       PRINT*,'check: co2 ',co2ice(1),co2ice(ngrid)
@@ -463,4 +450,7 @@
 
          if (callthermos) then
+            call fill_data_thermos
+            call allocate_param_thermos(nlayer)
+            call allocate_param_iono(nlayer,nreact)
             if(solvarmod.eq.0) call param_read
             if(solvarmod.eq.1) call param_read_e107
@@ -884,5 +874,5 @@
              zdqdif(1:ngrid,1,igcm_dust_mass) = 
      .                  -zdqsdif(1:ngrid,igcm_dust_mass)
-             zdqdif(1:ngrid,2:nlayermx,1:nq) = 0.
+             zdqdif(1:ngrid,2:nlayer,1:nq) = 0.
              DO iq=1, nq
               IF ((iq .ne. igcm_dust_mass)
Index: trunk/LMDZ.MARS/libf/phymars/read_dust_scenario.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/read_dust_scenario.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/read_dust_scenario.F90	(revision 1266)
@@ -8,6 +8,4 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "comgeomfi.h"
 #include "datafile.h"
 #include "callkeys.h"
Index: trunk/LMDZ.MARS/libf/phymars/simpleclouds.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/simpleclouds.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/simpleclouds.F	(revision 1266)
@@ -31,10 +31,5 @@
 c                            of the typical CCN profile, Oct. 2011)
 c------------------------------------------------------------------
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "tracer.h"
-!#include "comgeomfi.h"
-!#include "dimradmars.h"
 
 c------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/soil.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/soil.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/soil.F	(revision 1266)
@@ -21,10 +21,5 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
-
-!#include"comsoil.h"
-
-!#include"surfdat.h"
-#include"callkeys.h"
+#include "callkeys.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/soil_tifeedback.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/soil_tifeedback.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/soil_tifeedback.F	(revision 1266)
@@ -26,8 +26,4 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
-!#include "comsoil.h"
-!#include "tracer.h"
-!#include "surfdat.h"
 
 c Local variables
Index: trunk/LMDZ.MARS/libf/phymars/start2archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/start2archive.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/start2archive.F	(revision 1266)
@@ -35,11 +35,6 @@
 #include "logic.h"
 #include "temps.h"
-!#include "control.h"
 #include "ener.h"
 #include "description.h"
-
-!#include "dimphys.h"
-!#include "comsoil.h"
-!#include"advtrac.h"
 #include "netcdf.inc"
 
Index: trunk/LMDZ.MARS/libf/phymars/suaer.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 1266)
@@ -45,7 +45,4 @@
 #include "callkeys.h"
 #include "datafile.h"
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"     
 
 ! Optical properties (read in external ASCII files)
Index: trunk/LMDZ.MARS/libf/phymars/surfini.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/surfini.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/surfini.F	(revision 1266)
@@ -23,10 +23,5 @@
 c   -------------
 #include "dimensions.h"
-!#include "dimphys.h"
-!#include "surfdat.h"
 #include "callkeys.h"
-!#include "tracer.h"
-!#include "comgeomfi.h"
-
 #include "datafile.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/swmain.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/swmain.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/swmain.F	(revision 1266)
@@ -10,9 +10,4 @@
       IMPLICIT NONE
       
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
-
-!#include "yomlw.h"
 #include "callkeys.h"
 c     
Index: trunk/LMDZ.MARS/libf/phymars/swr_fouquart.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/swr_fouquart.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/swr_fouquart.F	(revision 1266)
@@ -9,9 +9,5 @@
       IMPLICIT NONE
 C     
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "callkeys.h"
-!#include "yomlw.h"
 
 C     
@@ -382,7 +378,4 @@
       implicit none
 C
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 C
 C**** *DEDD* - DELTA-EDDINGTON IN A CLOUDY LAYER
Index: trunk/LMDZ.MARS/libf/phymars/swr_toon.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/swr_toon.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/swr_toon.F	(revision 1266)
@@ -10,10 +10,5 @@
       IMPLICIT NONE
 C     
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "dimradmars.h"
 #include "callkeys.h"
-!#include "yomaer.h"
-!#include "yomlw.h"
 
 C     
Index: trunk/LMDZ.MARS/libf/phymars/tabfi.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 1266)
@@ -34,5 +34,5 @@
 c                              comparer avec le day_ini dynamique)
 c
-c      - lmax:    tab_cntrl(tab0+2) (pour test avec nlayermx)
+c      - lmax:    tab_cntrl(tab0+2) (pour test avec nlayer)
 c
 c      - p_rad
@@ -54,11 +54,5 @@
       implicit none
  
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "comgeomfi.h"
-!#include "surfdat.h"
-!#include "comsoil.h"
 #include "netcdf.inc"
-!#include "dimradmars.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/testphys1d.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/testphys1d.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/testphys1d.F	(revision 1266)
@@ -41,6 +41,6 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
       integer, parameter :: ngrid = 1 !(2+(jjm-1)*iim - 1/jjm)
+      integer, parameter :: nlayer = llm
 !#include "dimradmars.h"
 !#include "comgeomfi.h"
@@ -72,10 +72,10 @@
       REAL day           ! date durant le run
       REAL time             ! time (0<time<1 ; time=0.5 a midi)
-      REAL play(nlayermx)   ! Pressure at the middle of the layers (Pa)
-      REAL plev(nlayermx+1) ! intermediate pressure levels (pa)
+      REAL play(nlayer)   ! Pressure at the middle of the layers (Pa)
+      REAL plev(nlayer+1) ! intermediate pressure levels (pa)
       REAL psurf,tsurf(1)      
-      REAL u(nlayermx),v(nlayermx)  ! zonal, meridional wind
+      REAL u(nlayer),v(nlayer)  ! zonal, meridional wind
       REAL gru,grv   ! prescribed "geostrophic" background wind
-      REAL temp(nlayermx)   ! temperature at the middle of the layers
+      REAL temp(nlayer)   ! temperature at the middle of the layers
       REAL,ALLOCATABLE :: q(:,:) ! tracer mixing ratio (e.g. kg/kg)
       REAL,ALLOCATABLE :: qsurf(:) ! tracer surface budget (e.g. kg.m-2)
@@ -83,10 +83,10 @@
       REAL co2ice(1)        ! co2ice layer (kg.m-2)
       REAL emis(1)          ! surface layer
-      REAL q2(nlayermx+1)   ! Turbulent Kinetic Energy
-      REAL zlay(nlayermx)   ! altitude estimee dans les couches (km)
+      REAL q2(nlayer+1)   ! Turbulent Kinetic Energy
+      REAL zlay(nlayer)   ! altitude estimee dans les couches (km)
 
 c    Physical and dynamical tandencies (e.g.  m.s-2, K/s, Pa/s)
-      REAL du(nlayermx),dv(nlayermx),dtemp(nlayermx)
-      REAL dudyn(nlayermx),dvdyn(nlayermx),dtempdyn(nlayermx)
+      REAL du(nlayer),dv(nlayer),dtemp(nlayer)
+      REAL dudyn(nlayer),dvdyn(nlayer),dtempdyn(nlayer)
       REAL dpsurf    
       REAL,ALLOCATABLE :: dq(:,:)
@@ -96,10 +96,10 @@
       INTEGER thermo
       REAL zls
-      REAL phi(nlayermx),h(nlayermx),s(nlayermx)
-      REAL pks, ptif, w(nlayermx)
+      REAL phi(nlayer),h(nlayer),s(nlayer)
+      REAL pks, ptif, w(nlayer)
       REAL qtotinit,qtot
       real,allocatable :: mqtot(:)
       INTEGER ierr, aslun
-      REAL tmp1(0:nlayermx),tmp2(0:nlayermx)
+      REAL tmp1(0:nlayer),tmp2(0:nlayer)
       Logical  tracerdyn
       integer :: nq=1 ! number of tracers
@@ -212,8 +212,8 @@
         ! allocate arrays:
         allocate(tname(nq))
-        allocate(q(nlayermx,nq))
+        allocate(q(nlayer,nq))
         allocate(qsurf(nq))
-        allocate(dq(nlayermx,nq))
-        allocate(dqdyn(nlayermx,nq))
+        allocate(dq(nlayer,nq))
+        allocate(dqdyn(nlayer,nq))
         allocate(mqtot(nq))
         
@@ -247,5 +247,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
               enddo
@@ -262,5 +262,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
               enddo
@@ -278,5 +278,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
               enddo
@@ -293,5 +293,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
               enddo
@@ -313,5 +313,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
 !                write(*,*) "l=",ilayer," q(ilayer,iq)=",q(ilayer,iq)
@@ -329,5 +329,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
               enddo
@@ -345,5 +345,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
               enddo
@@ -360,5 +360,5 @@
             if (ierr.eq.0) then
               read(91,*) qsurf(iq)
-              do ilayer=1,nlayermx
+              do ilayer=1,nlayer
                 read(91,*) q(ilayer,iq)
               enddo
@@ -375,8 +375,8 @@
         ! allocate arrays:
         allocate(tname(nq))
-        allocate(q(nlayermx,nq))
+        allocate(q(nlayer,nq))
         allocate(qsurf(nq))
-        allocate(dq(nlayermx,nq))
-        allocate(dqdyn(nlayermx,nq))
+        allocate(dq(nlayer,nq))
+        allocate(dqdyn(nlayer,nq))
         allocate(mqtot(nq))
         do iq=1,nq
@@ -410,5 +410,4 @@
 c  --------------
 c
-      nlayer=nlayermx
       nlevel=nlayer+1
       nsoil=nsoilmx
Index: trunk/LMDZ.MARS/libf/phymars/updaterad.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/updaterad.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/updaterad.F90	(revision 1266)
@@ -65,8 +65,4 @@
 USE comcstfi_h
 implicit none
-
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
 
 real, intent(in)  :: qice,qccn,nccn
@@ -122,8 +118,4 @@
 USE comcstfi_h
 implicit none
-
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
 
 real, intent(in)  :: qice
@@ -181,8 +173,4 @@
 implicit none
 
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
-
 real, intent(in) :: qdust,ndust ! needed if doubleq
 real, intent(in), optional :: tauscaling ! useful for realistic thresholds
@@ -237,8 +225,4 @@
 implicit none
 
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
-
 real, intent(in) :: qccn,nccn ! needed if doubleq
 real, intent(in), optional :: tauscaling ! useful for realistic thresholds
Index: trunk/LMDZ.MARS/libf/phymars/updatereffrad.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/updatereffrad.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/updatereffrad.F	(revision 1266)
@@ -35,10 +35,5 @@
 c    -------------
 c
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "dimradmars.h"
-!#include "tracer.h"
-!#include "yomaer.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.MARS/libf/phymars/vdif_kc.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/vdif_kc.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/vdif_kc.F	(revision 1266)
@@ -5,7 +5,4 @@
       IMPLICIT NONE
 c.......................................................................
-!#include "dimensions.h"
-!#include "dimphys.h"
-!#include "tracer.h"
 #include "callkeys.h"
 c.......................................................................
Index: trunk/LMDZ.MARS/libf/phymars/vdifc.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/vdifc.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/vdifc.F	(revision 1266)
@@ -36,10 +36,5 @@
 c   -------------
 
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "surfdat.h"
-!#include "comgeomfi.h"
-!#include "tracer.h"
 #include "microphys.h"
 
Index: trunk/LMDZ.MARS/libf/phymars/vlz_fi.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/vlz_fi.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/vlz_fi.F	(revision 1266)
@@ -16,6 +16,4 @@
       IMPLICIT NONE
 c
-!#include "dimensions.h"
-!#include "dimphys.h"
 
 c
Index: trunk/LMDZ.MARS/libf/phymars/watercloud.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/watercloud.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/watercloud.F	(revision 1266)
@@ -36,10 +36,5 @@
 c   -------------
 
-!#include "dimensions.h"
-!#include "dimphys.h"
 #include "callkeys.h"
-!#include "tracer.h"
-!#include "comgeomfi.h"
-!#include "dimradmars.h"
 
 c   Inputs:
Index: trunk/LMDZ.MARS/libf/phymars/write_archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/write_archive.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/write_archive.F	(revision 1266)
@@ -36,5 +36,4 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
 #include "paramet.h"
 !#include "control.h"
Index: trunk/LMDZ.MARS/libf/phymars/writediagfi.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/writediagfi.F	(revision 1266)
@@ -48,7 +48,5 @@
 ! Commons
 #include "dimensions.h"
-!#include "dimphys.h"
 #include "paramet.h"
-!#include "control.h"
 #include "comvert.h"
 #include "comgeom.h"
@@ -56,5 +54,4 @@
 #include "netcdf.inc"
 #include "temps.h"
-!#include "surfdat.h"
 
 ! Arguments on input:
Index: trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/writediagsoil.F90	(revision 1266)
@@ -20,5 +20,4 @@
 
 #include"dimensions.h"
-!#include"dimphys.h"
 #include"paramet.h"
 !#include"control.h"
Index: trunk/LMDZ.MARS/libf/phymars/wstats.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/wstats.F90	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/wstats.F90	(revision 1266)
@@ -7,5 +7,4 @@
 
 #include "dimensions.h"
-#include "dimphys.h"
 #include "comconst.h"
 #include "statto.h"
@@ -293,5 +292,4 @@
 
 include "dimensions.h"
-include "dimphys.h"
 include "netcdf.inc"
 
Index: trunk/LMDZ.MARS/libf/phymars/yamada4.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/yamada4.F	(revision 1264)
+++ trunk/LMDZ.MARS/libf/phymars/yamada4.F	(revision 1266)
@@ -16,7 +16,4 @@
 !.......................................................................
 ! MARS
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
 #include "callkeys.h"
 !.......................................................................
@@ -608,7 +605,4 @@
 !.......................................................................
 ! MARS
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
 #include "callkeys.h"
 !.......................................................................
@@ -689,7 +683,4 @@
 !.......................................................................
 ! MARS
-#include "dimensions.h"
-#include "dimphys.h"
-!#include "tracer.h"
 #include "callkeys.h"
 !.......................................................................
