Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 1245)
+++ /trunk/LMDZ.MARS/README	(revision 1246)
@@ -2089,2 +2089,15 @@
 - ustar and tstar are calculated in vdifc. so no need to recalculate
   those elsewhere. use turb_mod module to store it. 
+
+== 11/05/2014 == AS
+- Number of scatterers no longer prescribed at compiling time
+- Number of scatterers must now be set in callphys.def (keyword: naerkind)
+- Added in dimradmars_mod a subroutine ini_scatterers to initialize arrays once naerkind is known
+  -- NB: ini_scatterers is not called in phys_var_init
+  --     but rather in conf_phys once naerkind is read in callphys.def
+- Checks + names of scatterers moved from callradite to conf_phys
+- Put what was in scatterers.h in dimradmars_mod
+- Put what was in aerkind.h in dimradmars_mod
+- Put what was in yomaer_h in dimradmars_mod
+- Moved conc_mod in phymars rather than aeronomars. 
+  Otherwise pb of cyclic dependencies (plus compiling without aeronomars is impossible).
Index: /trunk/LMDZ.MARS/deftank/callphys.def
===================================================================
--- /trunk/LMDZ.MARS/deftank/callphys.def	(revision 1245)
+++ /trunk/LMDZ.MARS/deftank/callphys.def	(revision 1246)
@@ -108,4 +108,7 @@
 photochem  = .false.
 
+# SCATTERERS: set number of scatterers. must be compliant with preceding options.
+naerkind = 1
+
 ## Thermospheric options (relevant if tracer=T) :
 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: /trunk/LMDZ.MARS/deftank/callphys.def.MCD5
===================================================================
--- /trunk/LMDZ.MARS/deftank/callphys.def.MCD5	(revision 1245)
+++ /trunk/LMDZ.MARS/deftank/callphys.def.MCD5	(revision 1246)
@@ -124,4 +124,8 @@
 photochem  = .true.
 
+# SCATTERERS: set number of scatterers. must be compliant with preceding options.
+naerkind = 2
+
+
 ## Thermospheric options (relevant if tracer=T) :
 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: /trunk/LMDZ.MARS/deftank/callphys.def.outliers
===================================================================
--- /trunk/LMDZ.MARS/deftank/callphys.def.outliers	(revision 1245)
+++ /trunk/LMDZ.MARS/deftank/callphys.def.outliers	(revision 1246)
@@ -118,4 +118,8 @@
 photochem  = .false.
 
+# SCATTERERS: set number of scatterers. must be compliant with preceding options.
+naerkind = 2
+
+
 ## Thermospheric options (relevant if tracer=T) :
 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: unk/LMDZ.MARS/libf/aeronomars/conc_mod.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/aeronomars/conc_mod.F90	(revision 1245)
+++ 	(revision )
@@ -1,25 +1,0 @@
-module conc_mod
-
-implicit none
-
-  real,save,allocatable :: mmean(:,:)  ! mean molecular mass of the atmosphere
-  real,save,allocatable :: Akknew(:,:) ! thermal conductivity cofficient
-  real,save,allocatable :: cpnew(:,:)  ! specicic heat
-  real,save,allocatable :: rnew(:,:)   ! specific gas constant
-  
-contains
-
-  subroutine ini_conc_mod(ngrid,nlayer)
-  
-  implicit none
-  integer,intent(in) :: ngrid ! number of atmospheric columns
-  integer,intent(in) :: nlayer ! number of atmospheric levels
-  
-    allocate(mmean(ngrid,nlayer))
-    allocate(Akknew(ngrid,nlayer))
-    allocate(cpnew(ngrid,nlayer))
-    allocate(rnew(ngrid,nlayer))
-    
-  end subroutine ini_conc_mod
-
-end module conc_mod
Index: /trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F
===================================================================
--- /trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F	(revision 1246)
@@ -1,3 +1,3 @@
-      subroutine surfacearea(ngrid, nlay, ptimestep,
+      subroutine surfacearea(ngrid, nlay, naerkind, ptimestep,
      $                       pplay, pzlay, 
      $                       pt, pq, pdq, nq, rdust, rice, tau, 
@@ -24,6 +24,4 @@
 !#include "tracer.h"
 !#include "dimradmars.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 #include "chimiedata.h"
 !#include "conc.h"
@@ -31,5 +29,5 @@
 ! input
 
-      integer,intent(in) :: ngrid, nlay
+      integer,intent(in) :: ngrid, nlay, naerkind
       integer,intent(in) :: nq               ! number of tracers
       real,intent(in) :: ptimestep           ! physics time step (s)
Index: unk/LMDZ.MARS/libf/phymars/aerkind.h
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/aerkind.h	(revision 1245)
+++ 	(revision )
@@ -1,28 +1,0 @@
-!------------------------------------------------------------------
-! INCLUDE 'aerkind.h'
-! Contains the names of the different scatterers
-!------------------------------------------------------------------
-
-!     Don't forget that naerkind is set in scatterers.h 
-!       (built when compiling with makegcm -s #)
-
-      character*20  name_iaer(naerkind)  ! name of the scatterers
-!     Scatterer: DUST
-      integer iaer_dust_conrath ! Typical dust profiles using a
-                                ! Conrath type analytical equation
-      integer iaer_dust_doubleq ! Dust profile is given by the
-                                ! mass mixing ratio of the two-
-                                ! moment scheme method (doubleq)
-      integer iaer_dust_submicron ! Dust profile is given by a
-                                  ! submicron population of dust
-                                  ! particles
-!     Scatterer: WATER
-      integer iaer_h2o_ice ! Water ice particles
-
-! NB: to keep commons aligned: 
-!     split them in groups (reals, integers and characters)
-      COMMON/aerkind/                                                   &
-     & iaer_dust_conrath,iaer_dust_doubleq,iaer_dust_submicron,         &
-     & iaer_h2o_ice
-      COMMON/aerkind2/name_iaer
-!------------------------------------------------------------------
Index: /trunk/LMDZ.MARS/libf/phymars/aeropacity.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/aeropacity.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/aeropacity.F	(revision 1246)
@@ -9,7 +9,10 @@
      &                      nqdust
       use comgeomfi_h, only: lati, sinlat ! grid point latitudes (rad)
-      use yomaer_h, only: tauvis
       use planete_h
       USE comcstfi_h
+      use dimradmars_mod, only: naerkind, name_iaer, 
+     &            iaerdust,tauvis,
+     &            iaer_dust_conrath,iaer_dust_doubleq,
+     &            iaer_dust_submicron,iaer_h2o_ice
        IMPLICIT NONE
 c=======================================================================
@@ -58,9 +61,5 @@
 !#include "comgeomfi.h"
 !#include "dimradmars.h"
-!#include "yomaer.h"
 !#include "tracer.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
-#include "aerkind.h"
 
 c-----------------------------------------------------------------------
@@ -131,5 +130,4 @@
       CHARACTER(LEN=1) :: txt2 ! to temporarly store text
 ! indexes of dust scatterers:
-      INTEGER,SAVE :: iaerdust(naerkind)
       INTEGER,SAVE :: naerdust ! number of dust scatterers
 
Index: /trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/aeroptproperties.F	(revision 1246)
@@ -4,8 +4,8 @@
      &                            QREFvis3d,QREFir3d,
      &                            omegaREFvis3d,omegaREFir3d)
-      use dimradmars_mod, only: nir, nsun
-      use yomaer_h, only: radiustab, nsize, QVISsQREF, omegavis, gvis,
-     &                    QIRsQREF, omegaIR, gIR, QREFvis, QREFir,
-     &                    omegaREFvis, omegaREFir
+      use dimradmars_mod, only: nir, nsun, naerkind,
+     &                radiustab, nsize, QVISsQREF, omegavis, gvis,
+     &                QIRsQREF, omegaIR, gIR, QREFvis, QREFir,
+     &                omegaREFvis, omegaREFir
       IMPLICIT NONE
 c     =============================================================
@@ -31,7 +31,4 @@
 #include "callkeys.h"
 !#include "dimradmars.h"
-!#include "yomaer.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 
 c     Local variables 
@@ -39,10 +36,11 @@
 
 c     =============================================================
-      LOGICAL, PARAMETER :: varyingnueff(naerkind) = .false.
+      LOGICAL,SAVE,ALLOCATABLE :: varyingnueff(:)
 c     =============================================================
 
 c     Min. and max radius of the interpolation grid (in METERS)
-      REAL, SAVE :: refftabmin(naerkind,2)
-      REAL, SAVE :: refftabmax(naerkind,2)
+      REAL, SAVE, ALLOCATABLE :: refftabmin(:,:)
+      REAL, SAVE, ALLOCATABLE :: refftabmax(:,:)
+
 c     Log of the min and max variance of the interpolation grid
       REAL, PARAMETER :: nuefftabmin = -4.6
@@ -97,8 +95,7 @@
       REAL,SAVE,ALLOCATABLE :: nuefftab(:,:,:)
 c     Volume ratio of the grid
-      REAL,SAVE :: logvratgrid(naerkind,2)
+      REAL,SAVE,ALLOCATABLE :: logvratgrid(:,:)
 c     Grid used to remember which calculation is done
-      LOGICAL,SAVE :: checkgrid(refftabsize,nuefftabsize,naerkind,2)
-     &                = .false.
+      LOGICAL,SAVE,ALLOCATABLE :: checkgrid(:,:,:,:)
 c     Optical properties of the grid (VISIBLE)
       REAL,SAVE,ALLOCATABLE :: qsqrefVISgrid(:,:,:,:)
@@ -114,19 +111,18 @@
       REAL,SAVE,ALLOCATABLE :: gIRgrid(:,:,:,:)
 c     Optical properties of the grid (REFERENCE WAVELENGTHS)
-      REAL,SAVE :: qrefVISgrid(refftabsize,nuefftabsize,naerkind)
-      REAL,SAVE :: qscatrefVISgrid(refftabsize,nuefftabsize,naerkind)
-      REAL,SAVE :: qrefIRgrid(refftabsize,nuefftabsize,naerkind)
-      REAL,SAVE :: qscatrefIRgrid(refftabsize,nuefftabsize,naerkind)
-      REAL,SAVE :: omegrefVISgrid(refftabsize,nuefftabsize,naerkind)
-      REAL,SAVE :: omegrefIRgrid(refftabsize,nuefftabsize,naerkind)
+      REAL,SAVE,ALLOCATABLE :: qrefVISgrid(:,:,:)
+      REAL,SAVE,ALLOCATABLE :: qscatrefVISgrid(:,:,:)
+      REAL,SAVE,ALLOCATABLE :: qrefIRgrid(:,:,:)
+      REAL,SAVE,ALLOCATABLE :: qscatrefIRgrid(:,:,:)
+      REAL,SAVE,ALLOCATABLE :: omegrefVISgrid(:,:,:)
+      REAL,SAVE,ALLOCATABLE :: omegrefIRgrid(:,:,:)
 c     Firstcall
       LOGICAL,SAVE :: firstcall = .true.
 c     Variables used by the Gauss-Legendre integration:
-      REAL,SAVE :: normd(refftabsize,nuefftabsize,naerkind,2)
-      REAL,SAVE :: dista(refftabsize,nuefftabsize,naerkind,2,ngau)
-      REAL,SAVE :: distb(refftabsize,nuefftabsize,naerkind,2,ngau)
-
-      REAL,SAVE :: radGAUSa(ngau,naerkind,2)
-      REAL,SAVE :: radGAUSb(ngau,naerkind,2)
+      REAL,SAVE,ALLOCATABLE :: normd(:,:,:,:)
+      REAL,SAVE,ALLOCATABLE :: dista(:,:,:,:,:)
+      REAL,SAVE,ALLOCATABLE :: distb(:,:,:,:,:)
+      REAL,SAVE,ALLOCATABLE :: radGAUSa(:,:,:)
+      REAL,SAVE,ALLOCATABLE :: radGAUSb(:,:,:)
 
       REAL,SAVE,ALLOCATABLE :: qsqrefVISa(:,:,:)
@@ -233,5 +229,29 @@
         allocate(gIRa(nir,ngau,naerkind))
         allocate(gIRb(nir,ngau,naerkind))
-        
+       
+        allocate(qrefVISgrid(refftabsize,nuefftabsize,naerkind))
+        allocate(qscatrefVISgrid(refftabsize,nuefftabsize,naerkind))
+        allocate(qrefIRgrid(refftabsize,nuefftabsize,naerkind))
+        allocate(qscatrefIRgrid(refftabsize,nuefftabsize,naerkind))
+        allocate(omegrefVISgrid(refftabsize,nuefftabsize,naerkind))
+        allocate(omegrefIRgrid(refftabsize,nuefftabsize,naerkind))
+
+        allocate(normd(refftabsize,nuefftabsize,naerkind,2))
+        allocate(dista(refftabsize,nuefftabsize,naerkind,2,ngau))
+        allocate(distb(refftabsize,nuefftabsize,naerkind,2,ngau))
+        allocate(radGAUSa(ngau,naerkind,2))
+        allocate(radGAUSb(ngau,naerkind,2))
+
+        allocate(checkgrid(refftabsize,nuefftabsize,naerkind,2))
+        checkgrid(1:refftabsize,1:nuefftabsize,1:naerkind,1:2) = .false.
+
+        allocate(logvratgrid(naerkind,2))
+
+        allocate(refftabmin(naerkind,2))
+        allocate(refftabmax(naerkind,2))
+
+        allocate(varyingnueff(naerkind))
+        varyingnueff(1:naerkind) = .false.
+
 c       0.1 Pi!
         pi = 2. * asin(1.e0)
Index: /trunk/LMDZ.MARS/libf/phymars/callradite.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/callradite.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/callradite.F	(revision 1246)
@@ -6,4 +6,7 @@
 
       use dimradmars_mod, only: ndomainsz, nflev, nsun, nir
+      use dimradmars_mod, only: naerkind, name_iaer,
+     &            iaer_dust_conrath,iaer_dust_doubleq,
+     &            iaer_dust_submicron,iaer_h2o_ice
       use yomlw_h, only: gcp, nlaylte
       USE comcstfi_h
@@ -153,7 +156,4 @@
 #include "callkeys.h"
 !#include "yomlw.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
-#include "aerkind.h"
 
 c-----------------------------------------------------------------------
@@ -272,18 +272,4 @@
         allocate(pview(ngrid))
 
-c        Please name the different scatterers here ----------------
-c        PLEASE MAKE SURE that you set up the right number of
-c          scatterers in scatterers.h (naerkind);
-          name_iaer(1) = "dust_conrath"   !! default choice is good old Conrath profile
-          IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme
-          if (nq.gt.1) then
-           ! trick to avoid problems compiling with 1 tracer
-           ! and picky compilers who know name_iaer(2) is out of bounds
-           j=2
-          IF (water.AND.activice) name_iaer(j) = "h2o_ice"      !! radiatively-active clouds
-          IF (submicron.AND.active) name_iaer(j) = "dust_submicron" !! JBM experimental stuff
-          endif ! of if (nq.gt.1)
-c        ----------------------------------------------------------
-
 c        Assign a number to the different scatterers
 c        -------------------------------------------
@@ -352,18 +338,4 @@
          ENDDO
          gcp = g/cpp
-
-c        Logical tests for radiatively active water-ice clouds:
-         IF ( (activice.AND.(.NOT.water)).OR.
-     &        (activice.AND.(naerkind.LT.2)) ) THEN
-           WRITE(*,*) 'If activice is TRUE, water has to be set'
-           WRITE(*,*) 'to TRUE, and "naerkind" must be at least'
-           WRITE(*,*) 'equal to 2 in scatterers.h.'
-           CALL ABORT
-         ELSE IF ( (.NOT.activice).AND.(naerkind.GT.1) ) THEN
-           WRITE(*,*) 'naerkind is greater than unity, but'
-           WRITE(*,*) 'activice has not been set to .true.'
-           WRITE(*,*) 'in callphys.def; this is not logical!'
-           CALL ABORT
-         ENDIF
 
 c        Loading the optical properties in external look-up tables:
Index: /trunk/LMDZ.MARS/libf/phymars/conc_mod.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/conc_mod.F90	(revision 1246)
+++ /trunk/LMDZ.MARS/libf/phymars/conc_mod.F90	(revision 1246)
@@ -0,0 +1,25 @@
+module conc_mod
+
+implicit none
+
+  real,save,allocatable :: mmean(:,:)  ! mean molecular mass of the atmosphere
+  real,save,allocatable :: Akknew(:,:) ! thermal conductivity cofficient
+  real,save,allocatable :: cpnew(:,:)  ! specicic heat
+  real,save,allocatable :: rnew(:,:)   ! specific gas constant
+  
+contains
+
+  subroutine ini_conc_mod(ngrid,nlayer)
+  
+  implicit none
+  integer,intent(in) :: ngrid ! number of atmospheric columns
+  integer,intent(in) :: nlayer ! number of atmospheric levels
+  
+    allocate(mmean(ngrid,nlayer))
+    allocate(Akknew(ngrid,nlayer))
+    allocate(cpnew(ngrid,nlayer))
+    allocate(rnew(ngrid,nlayer))
+    
+  end subroutine ini_conc_mod
+
+end module conc_mod
Index: /trunk/LMDZ.MARS/libf/phymars/conf_phys.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/conf_phys.F	(revision 1246)
@@ -1,3 +1,3 @@
-      SUBROUTINE conf_phys(nq)
+      SUBROUTINE conf_phys(ngrid,nlayer,nq)
  
 !=======================================================================
@@ -38,8 +38,9 @@
       use surfdat_h, only: albedo_h2o_ice, inert_h2o_ice,
      &                     frost_albedo_threshold
-      use yomaer_h,only: tauvis
       use control_mod, only: ecritphy
       use planete_h
       USE comcstfi_h, only: daysec,dtphys
+      use dimradmars_mod, only: naerkind, name_iaer,
+     &                      ini_scatterers,tauvis
 
       IMPLICIT NONE
@@ -52,14 +53,11 @@
 !#include "surfdat.h"
 !#include "dimradmars.h"
-!#include "yomaer.h"
 #include "datafile.h"
 !#include "slope.h"
 #include "microphys.h"
 !#include "tracer.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
-
-      INTEGER,INTENT(IN) :: nq
-      INTEGER ig,ierr
+
+      INTEGER,INTENT(IN) :: ngrid,nlayer,nq
+      INTEGER ig,ierr,j
  
       CHARACTER ch1*12
@@ -536,4 +534,47 @@
 
 
+! SCATTERERS
+         write(*,*) "how many scatterers?"
+         naerkind=1 ! default value
+         call getin("naerkind",naerkind)
+         write(*,*)" naerkind = ",naerkind
+
+! Test of incompatibility
+c        Logical tests for radiatively active water-ice clouds:
+         IF ( (activice.AND.(.NOT.water)).OR.
+     &        (activice.AND.(naerkind.LT.2)) ) THEN
+           WRITE(*,*) 'If activice is TRUE, water has to be set'
+           WRITE(*,*) 'to TRUE, and "naerkind" must be at least'
+           WRITE(*,*) 'equal to 2.'
+           CALL ABORT
+         ELSE IF ( (.NOT.activice).AND.(naerkind.GT.1) ) THEN
+           WRITE(*,*) 'naerkind is greater than unity, but'
+           WRITE(*,*) 'activice has not been set to .true.'
+           WRITE(*,*) 'in callphys.def; this is not logical!'
+           CALL ABORT
+         ENDIF
+
+!------------------------------------------
+!------------------------------------------
+! once naerkind is known allocate arrays
+! -- we do it here and not in phys_var_init
+! -- because we need to know naerkind first
+         CALL ini_scatterers(ngrid,nlayer)
+!------------------------------------------
+!------------------------------------------
+
+
+c        Please name the different scatterers here ----------------
+         name_iaer(1) = "dust_conrath"   !! default choice is good old Conrath profile
+         IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme
+         if (nq.gt.1) then
+          ! trick to avoid problems compiling with 1 tracer
+          ! and picky compilers who know name_iaer(2) is out of bounds
+          j=2
+         IF (water.AND.activice) name_iaer(j) = "h2o_ice"      !! radiatively-active clouds
+         IF (submicron.AND.active) name_iaer(j) = "dust_submicron" !! JBM experimental stuff
+         endif ! of if (nq.gt.1)
+c        ----------------------------------------------------------
+
 ! THERMOSPHERE
 
Index: /trunk/LMDZ.MARS/libf/phymars/dimradmars_mod.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/dimradmars_mod.F90	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/dimradmars_mod.F90	(revision 1246)
@@ -16,13 +16,31 @@
 ! Number of kind of tracer radiative properties
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-
-#include"scatterers.h"
-! NB: May have to change value of nsizemax below when changing scatterers
+! naerkind is set by reading callphys.def
+! -- see conf_phys
+! -- value of nsizemax below is comfortably high
+!    but beware in case you add a lot of scatterers
+  INTEGER, SAVE :: naerkind
+
+  ! AS: previously in aerkind.h
+  character*20, SAVE, ALLOCATABLE :: name_iaer(:)  ! name of the scatterers
+  integer iaer_dust_conrath ! Typical dust profiles using a
+                            ! Conrath type analytical equation
+  integer iaer_dust_doubleq ! Dust profile is given by the
+                            ! mass mixing ratio of the two-
+                            ! moment scheme method (doubleq)
+  integer iaer_dust_submicron ! Dust profile is given by a
+                              ! submicron population of dust
+                              ! particles
+  integer iaer_h2o_ice ! Water ice particles
+
+  ! AS: was in aeropacity
+  INTEGER,SAVE,ALLOCATABLE :: iaerdust(:)
+
+  ! AS: was in suaer
+  CHARACTER(LEN=30), SAVE, ALLOCATABLE :: file_id(:,:)
 
 ! Reference wavelengths used to compute reference optical depth (m)
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-  real,save :: longrefir(naerkind),longrefvis(naerkind)
+  REAL,SAVE,ALLOCATABLE :: longrefir(:),longrefvis(:)
   
 ! Definition of spectral intervals at thermal infrared wavelengths (LW)
@@ -86,6 +104,49 @@
   REAL,SAVE,ALLOCATABLE :: nueffdust(:,:) ! Dust effective variance
 
+!! ------------------------------------------------------
+!! AS: what was previously in yomaer
+!   Shortwave
+!   ~~~~~~~~~
+! 
+! tauvis: dust optical depth at reference wavelength  ("longrefvis" set
+! in dimradmars_mod : typically longrefvis = 0.67E-6 m, as measured by Viking )
+
+! For the "naerkind" kind of aerosol radiative properties : 
+! QVISsQREF  :  Qext / Qext("longrefvis")   <--- For both solar bands
+! omegavis   :  sinle scattering albedo     <--- For both solar bands
+! gvis       :  assymetry factor            <--- For both solar bands
+! 
+!   Longwave
+!   ~~~~~~~~
+! 
+! For the "naerkind" kind of aerosol radiative properties : 
+! QIRsQREF :  Qext / Qext("longrefvis")     <--- For the nir bandes IR
+! omegaIR  :  mean single scattering albedo <--- For the nir bandes IR
+! gIR      :  mean assymetry factor         <--- For the nir bandes IR
+! 
+  real,save :: tauvis
+  real,save,allocatable :: QVISsQREF(:,:,:)
+  real,save,allocatable :: omegavis(:,:,:)
+  real,save,allocatable :: gvis(:,:,:)
+  real,save,allocatable :: QIRsQREF(:,:,:)
+  real,save,allocatable :: omegaIR(:,:,:)
+  real,save,allocatable :: gIR(:,:,:)
+! Actual number of grain size classes in each domain for a
+!   given aerosol:
+  integer,save,allocatable :: nsize(:,:)
+! Particle size axis (depend on the kind of aerosol and the
+!   radiation domain)
+  real,save,allocatable :: radiustab(:,:,:)
+! Extinction coefficient at reference wavelengths;
+!   These wavelengths are defined in dimradmars_mod, and called
+!   longrefvis and longrefir.
+  real,save,allocatable :: QREFvis(:,:)
+  real,save,allocatable :: QREFir(:,:)
+  real,save,allocatable :: omegaREFvis(:,:)
+  real,save,allocatable :: omegaREFir(:,:)
+!! ------------------------------------------------------
+
 contains
-  
+
   subroutine ini_dimradmars_mod(ngrid,nlayer)
   
@@ -107,8 +168,36 @@
    allocate(fluxrad(ngrid))
    allocate(tauscaling(ngrid))
+   allocate(nueffdust(ngrid,nlayer))
+
+  end subroutine ini_dimradmars_mod
+ 
+  subroutine ini_scatterers(ngrid,nlayer)
+
+  implicit none
+
+  integer,intent(in) :: ngrid ! number of atmospheric columns
+  integer,intent(in) :: nlayer ! number of atmospheric layers
+
+   allocate(name_iaer(naerkind))
    allocate(aerosol(ngrid,nlayer,naerkind))
-   allocate(nueffdust(ngrid,nlayer))
-
-  end subroutine ini_dimradmars_mod
-  
+   allocate(longrefir(naerkind))
+   allocate(longrefvis(naerkind))
+   allocate(iaerdust(naerkind))
+   allocate(file_id(naerkind,2))
+
+   allocate(QVISsQREF(nsun,naerkind,nsizemax))
+   allocate(omegavis(nsun,naerkind,nsizemax))
+   allocate(gvis(nsun,naerkind,nsizemax))
+   allocate(QIRsQREF(nir,naerkind,nsizemax))
+   allocate(omegaIR(nir,naerkind,nsizemax))
+   allocate(gIR(nir,naerkind,nsizemax))
+   allocate(nsize(naerkind,2))
+   allocate(radiustab(naerkind,2,nsizemax))
+   allocate(QREFvis(naerkind,nsizemax))
+   allocate(QREFir(naerkind,nsizemax))
+   allocate(omegaREFvis(naerkind,nsizemax))
+   allocate(omegaREFir(naerkind,nsizemax))
+
+  end subroutine ini_scatterers
+
 end module dimradmars_mod
Index: /trunk/LMDZ.MARS/libf/phymars/iniphysiq.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/iniphysiq.F90	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/iniphysiq.F90	(revision 1246)
@@ -73,5 +73,5 @@
                          punjours,ptimestep,prad,pg,pr,pcpp)
 call ini_fillgeom(ngrid,rlatd,rlond,airephy)
-call conf_phys(nqtot)
+call conf_phys(ngrid,nlayer,nqtot)
 
 !$OMP END PARALLEL
Index: /trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/lect_start_archive.F	(revision 1246)
@@ -27,5 +27,4 @@
 !#include "comsoil.h"
 !#include "dimradmars.h"
-!#include "yomaer.h"
 #include "paramet.h"
 #include "comconst.h"
Index: /trunk/LMDZ.MARS/libf/phymars/lwdiff.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/lwdiff.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/lwdiff.F	(revision 1246)
@@ -15,5 +15,4 @@
 #include "callkeys.h"
 
-!#include "yomaer.h"
 !#include "yomlw.h"
 C-----------------------------------------------------------------------
Index: /trunk/LMDZ.MARS/libf/phymars/lwmain.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/lwmain.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/lwmain.F	(revision 1246)
@@ -13,4 +13,5 @@
 
       use dimradmars_mod, only: ndlo2, nflev, nir, ndlon, nuco2
+      use dimradmars_mod, only: naerkind
       use yomlw_h, only: nlaylte, xi
       implicit none
@@ -21,6 +22,4 @@
 #include "callkeys.h"
 #include "comg1d.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 !#include "yomlw.h"
 
Index: /trunk/LMDZ.MARS/libf/phymars/lwu.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/lwu.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/lwu.F	(revision 1246)
@@ -32,4 +32,5 @@
  
       use dimradmars_mod, only: ndlo2, nir, nuco2, ndlon, nflev
+      use dimradmars_mod, only: naerkind
       use yomlw_h, only: nlaylte, tref, at, bt, cst_voigt
       USE comcstfi_h
@@ -40,8 +41,5 @@
 !#include "dimradmars.h"
 
-!#include "yomaer.h"
 !#include "yomlw.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 
 #include "callkeys.h"
Index: /trunk/LMDZ.MARS/libf/phymars/newstart.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/newstart.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/newstart.F	(revision 1246)
@@ -43,5 +43,4 @@
 !#include "comsoil.h"
 !#include "dimradmars.h"
-!#include "yomaer.h"
 #include "paramet.h"
 #include "comconst.h"
@@ -391,5 +390,5 @@
      .                         daysec,dtphys,rad,g,r,cpp)
       call ini_fillgeom(ngridmx,latfi,lonfi,airefi)
-      call conf_phys(nqtot)
+      call conf_phys(ngridmx,llm,nqtot)
 
 c=======================================================================
Index: /trunk/LMDZ.MARS/libf/phymars/phyetat0.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/phyetat0.F90	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/phyetat0.F90	(revision 1246)
@@ -28,5 +28,4 @@
 !#include "surfdat.h"
 !#include "dimradmars.h"
-!#include "yomaer.h"
 !#include "tracer.h"
 !#include "advtrac.h"
Index: /trunk/LMDZ.MARS/libf/phymars/phyredem.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/phyredem.F90	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/phyredem.F90	(revision 1246)
@@ -18,5 +18,5 @@
                        z0_default, albedice, emisice, emissiv, &
                        iceradius, dtemisice, phisfi, z0
-  use yomaer_h, only: tauvis
+  use dimradmars_mod, only: tauvis
   use iostart, only : open_restartphy, close_restartphy, & 
                       put_var, put_field, length
Index: /trunk/LMDZ.MARS/libf/phymars/phys_state_var_init.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/phys_state_var_init.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/phys_state_var_init.F	(revision 1246)
@@ -35,5 +35,4 @@
       use comsoil_h, only: ini_comsoil_h
       use dimradmars_mod, only: ini_dimradmars_mod
-      use yomaer_h,only: ini_yomaer_h
       use yomlw_h, only: ini_yomlw_h
       use conc_mod, only: ini_conc_mod
@@ -80,7 +79,4 @@
       call ini_dimradmars_mod(ngrid,nlayer)
 
-      ! allocate arrays in "yomaer_h"
-      call ini_yomaer_h
-
       ! allocate arrays in "yomlw_h"
       call ini_yomlw_h(ngrid)
Index: /trunk/LMDZ.MARS/libf/phymars/physiq.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/physiq.F	(revision 1246)
@@ -27,5 +27,6 @@
       use control_mod, only: iphysiq, day_step, ecritstart
       use dimradmars_mod, only: tauscaling, aerosol,
-     &                          dtrad, fluxrad_sky, fluxrad, albedo
+     &                          dtrad, fluxrad_sky, fluxrad, albedo,
+     &                          naerkind
       use turb_mod, only: q2, wstar, ustar, sensibFlux, 
      &                    zmax_th, hfmax_th, turb_resolved
@@ -152,6 +153,4 @@
 !#include "control.h"
 !#include "dimradmars.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 #include "comg1d.h"
 !#include "tracer.h"
@@ -237,4 +236,5 @@
       real,parameter :: odpref=610. ! DOD reference pressure (Pa)
       REAL tau(ngrid,naerkind)     ! Column dust optical depth at each point
+                                   ! AS: TBD: this one should be in a module !
       REAL zls                       !  solar longitude (rad)
       REAL zday                      ! date (time since Ls=0, in martian days)
@@ -1168,5 +1168,6 @@
 
 !           dust and ice surface area
-            call surfacearea(ngrid, nlayer, ptimestep, zplay, zzlay, 
+            call surfacearea(ngrid, nlayer, naerkind,
+     $                       ptimestep, zplay, zzlay, 
      $                       pt, pq, pdq, nq, 
      $                       rdust, rice, tau, tauscaling, 
Index: /trunk/LMDZ.MARS/libf/phymars/simpleclouds.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/simpleclouds.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/simpleclouds.F	(revision 1246)
@@ -6,4 +6,5 @@
       use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice
       USE comcstfi_h
+      use dimradmars_mod, only: naerkind
       implicit none
 c------------------------------------------------------------------
@@ -36,6 +37,4 @@
 !#include "comgeomfi.h"
 !#include "dimradmars.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 
 c------------------------------------------------------------------
Index: /trunk/LMDZ.MARS/libf/phymars/suaer.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/suaer.F90	(revision 1246)
@@ -1,8 +1,13 @@
 SUBROUTINE suaer
 use dimradmars_mod, only: longrefvis, longrefir, nsizemax, long1vis, &
-                         long2vis, long3vis, long1ir, long2ir, long1co2, &
-                         long2co2, nsun, nir
-use yomaer_h, only: radiustab, gvis, omegavis, QVISsQREF, gIR, omegaIR, &
-                    QIRsQREF, QREFvis, QREFir, omegaREFvis, omegaREFir, &
+                    long2vis, long3vis, long1ir, long2ir, long1co2, &
+                    long2co2, nsun, nir,&
+                    naerkind, name_iaer, &
+                    iaer_dust_conrath,iaer_dust_doubleq,&
+                    iaer_dust_submicron,iaer_h2o_ice,&
+                    file_id,radiustab, gvis, omegavis, &
+                    QVISsQREF, gIR, omegaIR, &
+                    QIRsQREF, QREFvis, QREFir, &
+                    omegaREFvis, omegaREFir, &
                     nsize
 IMPLICIT NONE
@@ -43,8 +48,4 @@
 !#include "dimphys.h"
 !#include "dimradmars.h"     
-!#include "yomaer.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
-#include "aerkind.h"
 
 ! Optical properties (read in external ASCII files)
@@ -92,8 +93,4 @@
 REAL omegav(nir)     ! Average sing.scat.albedo
 REAL gav(nir)        ! Average assymetry parameter
-
-! Local saved variables:
-
-CHARACTER(LEN=30), DIMENSION(naerkind,2), SAVE :: file_id
 
 !==================================================================
Index: /trunk/LMDZ.MARS/libf/phymars/swmain.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/swmain.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/swmain.F	(revision 1246)
@@ -5,5 +5,6 @@
      &                QVISsQREF3d,omegaVIS3d,gVIS3d)
 
-      use dimradmars_mod, only: ndlo2, ndlon, nflev, nsun
+      use dimradmars_mod, only: ndlo2, ndlon, nflev, 
+     &                          nsun,naerkind
       use yomlw_h, only: nlaylte, gcp
       IMPLICIT NONE
@@ -13,8 +14,5 @@
 !#include "dimradmars.h"
 
-!#include "yomaer.h"
 !#include "yomlw.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 #include "callkeys.h"
 c     
Index: /trunk/LMDZ.MARS/libf/phymars/swr_fouquart.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/swr_fouquart.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/swr_fouquart.F	(revision 1246)
@@ -4,5 +4,6 @@
      S     ,  PFD,PFU )
 
-      use dimradmars_mod, only: sunfr, ndlo2, nsun, ndlon, nflev
+      use dimradmars_mod, only: sunfr, ndlo2, nsun, 
+     &                          ndlon, nflev, naerkind
       use yomlw_h, only: nlaylte
       IMPLICIT NONE
@@ -12,7 +13,4 @@
 !#include "dimradmars.h"
 #include "callkeys.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
-!#include "yomaer.h"
 !#include "yomlw.h"
 
Index: /trunk/LMDZ.MARS/libf/phymars/swr_toon.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/swr_toon.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/swr_toon.F	(revision 1246)
@@ -4,5 +4,6 @@
      S     ,  PFD,PFU )
 
-      use dimradmars_mod, only: sunfr, ndlo2, nsun, nflev, ndlon
+      use dimradmars_mod, only: sunfr, ndlo2, nsun, nflev, 
+     &                          ndlon, naerkind
       use yomlw_h, only: nlaylte
       
@@ -13,6 +14,4 @@
 !#include "dimradmars.h"
 #include "callkeys.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 !#include "yomaer.h"
 !#include "yomlw.h"
Index: /trunk/LMDZ.MARS/libf/phymars/tabfi.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/tabfi.F	(revision 1246)
@@ -47,5 +47,5 @@
       use surfdat_h, only: z0_default, emissiv, emisice, albedice,
      &                     iceradius, dtemisice, iceradius
-      use yomaer_h, only: tauvis
+      use dimradmars_mod, only: tauvis
       use iostart, only: get_var
       use mod_phys_lmdz_para, only: is_parallel
@@ -61,5 +61,4 @@
 #include "netcdf.inc"
 !#include "dimradmars.h"
-!#include "yomaer.h"
 
 c-----------------------------------------------------------------------
Index: /trunk/LMDZ.MARS/libf/phymars/testphys1d.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/testphys1d.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/testphys1d.F	(revision 1246)
@@ -6,5 +6,4 @@
       use comsoil_h, only: volcapa, layer, mlayer, inertiedat, nsoilmx
       use comgeomfi_h, only: lati, long, area, sinlat, ini_fillgeom
-
       use surfdat_h, only: albedodat, z0_default, emissiv, emisice,
      &                     albedice, iceradius, dtemisice, z0,
@@ -12,5 +11,4 @@
      &                     watercaptag
       use slope_mod, only: theta_sl, psi_sl
-      use yomaer_h, only: tauvis
       use control_mod, only: day_step
       use phyredem, only: physdem0,physdem1
@@ -20,5 +18,5 @@
       use comcstfi_h, only: pi, rad, daysec, omeg, g, mugaz, rcp, r,
      &                      cpp, dtphys
-      use dimradmars_mod, only: tauscaling
+      use dimradmars_mod, only: tauscaling,tauvis
       IMPLICIT NONE
 
@@ -53,5 +51,4 @@
 #include "callkeys.h"
 !#include "comsaison.h"
-!#include "yomaer.h"
 !#include "control.h"
 #include "comvert.h"
@@ -483,5 +480,5 @@
      .          daysec,dtphys,rad,g,r,cpp)
       call ini_fillgeom(1,latitude,longitude,1.0)
-      call conf_phys(nq)
+      call conf_phys(1,llm,nq)
 
 
Index: /trunk/LMDZ.MARS/libf/phymars/updatereffrad.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/updatereffrad.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/updatereffrad.F	(revision 1246)
@@ -8,5 +8,8 @@
      &                       igcm_ccn_number, nuice_ref, varian,
      &                       ref_r0, igcm_dust_submicron
-       USE dimradmars_mod, only: nueffdust
+       USE dimradmars_mod, only: nueffdust,naerkind,
+     &            name_iaer,
+     &            iaer_dust_conrath,iaer_dust_doubleq,
+     &            iaer_dust_submicron,iaer_h2o_ice
        USE comcstfi_h
        IMPLICIT NONE
@@ -37,7 +40,4 @@
 !#include "dimradmars.h"
 !#include "tracer.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
-#include "aerkind.h"
 !#include "yomaer.h"
 
Index: /trunk/LMDZ.MARS/libf/phymars/watercloud.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/watercloud.F	(revision 1245)
+++ /trunk/LMDZ.MARS/libf/phymars/watercloud.F	(revision 1246)
@@ -12,4 +12,5 @@
      &                      igcm_ccn_mass, igcm_ccn_number,
      &                      rho_dust, nuice_sed, nuice_ref
+      use dimradmars_mod, only: naerkind
       IMPLICIT NONE
 
@@ -41,6 +42,4 @@
 !#include "comgeomfi.h"
 !#include "dimradmars.h"
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
 
 c   Inputs:
Index: unk/LMDZ.MARS/libf/phymars/yomaer_h.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/yomaer_h.F90	(revision 1245)
+++ 	(revision )
@@ -1,76 +1,0 @@
-module yomaer_h
-!     Radiative characteristics of the aerosols
-implicit none
-
-!   Shortwave
-!   ~~~~~~~~~
-! 
-! tauvis: dust optical depth at reference wavelength  ("longrefvis" set
-! in dimradmars_mod : typically longrefvis = 0.67E-6 m, as measured by Viking )
-
-! For the "naerkind" kind of aerosol radiative properties : 
-! QVISsQREF  :  Qext / Qext("longrefvis")   <--- For both solar bands
-! omegavis   :  sinle scattering albedo     <--- For both solar bands
-! gvis       :  assymetry factor            <--- For both solar bands
-! 
-!   Longwave
-!   ~~~~~~~~
-! 
-! For the "naerkind" kind of aerosol radiative properties : 
-! QIRsQREF :  Qext / Qext("longrefvis")     <--- For the nir bandes IR
-! omegaIR  :  mean single scattering albedo <--- For the nir bandes IR
-! gIR      :  mean assymetry factor         <--- For the nir bandes IR
-! 
-
-  real,save :: tauvis
-  real,save,allocatable :: QVISsQREF(:,:,:)
-  real,save,allocatable :: omegavis(:,:,:)
-  real,save,allocatable :: gvis(:,:,:)
-  real,save,allocatable :: QIRsQREF(:,:,:)
-  real,save,allocatable :: omegaIR(:,:,:)
-  real,save,allocatable :: gIR(:,:,:)
-  
-! Actual number of grain size classes in each domain for a
-!   given aerosol:
-  integer,save,allocatable :: nsize(:,:)
-
-! Particle size axis (depend on the kind of aerosol and the
-!   radiation domain)
-  real,save,allocatable :: radiustab(:,:,:)
-
-! Extinction coefficient at reference wavelengths;
-!   These wavelengths are defined in dimradmars_mod, and called
-!   longrefvis and longrefir.
-  real,save,allocatable :: QREFvis(:,:)
-  real,save,allocatable :: QREFir(:,:)
-  real,save,allocatable :: omegaREFvis(:,:)
-  real,save,allocatable :: omegaREFir(:,:)
-
-contains
-
-  subroutine ini_yomaer_h
-  
-  use dimradmars_mod, only: nsun, nir, nsizemax
-  implicit none
-! naerkind is set in scatterers.h (built when compiling with makegcm -s #)
-#include"scatterers.h"
-
-    allocate(QVISsQREF(nsun,naerkind,nsizemax))
-    allocate(omegavis(nsun,naerkind,nsizemax))
-    allocate(gvis(nsun,naerkind,nsizemax))
-    allocate(QIRsQREF(nir,naerkind,nsizemax))
-    allocate(omegaIR(nir,naerkind,nsizemax))
-    allocate(gIR(nir,naerkind,nsizemax))
-
-    allocate(nsize(naerkind,2))
-    
-    allocate(radiustab(naerkind,2,nsizemax))
-    
-    allocate(QREFvis(naerkind,nsizemax))
-    allocate(QREFir(naerkind,nsizemax))
-    allocate(omegaREFvis(naerkind,nsizemax))
-    allocate(omegaREFir(naerkind,nsizemax))
-  
-  end subroutine ini_yomaer_h
-
-end module yomaer_h
Index: /trunk/LMDZ.MARS/makegcm_g95
===================================================================
--- /trunk/LMDZ.MARS/makegcm_g95	(revision 1245)
+++ /trunk/LMDZ.MARS/makegcm_g95	(revision 1246)
@@ -13,5 +13,4 @@
 set grille=reg
 set dyntype="dyn"
-set scatterers="1"
 set full=""
 ########################################################################
@@ -19,21 +18,21 @@
 ########################################################################
 
-#### If you want you can set environment variables here (instead of
-####  relying on the C-shell environment variables)
-# default LMDGCM to where makegcm script is located:
-set scriptdir=`dirname $0`
-setenv LMDGCM `readlink -f $scriptdir`
-# You may set LIBOGCM to something else; otherwise we default to:
-setenv LIBOGCM $LMDGCM/libo
-## NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines
-#if ( `uname -m` == "x86_64" ) then
-## 64 bit machines
-  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib
-  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include
-#else
-#  setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib
-#  setenv NCDFINC /donnees/emlmd/netcdf-4.0.1_g95/include
-#endif
-####
+##### If you want you can set environment variables here (instead of
+#####  relying on the C-shell environment variables)
+## default LMDGCM to where makegcm script is located:
+#set scriptdir=`dirname $0`
+#setenv LMDGCM `readlink -f $scriptdir`
+## You may set LIBOGCM to something else; otherwise we default to:
+#setenv LIBOGCM $LMDGCM/libo
+### NetCDF Libraries: what follows is OK for LMD 32 and 64bit Linux Machines
+##if ( `uname -m` == "x86_64" ) then
+### 64 bit machines
+#  setenv NCDFLIB /donnees/emlmd/netcdf64-4.0.1_g95/lib
+#  setenv NCDFINC /donnees/emlmd/netcdf64-4.0.1_g95/include
+##else
+##  setenv NCDFLIB /donnees/emlmd/netcdf-4.0.1_g95/lib
+##  setenv NCDFINC /donnees/emlmd/netcdf-4.0.1_g95/include
+##endif
+#####
 
 setenv localdir "`pwd`"
@@ -290,6 +289,4 @@
              $LMDGCM/libf/grid/dimension/makdim
 
--s nscat   Number of radiatively active scatterers
-
 -p PHYS    Selects the set of physical parameterizations
            you want to compile the model with.
@@ -350,7 +347,4 @@
      case -p
         set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top
-
-     case -s
-        set scatterers="$2" ; shift ; goto top
 
      case -g
@@ -470,7 +464,7 @@
 # build final name of libraries directory:
 if ( "$dyntype" == "olddyn" ) then
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}_olddyn
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}_olddyn
 else
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}
 endif
 
@@ -527,6 +521,4 @@
     #remove old dimensions.h file
     \rm -f $libf/grid/dimensions.h
-    #remove old scatterers.h file
-    \rm -f $libf/phy$physique/scatterers.h
   else
     exit
@@ -540,10 +532,5 @@
 cat $libf/grid/dimensions.h
 
-cd $libf/phy$physique/scatterers
-# Build the appropriate 'scatterers.h' file
-./make_scatterers $scatterers
-# echo contents of scatterers.h to standard output
-cat $libf/phy$physique/scatterers.h
-
+#
 cd $LMDGCM
 # set path to objects directory
@@ -828,5 +815,4 @@
 PROG=$code
 
-# cleanup, remove dimensions.h and scatterers.h
+# cleanup, remove dimensions.h 
 \rm -f $libf/grid/dimensions.h
-\rm -f $libf/phy$physique/scatterers.h
Index: /trunk/LMDZ.MARS/makegcm_gfortran
===================================================================
--- /trunk/LMDZ.MARS/makegcm_gfortran	(revision 1245)
+++ /trunk/LMDZ.MARS/makegcm_gfortran	(revision 1246)
@@ -13,5 +13,4 @@
 set grille=reg
 set dyntype="dyn"
-set scatterers="1"
 set full=""
 ########################################################################
@@ -288,6 +287,4 @@
              $LMDGCM/libf/grid/dimension/makdim
 
--s nscat   Number of radiatively active scatterers
-
 -p PHYS    Selects the set of physical parameterizations
            you want to compile the model with.
@@ -348,7 +345,4 @@
      case -p
         set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top
-
-     case -s
-        set scatterers="$2" ; shift ; goto top
 
      case -g
@@ -468,7 +462,7 @@
 # build final name of libraries directory:
 if ( "$dyntype" == "olddyn" ) then
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}_olddyn
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}_olddyn
 else
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}
 endif
 
@@ -525,6 +519,4 @@
     #remove old dimensions.h file
     \rm -f $libf/grid/dimensions.h
-    #remove old scatterers.h file
-    \rm -f $libf/phy$physique/scatterers.h
   else
     exit
@@ -537,10 +529,4 @@
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
-
-cd $libf/phy$physique/scatterers
-# Build the appropriate 'scatterers.h' file
-./make_scatterers $scatterers
-# echo contents of scatterers.h to standard output
-cat $libf/phy$physique/scatterers.h
 
 cd $LMDGCM
@@ -826,5 +812,4 @@
 PROG=$code
 
-# cleanup, remove dimensions.h and scatterers.h
+# cleanup, remove dimensions.h
 \rm -f $libf/grid/dimensions.h
-\rm -f $libf/phy$physique/scatterers.h
Index: /trunk/LMDZ.MARS/makegcm_ifort
===================================================================
--- /trunk/LMDZ.MARS/makegcm_ifort	(revision 1245)
+++ /trunk/LMDZ.MARS/makegcm_ifort	(revision 1246)
@@ -13,5 +13,4 @@
 set grille=reg
 set dyntype="dyn"
-set scatterers="1"
 set full=""
 ########################################################################
@@ -301,6 +300,4 @@
              $LMDGCM/libf/grid/dimension/makdim
 
--s nscat   Number of radiatively active scatterers
-
 -p PHYS    Selects the set of physical parameterizations
            you want to compile the model with.
@@ -361,7 +358,4 @@
      case -p
         set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top
-
-     case -s
-        set scatterers="$2" ; shift ; goto top
 
      case -g
@@ -481,7 +475,7 @@
 # build final name of libraries directory:
 if ( "$dyntype" == "olddyn" ) then
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}_olddyn
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}_olddyn
 else
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}
 endif
 
@@ -538,6 +532,4 @@
     #remove old dimensions.h file
     \rm -f $libf/grid/dimensions.h
-    #remove old scatterers.h file
-    \rm -f $libf/phy$physique/scatterers.h
   else
     exit
@@ -550,10 +542,4 @@
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
-
-cd $libf/phy$physique/scatterers
-# Build the appropriate 'scatterers.h' file
-./make_scatterers $scatterers
-# echo contents of scatterers.h to standard output
-cat $libf/phy$physique/scatterers.h
 
 cd $LMDGCM
@@ -838,5 +824,4 @@
 PROG=$code
 
-# cleanup, remove dimensions.h and scatterers.h
+# cleanup, remove dimensions.h 
 \rm -f $libf/grid/dimensions.h
-\rm -f $libf/phy$physique/scatterers.h
Index: /trunk/LMDZ.MARS/makegcm_pgf
===================================================================
--- /trunk/LMDZ.MARS/makegcm_pgf	(revision 1245)
+++ /trunk/LMDZ.MARS/makegcm_pgf	(revision 1246)
@@ -13,5 +13,4 @@
 set grille=reg
 set dyntype="dyn"
-set scatterers="1"
 set full=""
 ########################################################################
@@ -293,6 +292,4 @@
              $LMDGCM/libf/grid/dimension/makdim
 
--s nscat   Number of radiatively active scatterers
-
 -p PHYS    Selects the set of physical parameterizations
            you want to compile the model with.
@@ -353,7 +350,4 @@
      case -p
         set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top
-
-     case -s
-        set scatterers="$2" ; shift ; goto top
 
      case -g
@@ -472,7 +466,7 @@
 # build final name of libraries directory:
 if ( "$dyntype" == "olddyn" ) then
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}_olddyn
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}_olddyn
 else
-  set nomlib=${nomlib}_${dim_}_t${ntrac}_s${scatterers}_${grille}
+  set nomlib=${nomlib}_${dim_}_t${ntrac}_${grille}
 endif
 
@@ -529,6 +523,4 @@
     #remove old dimensions.h file
     \rm -f $libf/grid/dimensions.h
-    #remove old scatterers.h file
-    \rm -f $libf/phy$physique/scatterers.h
   else
     exit
@@ -541,10 +533,4 @@
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
-
-cd $libf/phy$physique/scatterers
-# Build the appropriate 'scatterers.h' file
-./make_scatterers $scatterers
-# echo contents of scatterers.h to standard output
-cat $libf/phy$physique/scatterers.h
 
 cd $LMDGCM
@@ -827,5 +813,4 @@
 PROG=$code
 
-# cleanup, remove dimensions.h and scatterers.h
+# cleanup, remove dimensions.h 
 \rm -f $libf/grid/dimensions.h
-\rm -f $libf/phy$physique/scatterers.h
