Index: /LMDZ5/trunk/libf/phylmd/calwake.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/calwake.F90	(revision 2999)
+++ /LMDZ5/trunk/libf/phylmd/calwake.F90	(revision 3000)
@@ -72,4 +72,6 @@
   ! Variable internes
   ! -----------------
+  LOGICAL, SAVE                                      :: first = .TRUE.
+  !$OMP THREADPRIVATE(first)
   INTEGER                                            :: i, l
   INTEGER, DIMENSION(klon)                           :: znatsurf    ! 0 if pctsrf(is_oce)>0.1; 1 else.
@@ -177,5 +179,5 @@
 
   DO i = 1, klon
-    wdens(i) = wake_dens(i)
+    wdens(i) = max(0., wake_dens(i))
   END DO
 
@@ -298,5 +300,14 @@
       wake_dens(i) = wdens(i)
     END DO
-  ENDIF
+  ENDIF  ! (iflag_wake_tend .EQ. 0)
+!
+  IF (first) THEN
+    DO i = 1,klon
+      IF (wake_dens(i) < -1.) THEN
+        wake_dens(i) = wdens(i)
+      ENDIF
+    ENDDO
+    first=.false.
+  ENDIF  ! (first)
 !>jyg
 
Index: /LMDZ5/trunk/libf/phylmd/phyetat0.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/phyetat0.F90	(revision 2999)
+++ /LMDZ5/trunk/libf/phylmd/phyetat0.F90	(revision 3000)
@@ -398,5 +398,10 @@
   found=phyetat0_get(klev,wake_deltaq,"WAKE_DELTAQ","Delta hum. wake/env",0.)
   found=phyetat0_get(1,wake_s,"WAKE_S","Wake frac. area",0.)
-  found=phyetat0_get(1,wake_dens,"WAKE_DENS","Wake num. /unit area",0.)
+!jyg<
+!  Set wake_dens to -1000. when there is no restart so that the actual
+!  initialization is made in calwake.
+!!  found=phyetat0_get(1,wake_dens,"WAKE_DENS","Wake num. /unit area",0.)
+  found=phyetat0_get(1,wake_dens,"WAKE_DENS","Wake num. /unit area",-1000.)
+!>jyg
   found=phyetat0_get(1,wake_cstar,"WAKE_CSTAR","WAKE_CSTAR",0.)
   found=phyetat0_get(1,wake_pe,"WAKE_PE","WAKE_PE",0.)
Index: /LMDZ5/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2999)
+++ /LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 3000)
@@ -566,4 +566,9 @@
                                                      ! updated within calwake
     !$OMP THREADPRIVATE(iflag_wake_tend)
+    INTEGER,  SAVE               :: iflag_alp_wk_cond=0 ! wake: if =0, then Alp_wk is the average lifting
+                                                        ! power provided by the wakes; else, Alp_wk is the
+                                                        ! lifting power conditionned on the presence of a 
+                                                        ! gust-front in the grid cell.
+    !$OMP THREADPRIVATE(iflag_alp_wk_cond)
     REAL t_w(klon,klev),q_w(klon,klev) ! temperature and moisture profiles in the wake region
     REAL t_x(klon,klev),q_x(klon,klev) ! temperature and moisture profiles in the off-wake region
@@ -591,4 +596,5 @@
     !>jyg
 
+    REAL wake_fip_0(klon)           ! Average Front Incoming Power (unconditionned)
     REAL wake_gfl(klon)             ! Gust Front Length
 !!!    REAL wake_dens(klon)         ! moved to phys_state_var_mod
@@ -1226,4 +1232,5 @@
     IF (debut) THEN
        CALL suphel ! initialiser constantes et parametres phys.
+       CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond) 
        CALL getin_p('random_notrig_max',random_notrig_max)
        CALL getin_p('ok_adjwk',ok_adjwk) 
@@ -2805,5 +2812,6 @@
                wake_deltat, wake_deltaq, wake_s, wake_dens,  &
                wake_dth, wake_h,  &
-               wake_pe, wake_fip, wake_gfl,  &
+!!               wake_pe, wake_fip, wake_gfl,  &
+               wake_pe, wake_fip_0, wake_gfl,  &   !! jyg
                d_t_wake, d_q_wake,  &
                wake_k, t_x, q_x,  &
@@ -2835,4 +2843,12 @@
           call prt_enerbil('wake',itap)
        ENDIF   ! (iflag_wake_tend .GT. 0.)
+
+       IF (iflag_alp_wk_cond .GT. 0.) THEN
+
+         CALL alpale_wk(dtime, cell_area, wake_k, wake_s, wake_dens, wake_fip_0, &
+                        wake_fip)
+       ELSE
+         wake_fip(:) = wake_fip_0(:)
+       ENDIF   ! (iflag_alp_wk_cond .GT. 0.)
 
     ENDIF  ! (iflag_wake>=1)
