Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/Registry.EM
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/Registry.EM	(revision 769)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/Registry.EM	(revision 772)
@@ -114,5 +114,6 @@
 state  real  QH2O      ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "QH2O"       "Water vapor mixing ratio"   "kg kg-1"
 state  real  QH2O_ICE  ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "QH2O_ICE"   "Water ice mixing ratio"     "kg kg-1"
-state  real  QDUST     ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "QDUST"      "Dust mixing ratio"          "kg kg-1"
+state  real  qdust     ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "qdust"      "Dust mixing ratio"          "kg kg-1"
+state  real  qndust    ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "qndust"     "Dust number density"        " m-3 "
 state  real  qtrac1    ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "qtrac1"     "Decaying tracer 1"          "kg kg-1"
 state  real  upward    ikjftb  scalar  1  -  i01rhusdf=(bdy_interp:dt) "upward"     "Decaying tracer surf"       "kg kg-1"
@@ -232,4 +233,6 @@
 state  real   mars_dsoil     ilj   misc  1  -  i012rd  "MARS_DSOIL"  "soil depths"             "m"
 state  real   mars_gw        ilj   misc  1  -  i012rd  "MARS_GW"     "gwparam"                 " "
+state  real   mars_qdust     ikj   misc  1  -  i012rd  "MARS_QDUST"   "dust mass mixing ratio" "kg/kg"
+state  real   mars_qndust    ikj   misc  1  -  i012rd  "MARS_QNDUST"   "dust number density"    " "
 ####
 ####
@@ -1496,4 +1499,5 @@
 package   water        mars==1                      -              moist:qv;scalar:qh2o,qh2o_ice
 package   dust         mars==2                      -              moist:qv;scalar:qdust
+package   dust2eq      mars==3                      -              scalar:qdust,qndust
 package   radioac      mars==20                     -              scalar:qtrac1
 package   radioac2     mars==21                     -              scalar:upward,downward
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_first_rk_step_part1.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_first_rk_step_part1.F	(revision 769)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_first_rk_step_part1.F	(revision 772)
@@ -631,4 +631,6 @@
      &        ,MARS_Z0=grid%mars_z0             &
      &        ,CST_Z0=config_flags%init_Z0      &
+     &        ,MARS_QDUST=grid%mars_qdust       &
+     &        ,MARS_QNDUST=grid%mars_qndust     &
 #endif
      &        ,MARS_GW=grid%mars_gw                                       &
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_initialize_les.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_initialize_les.F	(revision 769)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_initialize_les.F	(revision 772)
@@ -114,4 +114,7 @@
 !!MARS
  REAL :: lon_input, lat_input, alt_input, tsurf_input
+ ! for mode 3
+ LOGICAL :: MARS_MODE_INIT
+ REAL, DIMENSION(nl_max) :: qdust,qndust,dust_p_level
 !!MARS
 
@@ -346,4 +349,8 @@
     grid%mars_tsurf(i,j)=0. 
 !! <<
+!! >> Used for mode 3:
+    grid%mars_qdust(i,:,j)=0.
+    grid%mars_qndust(i,:,j)=0.
+!! <<
     grid%slpx(i,j) = 0.
     grid%slpy(i,j) = 0.
@@ -690,4 +697,5 @@
   print *, 'constant meridional wind ', config_flags%init_V
 ENDIF
+
 !!!MARS MARS
 
@@ -754,4 +762,28 @@
   ENDDO
   ENDDO
+
+!!!!! MARS INITIALIZE MODE 3 FOR LES
+
+!! RESTART=config_flags%restart -> this routine is not used in restart
+
+  MARS_MODE_INIT=config_flags%mars
+
+  IF (MARS_MODE_INIT .EQ. 3)  THEN
+  write (*,*) 'MARS MODE 3 INITIALIZATION, READING INPUT_DUST (module_initialize_les.F)'
+    ! load a profile of dust (same for all points)
+    call read_dust(qdust,qndust,dust_p_level,nl_in)
+    p_level = grid%znu(1)*(pd_surf - grid%p_top) + grid%p_top
+      IF (dust_p_level(1) .lt. p_level) then !input profile needs rescaling to avoid a plateau. This happens when you use different sources to initialize the pressure of the LES and the input_dust. Typicaly: you use the MCD for input_therm and different runs for input_dust, that dont have the same surface pressure ! This trick is ok because we dont want to initialize with a very precise profile of dust, just a realistic one.
+         dust_p_level = dust_p_level * p_level/dust_p_level(1)
+     ENDIF
+     DO k=1,kte-1
+         p_level = grid%znu(k)*(pd_surf - grid%p_top) + grid%p_top
+         grid%mars_qdust(its:ite,k,jts:jte)=interp_0( qdust, dust_p_level, p_level, nl_in )
+         grid%mars_qndust(its:ite,k,jts:jte)=interp_0( qndust, dust_p_level, p_level, nl_in )
+     ENDDO
+  ENDIF
+
+!!!!! MARS 
+
 
  END SUBROUTINE init_domain_rk
@@ -1008,3 +1040,34 @@
       end subroutine read_therm
 
+!!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+      subroutine read_dust(qdust,qndust,dust_p_level,n)
+      implicit none
+      integer n
+      real qdust(n),qndust(n),dust_p_level(n)
+      logical end_of_file
+
+      integer k
+
+! first element is the surface
+
+      open(unit=11,file='input_dust',form='formatted',status='old')
+      rewind(11)
+      end_of_file = .false.
+      k = 0
+      do while (.not. end_of_file)
+
+        read(11,*,end=102) qdust(k+1), qndust(k+1), dust_p_level(k+1)
+        write(*,*) k, qdust(k+1), qndust(k+1), dust_p_level(k+1)
+        k = k+1
+        go to 113
+ 102    end_of_file = .true.
+ 113    continue
+      enddo
+
+      close(unit=11,status = 'keep')
+
+      end subroutine read_dust
+!!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+
+
 END MODULE module_initialize_ideal
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort	(revision 769)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort	(revision 772)
@@ -374,7 +374,7 @@
         else if $LINUX then
            ## for ifort
-             set optim=" -DMESOSCALE -g -no-ftz -traceback -ftrapuv -fp-stack-check "
-             set optim90=" -DMESOSCALE -g -no-ftz -traceback -ftrapuv -fp-stack-check "
-             set optimtru90=" -DMESOSCALE -g -no-ftz -traceback -ftrapuv -fp-stack-check "
+             set optim=" -DMESOSCALE -g -no-ftz -traceback -ftrapuv -fp-stack-check -mcmodel=large -shared-intel"
+             set optim90=" -DMESOSCALE -g -no-ftz -traceback -ftrapuv -fp-stack-check -mcmodel=large -shared-intel"
+             set optimtru90=" -DMESOSCALE -g -no-ftz -traceback -ftrapuv -fp-stack-check -mcmodel=large -shared-intel"
         else 
            echo "pas d option debug predefinie pour cette machine"
Index: trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F
===================================================================
--- trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F	(revision 769)
+++ trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F	(revision 772)
@@ -41,4 +41,6 @@
         MARS_Z0, &
         CST_Z0, &
+        MARS_QDUST, &
+        MARS_QNDUST, &
 #endif
         MARS_GW, &
@@ -69,5 +71,4 @@
    USE module_model_constants
    USE module_wrf_error
-   USE module_init_utilities
 ! add new modules here, if needed ...
 
@@ -145,4 +146,6 @@
 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
      MARS_FLUXRAD,MARS_WSTAR
+REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN   )  :: &
+     MARS_QDUST, MARS_QNDUST
 #endif
 REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN   )  :: &
@@ -189,10 +192,4 @@
    INTEGER :: lctindex,ziindex
    LOGICAL :: end_of_file
-   ! *** ----------------------- ***
-
-   ! *** for Mars Mode 3         ***
-   INTEGER nm3
-   PARAMETER(nm3=1000)
-   REAL, DIMENSION(nm3) :: qdust,qndust,dust_p_level
    ! *** ----------------------- ***
 
@@ -871,4 +868,9 @@
 !--------------------------------!
 #ifdef NEWPHYS
+!!! Initialize SCALAR for MODE 3.
+IF ((MARS_MODE .EQ. 3) .and. (firstcall .EQV. .true.) .and. (.not. restart)) THEN
+     SCALAR(i,kps:kpe,j,2)=MARS_QDUST(i,kps:kpe,j)
+     SCALAR(i,kps:kpe,j,3)=MARS_QNDUST(i,kps:kpe,j)
+ENDIF
 IF (MARS_MODE .EQ. 0) THEN
     q_prof(:,1)=0.95
@@ -884,16 +886,4 @@
       q_prof(:,:) = 0.95
    ENDIF
-  ENDIF
-  !!! DUST AND DUSTN
-  IF (MARS_MODE .EQ. 3 .and. firstcall .EQV. .true. .and. (.not. restart)) THEN
-      call read_dust(qdust,qndust,dust_p_level,nm3)
-      if (dust_p_level(1) .lt. p_prof(1)) then !input profile needs rescaling to avoid a plateau. This happens when you use different sources to initialize the pressure of the LES and the input_dust. Typicaly: you use the MCD for input_therm and different runs for input_dust, that dont have the same surface pressure ! This trick is ok because we dont want to initialize with a very precise profile of dust, just a realistic one.
-         dust_p_level = dust_p_level * p_prof(1)/dust_p_level(1)         
-      endif
-      DO k=1, nlayer
-        q_prof(k,1) = interp_0(qdust, dust_p_level, p_prof(k), nm3)
-        q_prof(k,2) = interp_0(qndust, dust_p_level, p_prof(k), nm3)
-      ENDDO
-      SCALAR(i,kps:kpe,j,2:3)=q_prof(:,:)  ! because we need to initialize the value of scalar! 
   ENDIF
 #else
@@ -1717,34 +1707,3 @@
 !!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
 
-
-!!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-      subroutine read_dust(qdust,qndust,dust_p_level,n)
-      implicit none
-      integer n
-      real qdust(n),qndust(n),dust_p_level(n)
-      logical end_of_file
-
-      integer k
-
-! first element is the surface
-
-      open(unit=11,file='input_dust',form='formatted',status='old')
-      rewind(11)
-      end_of_file = .false.
-      k = 0
-      do while (.not. end_of_file)
-
-        read(11,*,end=102) qdust(k+1), qndust(k+1), dust_p_level(k+1)
-        write(*,*) k, qdust(k+1), qndust(k+1), dust_p_level(k+1)
-        k = k+1
-        go to 113
- 102    end_of_file = .true.
- 113    continue
-      enddo
-
-      close(unit=11,status = 'keep')
-
-      end subroutine read_dust
-!!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-
 END MODULE module_lmd_driver
