Index: /trunk/LMDZ.MARS/libf/phymars/meso_inc/meso_inc_invar.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/meso_inc/meso_inc_invar.F	(revision 677)
+++ /trunk/LMDZ.MARS/libf/phymars/meso_inc/meso_inc_invar.F	(revision 678)
@@ -1,6 +1,6 @@
      $            ,wtsurf,wtsoil,wemis,wq2,wqsurf,wco2ice
      $            ,wtnom,wisoil,wdsoil
+     $            ,wfluxrad,wwstar
      $            ,wday_ini
      $            ,output_tab2d, output_tab3d
-     $            ,wfluxrad,wwstar
      $            ,flag_LES
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 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/module_first_rk_step_part1.F	(revision 678)
@@ -623,8 +623,8 @@
      &        ,MARS_TSOIL=grid%mars_tsoil                                 &
      &        ,MARS_Q2=grid%mars_q2                                       &
+     &        ,MARS_TSURF=grid%mars_tsurf                                 &
+#ifdef NEWPHYS
      &        ,MARS_FLUXRAD=grid%mars_fluxrad                             &
      &        ,MARS_WSTAR=grid%mars_wstar                                 &
-     &        ,MARS_TSURF=grid%mars_tsurf                                 &
-#ifdef NEWPHYS
      &        ,MARS_ISOIL=grid%mars_isoil       &
      &        ,MARS_DSOIL=grid%mars_dsoil       &
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq1.inc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq1.inc	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq1.inc	(revision 678)
@@ -12,8 +12,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
 	       output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq2.inc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq2.inc	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq2.inc	(revision 678)
@@ -15,8 +15,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -29,8 +29,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq3.inc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq3.inc	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq3.inc	(revision 678)
@@ -15,8 +15,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -29,8 +29,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -43,8 +43,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq4.inc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq4.inc	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq4.inc	(revision 678)
@@ -15,8 +15,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -29,8 +29,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -43,8 +43,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -57,8 +57,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq5.inc
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq5.inc	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/call_meso_physiq5.inc	(revision 678)
@@ -15,8 +15,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -29,8 +29,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -43,8 +43,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -57,8 +57,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
@@ -71,8 +71,8 @@
 #ifdef NEWPHYS
                wtnom, wisoil, wdsoil, &
+               wfluxrad,wwstar,               &
 #endif
                wday_ini,                      &
                output_tab2d, output_tab3d,    &
-               wfluxrad,wwstar,               &
                flag_LES)
 
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/module_initialize_real.F	(revision 678)
@@ -280,6 +280,4 @@
 !! >> Used for restarts only:
               grid%mars_q2(i,:,j)=0.
-              grid%mars_fluxrad(i,j)=0.
-              grid%mars_wstar(i,j)=0.
               grid%mars_tsurf(i,j)=0. 
 !! <<
@@ -295,4 +293,7 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 #ifdef NEWPHYS
+
+              grid%mars_wstar(i,:,j)=0.  !! used for restarts
+              grid%mars_fluxrad(i,j)=0.  !! used for restarts
 
               grid%mars_z0(i,j) = 0.
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/dyn_em/solve_em.F	(revision 678)
@@ -864,8 +864,8 @@
      &        ,MARS_TSOIL=grid%mars_tsoil       &
      &        ,MARS_Q2=grid%mars_q2             &
+     &        ,MARS_TSURF=grid%mars_tsurf       &
+#ifdef NEWPHYS
      &        ,MARS_FLUXRAD=grid%mars_fluxrad   &
      &        ,MARS_WSTAR=grid%mars_wstar       &
-     &        ,MARS_TSURF=grid%mars_tsurf       &
-#ifdef NEWPHYS
      &        ,MARS_ISOIL=grid%mars_isoil       &
      &        ,MARS_DSOIL=grid%mars_dsoil       &
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 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F	(revision 678)
@@ -33,8 +33,8 @@
         MARS_TSOIL, &
         MARS_Q2, &
+        MARS_TSURF, &
+#ifdef NEWPHYS
         MARS_FLUXRAD, &
         MARS_WSTAR, &
-        MARS_TSURF, &
-#ifdef NEWPHYS
         MARS_ISOIL, &
         MARS_DSOIL, &
@@ -123,5 +123,5 @@
 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
      MARS_CICE,MARS_WICE, &
-     MARS_FLUXRAD,MARS_WSTAR,MARS_TSURF
+     MARS_TSURF
 ! 3D arrays 
 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: &
@@ -142,4 +142,6 @@
 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN   )  :: &
      MARS_Z0
+REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT   )  :: &
+     MARS_FLUXRAD,MARS_WSTAR
 #endif
 REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN   )  :: &
@@ -197,8 +199,8 @@
    REAL :: zmea_val,zstd_val,zsig_val,zgam_val,zthe_val
    REAL :: theta_val, psi_val
-   REAL :: wstar_val,fluxrad_val
    LOGICAL :: firstcall,lastcall,tracerdyn
    REAL,DIMENSION(:),ALLOCATABLE :: q2_val, qsurf_val, tsoil_val
 #ifdef NEWPHYS
+   REAL :: wstar_val,fluxrad_val
    REAL,DIMENSION(:),ALLOCATABLE :: isoil_val, dsoil_val
    REAL :: z0_val
@@ -209,7 +211,8 @@
    REAL,DIMENSION(:),ALLOCATABLE :: wtheta, wpsi
    ! v--- can they be modified ?
-   REAL,DIMENSION(:),ALLOCATABLE :: wtsurf,wco2ice,wemis,wwstar,wfluxrad
+   REAL,DIMENSION(:),ALLOCATABLE :: wtsurf,wco2ice,wemis
    REAL,DIMENSION(:,:),ALLOCATABLE :: wq2,wqsurf,wtsoil 
 #ifdef NEWPHYS
+   REAL,DIMENSION(:),ALLOCATABLE :: wwstar,wfluxrad
    REAL,DIMENSION(:),ALLOCATABLE :: wz0tab
    REAL,DIMENSION(:,:),ALLOCATABLE :: wisoil,wdsoil
@@ -274,6 +277,4 @@
              save_tsurf_restart
       REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
-             save_fluxrad_restart
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
              save_co2ice_restart
       REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: &
@@ -281,6 +282,10 @@
       REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: &
              save_qsurf_restart
+#ifdef NEWPHYS
       REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
              save_wstar_restart
+      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
+             save_fluxrad_restart
+#endif
 
 !!!IDEALIZED IDEALIZED
@@ -432,17 +437,19 @@
 ! Restart save arrays
 ALLOCATE(save_tsoil_restart(ngrid,nsoil))
-ALLOCATE(save_fluxrad_restart(ngrid))
 ALLOCATE(save_co2ice_restart(ngrid))
 ALLOCATE(save_q2_restart(ngrid,nlayer+1))
 ALLOCATE(save_qsurf_restart(ngrid,nq))
-ALLOCATE(save_wstar_restart(ngrid))
 ALLOCATE(save_tsurf_restart(ngrid))
 save_tsoil_restart(:,:)=0.
-save_fluxrad_restart(:)=0.
 save_co2ice_restart(:)=0.
 save_q2_restart(:,:)=0.
 save_qsurf_restart(:,:)=0.
+save_tsurf_restart(:)=0.
+#ifdef NEWPHYS
+ALLOCATE(save_wstar_restart(ngrid))
+ALLOCATE(save_fluxrad_restart(ngrid))
 save_wstar_restart(:)=0.
-save_tsurf_restart(:)=0.
+save_fluxrad_restart(:)=0.
+#endif
 
 !! put here some general information you'd like to print just once
@@ -666,7 +673,7 @@
 ALLOCATE(wqsurf(ngrid,nq))       !!!!!
 ALLOCATE(wtsoil(ngrid,nsoil))    !!!!!
+#ifdef NEWPHYS
 ALLOCATE(wfluxrad(ngrid))
 ALLOCATE(wwstar(ngrid))
-#ifdef NEWPHYS
 ALLOCATE(wisoil(ngrid,nsoil))    !!!!!
 ALLOCATE(wdsoil(ngrid,nsoil))    !!!!!
@@ -1089,10 +1096,14 @@
 IF (.not. restart) THEN
    q2_val(:)=0.      !PBL wind variance
+#ifdef NEWPHYS
    fluxrad_val=0.
    wstar_val=0.
+#endif
 ELSE
    q2_val(:)=MARS_Q2(i,:,j)
+#ifdef NEWPHYS
    fluxrad_val=MARS_FLUXRAD(i,j)
    wstar_val=MARS_WSTAR(i,j)
+#endif
 ENDIF
 
@@ -1115,9 +1126,9 @@
 wemis(subs) = emis_val
 wq2(subs,:) = q2_val(:)
+wqsurf(subs,:) = qsurf_val(:)
+wtsoil(subs,:) = tsoil_val(:)
+#ifdef NEWPHYS
 wfluxrad(subs) = fluxrad_val
 wwstar(subs) = wstar_val
-wqsurf(subs,:) = qsurf_val(:)
-wtsoil(subs,:) = tsoil_val(:)
-#ifdef NEWPHYS
 wisoil(subs,:) = isoil_val(:)
 wdsoil(subs,:) = dsoil_val(:)
@@ -1343,17 +1354,19 @@
 #endif
 save_tsoil_restart(:,:)=wtsoil(:,:)
-save_fluxrad_restart(:)=wfluxrad(:)
 save_co2ice_restart(:)=wco2ice(:)
 save_q2_restart(:,:)=wq2(:,:)
 save_qsurf_restart(:,:)=wqsurf(:,:)
-save_wstar_restart(:)=wwstar(:)
 save_tsurf_restart(:)=wtsurf(:)
 DEALLOCATE(wtsoil)
-DEALLOCATE(wfluxrad)
 DEALLOCATE(wco2ice)
 DEALLOCATE(wq2)
 DEALLOCATE(wqsurf)
+DEALLOCATE(wtsurf)
+#ifdef NEWPHYS
+save_wstar_restart(:)=wwstar(:)
+save_fluxrad_restart(:)=wfluxrad(:)
+DEALLOCATE(wfluxrad)
 DEALLOCATE(wwstar)
-DEALLOCATE(wtsurf)
+#endif
 ENDIF call_physics
 
@@ -1439,15 +1452,16 @@
 ! Save key variables for restart !  
 !------------------------------------!
-
 MARS_TSOIL(i,:,j)=save_tsoil_restart(subs,:)
-MARS_FLUXRAD(i,j)=save_fluxrad_restart(subs)
 MARS_CICE(i,j)=save_co2ice_restart(subs)
 MARS_Q2(i,:,j)=save_q2_restart(subs,:)
 SELECT CASE (MARS_MODE)
    CASE (1,11,12)
-     MARS_WICE(i,j)=save_qsurf_restart(subs,2)
+     MARS_WICE(i,j)=save_qsurf_restart(subs,2)  !! see above Tracer at surface
 END SELECT
+MARS_TSURF(i,j)=save_tsurf_restart(subs)
+#ifdef NEWPHYS
 MARS_WSTAR(i,j)=save_wstar_restart(subs)
-MARS_TSURF(i,j)=save_tsurf_restart(subs)
+MARS_FLUXRAD(i,j)=save_fluxrad_restart(subs)
+#endif
 
 !---------!
Index: /trunk/MESOSCALE/LMD_MM_MARS/makemeso
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 677)
+++ /trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 678)
@@ -35,5 +35,5 @@
 phys=""
 scenario=""
-while getopts "drc:njhgbpfs:x" options; do
+while getopts "drc:njhgpfs:x" options; do
   case $options in
    d ) donotcompile=1;;       ## just to check the compile folder
@@ -554,4 +554,5 @@
     echo 'DEBUG DEBUG DEBUG DEBUG'
     sed s+"#-g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah
+    #sed s+"#-g"+"-g -Ktrap=fp -Mbounds"+g configure.wrf > yeah 
     #sed s+"#-g"+"-g"+g configure.wrf > yeah
     mv -f yeah configure.wrf
