Index: LMDZ5/trunk/libf/phylmd/dyn1d/1DUTILS.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/dyn1d/1DUTILS.h	(revision 2904)
+++ LMDZ5/trunk/libf/phylmd/dyn1d/1DUTILS.h	(revision 2920)
@@ -482,4 +482,18 @@
        forc_omega =0
        CALL getin('forc_omega',forc_omega)
+
+!Config  Key  = forc_u
+!Config  Desc = forcage ou non par u
+!Config  Def  = false
+!Config  Help = forcage ou non par u
+       forc_u =0
+       CALL getin('forc_u',forc_u)
+
+!Config  Key  = forc_v
+!Config  Desc = forcage ou non par v
+!Config  Def  = false
+!Config  Help = forcage ou non par v
+       forc_v =0
+       CALL getin('forc_v',forc_v)
 
 !Config  Key  = forc_w
@@ -653,12 +667,9 @@
 
       modname = 'dyn1deta0 : '
-!!      nmq(1)="vap"
-!!      nmq(2)="cond"
-!!      do iq=3,nqtot
-!!        write(nmq(iq),'("tra",i1)') iq-2
-!!      enddo
-      DO iq = 1,nqtot
-        nmq(iq) = trim(tname(iq))
-      ENDDO
+      nmq(1)="vap"
+      nmq(2)="cond"
+      do iq=3,nqtot
+        write(nmq(iq),'("tra",i1)') iq-2
+      enddo
       print*,'in dyn1deta0 ',fichnom,klon,klev,nqtot
       CALL open_startphy(fichnom)
@@ -807,11 +818,8 @@
       CALL open_restartphy(fichnom)
       print*,'redm1 ',fichnom,klon,klev,nqtot
-!!      nmq(1)="vap"
-!!      nmq(2)="cond"
-!!      nmq(3)="tra1"
-!!      nmq(4)="tra2"
-      DO iq = 1,nqtot
-        nmq(iq) = trim(tname(iq))
-      ENDDO
+      nmq(1)="vap"
+      nmq(2)="cond"
+      nmq(3)="tra1"
+      nmq(4)="tra2"
 
       modname = 'dyn1dredem'
@@ -1396,5 +1404,4 @@
       cor(:) = rkappa*temp*(1.+q(:,1)*rv/rd)/(play*(1.+q(:,1)))
 
-
       do k=2,llm-1
 
@@ -2789,5 +2796,4 @@
          hq_mod_cas(l)= hq_prof_cas(k2) - frac*(hq_prof_cas(k2)-hq_prof_cas(k1))
          vq_mod_cas(l)= vq_prof_cas(k2) - frac*(vq_prof_cas(k2)-vq_prof_cas(k1))
-         dtrad_mod_cas(l)= dtrad_prof_cas(k2) - frac*(dtrad_prof_cas(k2)-dtrad_prof_cas(k1))
      
          else !play>plev_prof_cas(1)
@@ -2816,5 +2822,4 @@
          hq_mod_cas(l)= frac1*hq_prof_cas(k1) - frac2*hq_prof_cas(k2)
          vq_mod_cas(l)= frac1*vq_prof_cas(k1) - frac2*vq_prof_cas(k2)
-         dtrad_mod_cas(l)= frac1*dtrad_prof_cas(k1) - frac2*dtrad_prof_cas(k2)
 
          endif ! play.le.plev_prof_cas(1)
@@ -2845,5 +2850,4 @@
          hq_mod_cas(l)= hq_prof_cas(nlev_cas)*fact                            !jyg
          vq_mod_cas(l)= vq_prof_cas(nlev_cas)*fact                            !jyg
-         dtrad_mod_cas(l)= dtrad_prof_cas(nlev_cas)*fact                      !jyg
  
         endif ! play
@@ -5025,6 +5029,5 @@
       REAL tau
 !c      DATA tau /3600./
-!      DATA tau /5400./
-       DATA tau /43200./
+      DATA tau /5400./
 !
    INTEGER k,i
@@ -5038,6 +5041,5 @@
         DO k = 1,klev
          DO i = 1,klon
-!CR: nudging everywhere
-!           IF (paprs(i,1)-pplay(i,k) .GT. 10000.) THEN
+           IF (paprs(i,1)-pplay(i,k) .GT. 10000.) THEN
 !
             d_u(i,k) = d_u(i,k) + 1./tau*(u_targ(i,k)-u(i,k))
@@ -5046,5 +5048,5 @@
             print *,' k,u,d_u,v,d_v ',    &
                       k,u(i,k),d_u(i,k),v(i,k),d_v(i,k)
-!           ENDIF
+           ENDIF
 !
          ENDDO
@@ -5173,5 +5175,4 @@
          hq_mod_cas(l)= hq_prof_cas(k2) - frac*(hq_prof_cas(k2)-hq_prof_cas(k1))
          vq_mod_cas(l)= vq_prof_cas(k2) - frac*(vq_prof_cas(k2)-vq_prof_cas(k1))
-         dtrad_mod_cas(l)= dtrad_prof_cas(k2) - frac*(dtrad_prof_cas(k2)-dtrad_prof_cas(k1))
      
          else !play>plev_prof_cas(1)
@@ -5210,5 +5211,4 @@
          hq_mod_cas(l)= frac1*hq_prof_cas(k1) - frac2*hq_prof_cas(k2)
          vq_mod_cas(l)= frac1*vq_prof_cas(k1) - frac2*vq_prof_cas(k2)
-         dtrad_mod_cas(l)= frac1*dtrad_prof_cas(k1) - frac2*dtrad_prof_cas(k2)
 
          endif ! play.le.plev_prof_cas(1)
@@ -5247,5 +5247,4 @@
          hq_mod_cas(l)= hq_prof_cas(nlev_cas)*fact                     !jyg
          vq_mod_cas(l)= vq_prof_cas(nlev_cas)*fact                     !jyg
-         dtrad_mod_cas(l)= dtrad_prof_cas(nlev_cas)*fact               !jyg
  
         endif ! play
Index: LMDZ5/trunk/libf/phylmd/dyn1d/1D_interp_cases.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 2904)
+++ LMDZ5/trunk/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 2920)
@@ -37,5 +37,5 @@
 
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-       d_th_adv(l) = ht_gcssold(l)
+       d_t_adv(l) = ht_gcssold(l)
        d_q_adv(l,1) = hq_gcssold(l)
        dt_cooling(l) = 0.0
@@ -84,5 +84,5 @@
 
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-       d_th_adv(l) = alpha*omega(l)/rcpd-(ht_mod(l)+vt_mod(l))
+       d_t_adv(l) = alpha*omega(l)/rcpd-(ht_mod(l)+vt_mod(l))
        d_q_adv(l,1) = -(hq_mod(l)+vq_mod(l))
        dt_cooling(l) = 0.0
@@ -183,5 +183,5 @@
 
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-       d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-d_t_dyn_z(l)
+       d_t_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-d_t_dyn_z(l)
        d_q_adv(l,1) = hq_mod(l)-d_q_dyn_z(l)
        d_u_adv(l) = hu_mod(l)-d_u_dyn_z(l)
@@ -224,5 +224,5 @@
        ug(l)= ug_mod(l)
        vg(l)= vg_mod(l)
-       d_th_adv(l)=ht_mod(l)
+       d_t_adv(l)=ht_mod(l)
        d_q_adv(l,1)=hq_mod(l)
       enddo
@@ -315,10 +315,10 @@
 !calcul de l'advection totale
         if (cptadvw) then
-        d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-d_t_dyn_z(l)
+        d_t_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-d_t_dyn_z(l)
 !        print*,'temp vert adv',l,ht_mod(l),vt_mod(l),-d_t_dyn_z(l)
         d_q_adv(l,1) = hq_mod(l)-d_q_dyn_z(l)
 !        print*,'q vert adv',l,hq_mod(l),vq_mod(l),-d_q_dyn_z(l)
         else
-        d_th_adv(l) = alpha*omega(l)/rcpd+(ht_mod(l)+vt_mod(l))
+        d_t_adv(l) = alpha*omega(l)/rcpd+(ht_mod(l)+vt_mod(l))
         d_q_adv(l,1) = (hq_mod(l)+vq_mod(l))
         endif
@@ -392,9 +392,9 @@
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
 !calcul de l'advection totale
-!        d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-omega(l)*d_t_z(l)
+!        d_t_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)-omega(l)*d_t_z(l)
 !attention: on impose dth
-        d_th_adv(l) = alpha*omega(l)/rcpd+                                  &
+        d_t_adv(l) = alpha*omega(l)/rcpd+                                  &
      &         ht_mod(l)*(play(l)/pzero)**rkappa-omega(l)*d_t_z(l)
-!        d_th_adv(l) = 0.
+!        d_t_adv(l) = 0.
 !        print*,'temp vert adv',l,ht_mod(l),vt_mod(l),-d_t_dyn_z(l)
         d_q_adv(l,1) = hq_mod(l)-omega(l)*d_q_z(l)
@@ -417,10 +417,9 @@
 !---------------------------------------------------------------------
       if (forcing_rico) then
-!       call lstendH(llm,omega,dt_dyn,dq_dyn,du_dyn, dv_dyn,
-!     :  q,temp,u,v,play)
+!      call lstendH(llm,omega,dt_dyn,dq_dyn,du_dyn, dv_dyn,q,temp,u,v,play)
        call lstendH(llm,nqtot,omega,dt_dyn,dq_dyn,q,temp,u,v,play)
 
         do l=1,llm
-       d_th_adv(l) =  (dth_rico(l) +  dt_dyn(l))
+       d_t_adv(l) =  (dth_rico(l) +  dt_dyn(l))
        d_q_adv(l,1) = (dqh_rico(l) +  dq_dyn(l,1))
        d_q_adv(l,2) = 0.
@@ -458,27 +457,27 @@
        vg(l)= v_mod(l)
        IF((phi(l)/RG).LT.1000) THEN
-         d_th_adv(l) = (adv_theta_prof + rad_theta_prof)/3600.
+         d_t_adv(l) = (adv_theta_prof + rad_theta_prof)/3600.
          d_q_adv(l,1) = adv_qt_prof/1000./3600.
          d_q_adv(l,2) = 0.0
 !        print *,'INF1000: phi dth dq1 dq2',
-!    :  phi(l)/RG,d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2)
+!    :  phi(l)/RG,d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
        ELSEIF ((phi(l)/RG).GE.1000.AND.(phi(l)/RG).lt.3000) THEN
          fact=((phi(l)/RG)-1000.)/2000.
          fact=1-fact
-         d_th_adv(l) = (adv_theta_prof + rad_theta_prof)*fact/3600.
+         d_t_adv(l) = (adv_theta_prof + rad_theta_prof)*fact/3600.
          d_q_adv(l,1) = adv_qt_prof*fact/1000./3600.
          d_q_adv(l,2) = 0.0
 !        print *,'SUP1000: phi fact dth dq1 dq2',
-!    :  phi(l)/RG,fact,d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2)
+!    :  phi(l)/RG,fact,d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
        ELSE
-         d_th_adv(l) = 0.0
+         d_t_adv(l) = 0.0
          d_q_adv(l,1) = 0.0
          d_q_adv(l,2) = 0.0
 !        print *,'SUP3000: phi dth dq1 dq2',
-!    :  phi(l)/RG,d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2)
+!    :  phi(l)/RG,d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
        ENDIF
       dt_cooling(l) = 0.0  
 !     print *,'Interp armcu: phi dth dq1 dq2',
-!    :  l,phi(l),d_th_adv(l),d_q_adv(l,1),d_q_adv(l,2)
+!    :  l,phi(l),d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
       enddo
       endif ! forcing_armcu
@@ -554,9 +553,9 @@
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
 !
-!      d_th_adv(l) = 0.0
+!      d_t_adv(l) = 0.0
 !      d_q_adv(l,1) = 0.0
 !CR:test advection=0
 !calcul de l'advection verticale
-        d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l)
+        d_t_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l)
 !        print*,'temp adv',l,-d_t_dyn_z(l)
         d_q_adv(l,1) = -d_q_dyn_z(l)
@@ -637,9 +636,9 @@
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
 !
-!      d_th_adv(l) = 0.0
+!      d_t_adv(l) = 0.0
 !      d_q_adv(l,1) = 0.0
 !CR:test advection=0
 !calcul de l'advection verticale
-        d_th_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l)
+        d_t_adv(l) = alpha*omega(l)/rcpd-d_t_dyn_z(l)
 !        print*,'temp adv',l,-d_t_dyn_z(l)
         d_q_adv(l,1) = -d_q_dyn_z(l)
@@ -715,5 +714,7 @@
 
 !Calcul de l advection verticale
+
       d_t_dyn_z(:)=w_mod_cas(:)*d_t_z(:)
+
       d_q_dyn_z(:)=w_mod_cas(:)*d_q_z(:)
       d_u_dyn_z(:)=w_mod_cas(:)*d_u_z(:)
@@ -764,5 +765,5 @@
 
       do l = 1, llm
-       omega(l) = w_mod_cas(l)
+       omega(l) = w_mod_cas(l)  ! juste car w_mod_cas en Pa/s (MPL 20170310)
        omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
@@ -782,9 +783,9 @@
 
         if ((tend_t.eq.1).and.(tend_w.eq.0)) then
-!           d_th_adv(l)=alpha*omega(l)/rcpd+dt_mod_cas(l)
-           d_th_adv(l)=alpha*omega(l)/rcpd-dt_mod_cas(l)
+!           d_t_adv(l)=alpha*omega(l)/rcpd+dt_mod_cas(l)
+           d_t_adv(l)=alpha*omega(l)/rcpd-dt_mod_cas(l)
         else if ((tend_t.eq.1).and.(tend_w.eq.1)) then
-!           d_th_adv(l)=alpha*omega(l)/rcpd+ht_mod_cas(l)-d_t_dyn_z(l)
-           d_th_adv(l)=alpha*omega(l)/rcpd-ht_mod_cas(l)-d_t_dyn_z(l)
+!           d_t_adv(l)=alpha*omega(l)/rcpd+ht_mod_cas(l)-d_t_dyn_z(l)
+           d_t_adv(l)=alpha*omega(l)/rcpd-ht_mod_cas(l)-d_t_dyn_z(l)
         endif
 
@@ -816,5 +817,4 @@
       ENDIF
       endif ! forcing_case
-
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -877,24 +877,44 @@
       d_th_z(:)=0.
       d_q_z(:)=0.
+      d_u_z(:)=0.
+      d_v_z(:)=0.
       d_t_dyn_z(:)=0.
       d_th_dyn_z(:)=0.
       d_q_dyn_z(:)=0.
+      d_u_dyn_z(:)=0.
+      d_v_dyn_z(:)=0.
       DO l=2,llm-1
        d_t_z(l)=(temp(l+1)-temp(l-1))/(play(l+1)-play(l-1))
        d_th_z(l)=(teta(l+1)-teta(l-1))/(play(l+1)-play(l-1))
        d_q_z(l)=(q(l+1,1)-q(l-1,1))/(play(l+1)-play(l-1))
+       d_u_z(l)=(u(l+1)-u(l-1))/(play(l+1)-play(l-1))
+       d_v_z(l)=(v(l+1)-v(l-1))/(play(l+1)-play(l-1))
       ENDDO
       d_t_z(1)=d_t_z(2)
       d_th_z(1)=d_th_z(2)
       d_q_z(1)=d_q_z(2)
+      d_u_z(1)=d_u_z(2)
+      d_v_z(1)=d_v_z(2)
       d_t_z(llm)=d_t_z(llm-1)
       d_th_z(llm)=d_th_z(llm-1)
       d_q_z(llm)=d_q_z(llm-1)
+      d_u_z(llm)=d_u_z(llm-1)
+      d_v_z(llm)=d_v_z(llm-1)
 
 !Calcul de l advection verticale
-      d_t_dyn_z(:)=w_mod_cas(:)*d_t_z(:)
-      d_th_dyn_z(:)=w_mod_cas(:)*d_th_z(:)
-      d_q_dyn_z(:)=w_mod_cas(:)*d_q_z(:)
-
+! Modif w_mod_cas -> omega_mod_cas (MM+MPL 20170310)
+      d_t_dyn_z(:)=omega_mod_cas(:)*d_t_z(:)
+      d_th_dyn_z(:)=omega_mod_cas(:)*d_th_z(:)
+      d_q_dyn_z(:)=omega_mod_cas(:)*d_q_z(:)
+      d_u_dyn_z(:)=omega_mod_cas(:)*d_u_z(:)
+      d_v_dyn_z(:)=omega_mod_cas(:)*d_v_z(:)
+
+!geostrophic wind 
+      if (forc_geo.eq.1) then
+        do l=1,llm
+        ug(l) = ug_mod_cas(l) 
+        vg(l) = vg_mod_cas(l) 
+        enddo
+      endif
 !wind nudging 
       if (nudging_u.gt.0.) then
@@ -902,8 +922,8 @@
            u(l)=u(l)+timestep*(u_mod_cas(l)-u(l))/(nudge_u)
         enddo
-      else
-        do l=1,llm
-        ug(l) = u_mod_cas(l) 
-        enddo
+!     else
+!       do l=1,llm
+!          u(l) = u_mod_cas(l) 
+!       enddo
       endif
 
@@ -912,8 +932,8 @@
            v(l)=v(l)+timestep*(v_mod_cas(l)-v(l))/(nudge_v)
         enddo
-      else
-        do l=1,llm
-        vg(l) = v_mod_cas(l) 
-        enddo
+!     else
+!       do l=1,llm
+!          v(l) = v_mod_cas(l) 
+!       enddo
       endif
 
@@ -922,8 +942,8 @@
            w(l)=w(l)+timestep*(w_mod_cas(l)-w(l))/(nudge_w)
         enddo
-      else
-        do l=1,llm
-        w(l) = w_mod_cas(l) 
-        enddo
+ !    else
+ !      do l=1,llm
+ !         w(l) = w_mod_cas(l) 
+ !      enddo
       endif
 
@@ -941,43 +961,46 @@
 
       do l = 1, llm
-       omega(l) = w_mod_cas(l)
+! Modif w_mod_cas -> omega_mod_cas (MM+MPL 20170309)
+       omega(l) = omega_mod_cas(l)
        omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
 
-!calcul advection
-!       if ((tend_u.eq.1).and.(tend_w.eq.0)) then
-!          d_u_adv(l)=du_mod_cas(l)
-!       else if ((tend_u.eq.1).and.(tend_w.eq.1)) then
-!          d_u_adv(l)=hu_mod_cas(l)-d_u_dyn_z(l)
+!calcul advections
+        if ((forc_u.eq.1).and.(forc_w.eq.0)) then
+           d_u_adv(l)=du_mod_cas(l)
+        else if ((forc_u.eq.1).and.(forc_w.eq.1)) then
+           d_u_adv(l)=hu_mod_cas(l)-d_u_dyn_z(l)
+        endif
+
+        if ((forc_v.eq.1).and.(forc_w.eq.0)) then
+           d_v_adv(l)=dv_mod_cas(l)
+        else if ((forc_v.eq.1).and.(forc_w.eq.1)) then
+           d_v_adv(l)=hv_mod_cas(l)-d_v_dyn_z(l)
+        endif
+
+! Puisque dth a ete converti en dt, on traite de la meme facon 
+! les flags tadv et thadv
+        if ((tadv.eq.1.or.thadv.eq.1) .and. (forc_w.eq.0)) then
+!          d_t_adv(l)=alpha*omega(l)/rcpd-dt_mod_cas(l)
+           d_t_adv(l)=alpha*omega(l)/rcpd+dt_mod_cas(l)
+        else if ((tadv.eq.1.or.thadv.eq.1) .and. (forc_w.eq.1)) then
+!          d_t_adv(l)=alpha*omega(l)/rcpd-ht_mod_cas(l)-d_t_dyn_z(l)
+           d_t_adv(l)=alpha*omega(l)/rcpd+ht_mod_cas(l)-d_t_dyn_z(l)
+        endif
+
+!       if ((thadv.eq.1) .and. (forc_w.eq.0)) then
+!          d_t_adv(l)=alpha*omega(l)/rcpd-dth_mod_cas(l)
+!          d_t_adv(l)=alpha*omega(l)/rcpd+dth_mod_cas(l)
+!       else if ((thadv.eq.1) .and. (forc_w.eq.1)) then
+!          d_t_adv(l)=alpha*omega(l)/rcpd-hth_mod_cas(l)-d_t_dyn_z(l)
+!          d_t_adv(l)=alpha*omega(l)/rcpd+hth_mod_cas(l)-d_t_dyn_z(l)
 !       endif
-!
-!       if ((tend_v.eq.1).and.(tend_w.eq.0)) then
-!          d_v_adv(l)=dv_mod_cas(l)
-!       else if ((tend_v.eq.1).and.(tend_w.eq.1)) then
-!          d_v_adv(l)=hv_mod_cas(l)-d_v_dyn_z(l)
-!       endif
-!
-!-----------------------------------------------------
-        if (tadv.eq.1 .or. tadvh.eq.1) then
-           d_t_adv(l)=alpha*omega(l)/rcpd-dt_mod_cas(l)
-        else if (tadvv.eq.1) then
-! ATTENTION d_t_dyn_z pas calcule (voir twpice)
-           d_t_adv(l)=alpha*omega(l)/rcpd-ht_mod_cas(l)-d_t_dyn_z(l)
-        endif
-        print *,'interp_case d_t_dyn_z=',d_t_dyn_z(l),d_q_dyn_z(l)
-
-! Verifier le signe !!
-        if (thadv.eq.1 .or. thadvh.eq.1) then
-           d_th_adv(l)=dth_mod_cas(l)
-           print *,'dthadv=',d_th_adv(l)*86400.
-        else if (thadvv.eq.1) then
-           d_th_adv(l)=hth_mod_cas(l)-d_th_dyn_z(l)
-        endif
- 
-! Verifier le signe !!
-        if ((qadv.eq.1).and.(forc_w.eq.0)) then
+
+        if ((qadv.eq.1) .and. (forc_w.eq.0)) then
            d_q_adv(l,1)=dq_mod_cas(l)
-        else if ((qadvh.eq.1).and.(forc_w.eq.1)) then
+!          d_q_adv(l,1)=-1*dq_mod_cas(l)
+        else if ((qadv.eq.1) .and. (forc_w.eq.1)) then
            d_q_adv(l,1)=hq_mod_cas(l)-d_q_dyn_z(l)
+!          d_q_adv(l,1)=-1*hq_mod_cas(l)-d_q_dyn_z(l)
         endif
          
Index: LMDZ5/trunk/libf/phylmd/dyn1d/1D_read_forc_cases.h
===================================================================
--- LMDZ5/trunk/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 2904)
+++ LMDZ5/trunk/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 2920)
@@ -76,4 +76,5 @@
         dt_cooling(l)=thlpcar(kmax)-frac*(thlpcar(kmax)-thlpcar(kmax-1))
         do k=2,kmax
+          print *,'k l height(k) height(k-1) zlay(l) frac=',k,l,height(k),height(k-1),zlay(l),frac
           frac = (height(k)-zlay(l))/(height(k)-height(k-1))
           if(l==1) print*,'k, height, tttprof',k,height(k),tttprof(k)
@@ -227,5 +228,5 @@
 !?       omega2(l)=-rho(l)*omega(l)
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-       d_th_adv(l) = alpha*omega(l)/rcpd-(ht_mod(l)+vt_mod(l))
+       d_t_adv(l) = alpha*omega(l)/rcpd-(ht_mod(l)+vt_mod(l))
        d_q_adv(l,1) = -(hq_mod(l)+vq_mod(l))
        d_q_adv(l,2) = 0.0
@@ -280,5 +281,5 @@
 !on applique le forcage total au premier pas de temps
 !attention: signe different de toga
-       d_th_adv(l) = alpha*omega(l)/rcpd+(ht_mod(l)+vt_mod(l))
+       d_t_adv(l) = alpha*omega(l)/rcpd+(ht_mod(l)+vt_mod(l))
        d_q_adv(l,1) = (hq_mod(l)+vq_mod(l))
        d_q_adv(l,2) = 0.0
@@ -341,7 +342,7 @@
 !on applique le forcage total au premier pas de temps
 !attention: signe different de toga
-       d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)
+       d_t_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)
 !forcage en th
-!       d_th_adv(l) = ht_mod(l)
+!       d_t_adv(l) = ht_mod(l)
        d_q_adv(l,1) = hq_mod(l)
        d_q_adv(l,2) = 0.0
@@ -442,7 +443,7 @@
 !on applique le forcage total au premier pas de temps
 !attention: signe different de toga
-       d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)
+       d_t_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)
 !forcage en th
-!       d_th_adv(l) = ht_mod(l)
+!       d_t_adv(l) = ht_mod(l)
        d_q_adv(l,1) = hq_mod(l)
        d_q_adv(l,2) = 0.0
@@ -557,7 +558,7 @@
 !on applique le forcage total au premier pas de temps
 !attention: signe different de toga
-!      d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)
+!      d_t_adv(l) = alpha*omega(l)/rcpd+ht_mod(l)
 !forcage en th
-       d_th_adv(l) = ht_mod(l)
+       d_t_adv(l) = ht_mod(l)
        d_q_adv(l,1) = hq_mod(l)
        d_q_adv(l,2) = 0.0
@@ -657,16 +658,16 @@
 ! Advective forcings are given in K or g/kg ... per HOUR
 !      IF(height(l).LT.1000) THEN
-!        d_th_adv(l) = (adv_theta_prof + rad_theta_prof)/3600.
+!        d_t_adv(l) = (adv_theta_prof + rad_theta_prof)/3600.
 !        d_q_adv(l,1) = adv_qt_prof/1000./3600.
 !        d_q_adv(l,2) = 0.0
 !      ELSEIF (height(l).GE.1000.AND.height(l).LT.3000) THEN
-!        d_th_adv(l) = (adv_theta_prof + rad_theta_prof)*
+!        d_t_adv(l) = (adv_theta_prof + rad_theta_prof)*
 !    :               (1-(height(l)-1000.)/2000.)
-!        d_th_adv(l) = d_th_adv(l)/3600.
+!        d_t_adv(l) = d_t_adv(l)/3600.
 !        d_q_adv(l,1) = adv_qt_prof*(1-(height(l)-1000.)/2000.)
 !        d_q_adv(l,1) = d_q_adv(l,1)/1000./3600.
 !        d_q_adv(l,2) = 0.0
 !      ELSE
-!        d_th_adv(l) = 0.0
+!        d_t_adv(l) = 0.0
 !        d_q_adv(l,1) = 0.0
 !        d_q_adv(l,2) = 0.0
@@ -751,7 +752,7 @@
 !?       omega2(l)=-rho(l)*omega(l)
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-!      d_th_adv(l) = alpha*omega(l)/rcpd+vt_mod(l)
+!      d_t_adv(l) = alpha*omega(l)/rcpd+vt_mod(l)
 !      d_q_adv(l,1) = vq_mod(l)
-       d_th_adv(l) = alpha*omega(l)/rcpd
+       d_t_adv(l) = alpha*omega(l)/rcpd
        d_q_adv(l,1) = 0.0
        d_q_adv(l,2) = 0.0
@@ -827,7 +828,7 @@
 !      omega2(l)=-rho(l)*omega(l)
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-!      d_th_adv(l) = alpha*omega(l)/rcpd+vt_mod(l)
+!      d_t_adv(l) = alpha*omega(l)/rcpd+vt_mod(l)
 !      d_q_adv(l,1) = vq_mod(l)
-       d_th_adv(l) = alpha*omega(l)/rcpd
+       d_t_adv(l) = alpha*omega(l)/rcpd
        d_q_adv(l,1) = 0.0
        d_q_adv(l,2) = 0.0
@@ -890,9 +891,10 @@
 !on applique le forcage total au premier pas de temps
 !attention: signe different de toga
-       d_th_adv(l) = alpha*omega(l)/rcpd+(ht_mod_cas(l)+vt_mod_cas(l))
+       d_t_adv(l) = alpha*omega(l)/rcpd+(ht_mod_cas(l)+vt_mod_cas(l))
        d_q_adv(l,1) = (hq_mod_cas(l)+vq_mod_cas(l))
        d_q_adv(l,2) = 0.0
        d_u_adv(l) = (hu_mod_cas(l)+vu_mod_cas(l))
-       d_u_adv(l) = (hv_mod_cas(l)+vv_mod_cas(l))
+! correction bug d_u -> d_v (MM+MPL 20170310)
+       d_v_adv(l) = (hv_mod_cas(l)+vv_mod_cas(l))
       enddo     
 
@@ -971,8 +973,9 @@
        q(l,2) = ql_mod_cas(l)
        u(l) = u_mod_cas(l)
-       ug(l)= u_mod_cas(l)
+       ug(l)= ug_mod_cas(l)
        v(l) = v_mod_cas(l)
-       vg(l)= v_mod_cas(l)
-       omega(l) = w_mod_cas(l)
+       vg(l)= vg_mod_cas(l)
+! Modif w_mod_cas -> omega_mod_cas (MM+MPL 20170309)
+       omega(l) = omega_mod_cas(l)
        omega2(l)=omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq
 
@@ -980,5 +983,5 @@
 !on applique le forcage total au premier pas de temps
 !attention: signe different de toga
-       d_th_adv(l) = alpha*omega(l)/rcpd+(ht_mod_cas(l)+vt_mod_cas(l))
+       d_t_adv(l) = alpha*omega(l)/rcpd+(ht_mod_cas(l)+vt_mod_cas(l))
        d_t_adv(l) = alpha*omega(l)/rcpd+(ht_mod_cas(l)+vt_mod_cas(l))
 !      d_q_adv(l,1) = (hq_mod_cas(l)+vq_mod_cas(l))
@@ -987,6 +990,7 @@
 !      d_u_adv(l) = (hu_mod_cas(l)+vu_mod_cas(l))
        d_u_adv(l) = du_mod_cas(l)
-!      d_u_adv(l) = (hv_mod_cas(l)+vv_mod_cas(l))
-       d_u_adv(l) = dv_mod_cas(l)
+!      d_v_adv(l) = (hv_mod_cas(l)+vv_mod_cas(l))
+! correction bug d_u -> d_v (MM+MPL 20170310)
+       d_v_adv(l) = dv_mod_cas(l)
       enddo     
 
Index: LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90	(revision 2904)
+++ LMDZ5/trunk/libf/phylmd/dyn1d/lmdz1d.F90	(revision 2920)
@@ -20,6 +20,5 @@
        wake_deltaq, wake_deltat, wake_s, wake_dens, &
        zgam, zmax0, zmea, zpic, zsig, &
-       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, ql_ancien, qs_ancien, &
-       prlw_ancien, prsw_ancien, prw_ancien
+       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl
   
    USE dimphy
@@ -195,5 +194,5 @@
       real :: du_phys(llm),dv_phys(llm),dt_phys(llm)
       real :: dt_dyn(llm)
-      real :: dt_cooling(llm),d_t_adv(llm),d_th_adv(llm),d_t_nudge(llm)
+      real :: dt_cooling(llm),d_t_adv(llm),d_t_nudge(llm)
       real :: d_u_nudge(llm),d_v_nudge(llm)
       real :: du_adv(llm),dv_adv(llm)
@@ -207,5 +206,5 @@
       REAL, ALLOCATABLE, DIMENSION(:,:):: d_q_adv
       REAL, ALLOCATABLE, DIMENSION(:,:):: d_q_nudge
-!      REAL, ALLOCATABLE, DIMENSION(:):: d_th_adv
+!      REAL, ALLOCATABLE, DIMENSION(:):: d_t_adv
 
 !---------------------------------------------------------------------
@@ -272,5 +271,5 @@
       dt_dyn(:)=0.
       dt_cooling(:)=0.
-      d_th_adv(:)=0.
+      d_t_adv(:)=0.
       d_t_nudge(:)=0.
       d_u_nudge(:)=0.
@@ -405,4 +404,11 @@
        heure_ini_cas=0.
        pdt_cas=1800.         ! forcing frequency
+      elseif (forcing_type .eq.105) THEN ! bomex starts 16-12-2004 0h
+       forcing_case2 = .true.
+       year_ini_cas=1969
+       mth_ini_cas=6
+       day_deb=24
+       heure_ini_cas=0.
+       pdt_cas=1800.         ! forcing frequency
       elseif (forcing_type .eq.40) THEN
        forcing_GCSSold = .true.
@@ -574,5 +580,5 @@
       allocate(d_q_adv(llm,nqtot)) 
       allocate(d_q_nudge(llm,nqtot)) 
-!      allocate(d_th_adv(llm)) 
+!      allocate(d_t_adv(llm)) 
 
       q(:,:) = 0.
@@ -807,9 +813,4 @@
         t_ancien(1,:)=temp(:)
         q_ancien(1,:)=q(:,1)
-        ql_ancien = 0.
-        qs_ancien = 0.
-        prlw_ancien = 0.
-        prsw_ancien = 0.
-        prw_ancien = 0.
 !jyg<
 !!        pbl_tke(:,:,:)=1.e-8
@@ -1063,5 +1064,5 @@
          fcoriolis=0.0
          dt_cooling=0.0
-         d_th_adv=0.0
+         d_t_adv=0.0
          d_q_adv=0.0
        endif
@@ -1076,23 +1077,4 @@
           dt_cooling=0.
        endif
-
-!CRio:Attention modif spécifique cas de Caroline
-      if (forcing_les) then
-         fcoriolis=0.
-!Nudging
-        
-!on calcule dt_cooling
-        do l=1,llm
-        if (play(l).ge.20000.) then
-            dt_cooling(l)=-1.5/86400.
-        elseif ((play(l).ge.10000.).and.((play(l).lt.20000.))) then
-            dt_cooling(l)=-1.5/86400.*(play(l)-10000.)/(10000.)-1./86400.*(20000.-play(l))/10000.*(temp(l)-200.)
-        else
-            dt_cooling(l)=-1.*(temp(l)-200.)/86400.
-        endif
-        enddo
-
-      endif     
-!RC
 
       IF (prt_level >= 5) print*, 'fcoriolis, xlat,mxcalc ', &
@@ -1168,6 +1150,6 @@
         if (prt_level.ge.3) then
           print *,                                                          &
-     &    'physiq-> temp(1),dt_phys(1),d_th_adv(1),dt_cooling(1) ',         &
-     &              temp(1),dt_phys(1),d_th_adv(1),dt_cooling(1)
+     &    'physiq-> temp(1),dt_phys(1),d_t_adv(1),dt_cooling(1) ',         &
+     &              temp(1),dt_phys(1),d_t_adv(1),dt_cooling(1)
            print* ,'dv_phys=',dv_phys
            print* ,'dv_age=',dv_age
@@ -1180,5 +1162,5 @@
         temp(1:mxcalc)=temp(1:mxcalc)+timestep*(                            &
      &              dt_phys(1:mxcalc)                                       &
-     &             +d_th_adv(1:mxcalc)                                      &
+     &             +d_t_adv(1:mxcalc)                                      &
      &             +d_t_nudge(1:mxcalc)                                      &
      &             +dt_cooling(1:mxcalc))  ! Taux de chauffage ou refroid.
