Index: LMDZ6/trunk/libf/phylmd/dyn1d/1D_decl_cases.h
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/1D_decl_cases.h	(revision 4094)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/1D_decl_cases.h	(revision 4104)
@@ -34,5 +34,5 @@
         real w_mod(llm), t_mod(llm),q_mod(llm)
         real u_mod(llm),v_mod(llm), ht_mod(llm),vt_mod(llm),ug_mod(llm),vg_mod(llm)
-	    real temp_nudg_mod(llm),qv_nudg_mod(llm),u_nudg_mod(llm),v_nudg_mod(llm)
+	    real temp_nudg_mod(llm),qv_nudg_mod(llm),u_nudg_mod(llm),v_nudg_mod(llm)       
         real hq_mod(llm),vq_mod(llm),qv_mod(llm),ql_mod(llm),qt_mod(llm)
         real th_mod(llm)
@@ -286,4 +286,5 @@
         real ug_mod_cas(llm),vg_mod_cas(llm)
         real temp_nudg_mod_cas(llm),qv_nudg_mod_cas(llm),v_nudg_mod_cas(llm),u_nudg_mod_cas(llm)
+        real invtau_temp_nudg_mod_cas(llm),invtau_qv_nudg_mod_cas(llm),invtau_v_nudg_mod_cas(llm),invtau_u_nudg_mod_cas(llm)
         real u_mod_cas(llm),v_mod_cas(llm)
         real omega_mod_cas(llm),tke_mod_cas(llm+1)
Index: LMDZ6/trunk/libf/phylmd/dyn1d/1D_interp_cases.h
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 4094)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 4104)
@@ -13,4 +13,5 @@
      &       ,u_cas,v_cas,ug_cas,vg_cas                                                     &
      &       ,temp_nudg_cas,qv_nudg_cas,u_nudg_cas,v_nudg_cas                               &
+     &       ,invtau_temp_nudg_cas,invtau_qv_nudg_cas,invtau_u_nudg_cas,invtau_v_nudg_cas    &
      &       ,vitw_cas,omega_cas,tke_cas,du_cas,hu_cas,vu_cas                                       &
      &       ,dv_cas,hv_cas,vv_cas,dt_cas,ht_cas,vt_cas,dtrad_cas                           &
@@ -22,4 +23,5 @@
      &       ,u_prof_cas,v_prof_cas,ug_prof_cas,vg_prof_cas                                 &
      &       ,temp_nudg_prof_cas,qv_nudg_prof_cas,u_nudg_prof_cas,v_nudg_prof_cas           &
+     &       ,invtau_temp_nudg_prof_cas,invtau_qv_nudg_prof_cas,invtau_u_nudg_prof_cas,invtau_v_nudg_prof_cas  &     
      &       ,vitw_prof_cas,omega_prof_cas,tke_prof_cas                                     &
      &       ,du_prof_cas,hu_prof_cas,vu_prof_cas                                           &
@@ -39,4 +41,6 @@
      &         ,ug_prof_cas,vg_prof_cas                                                                   &
      &         ,temp_nudg_prof_cas,qv_nudg_prof_cas,u_nudg_prof_cas,v_nudg_prof_cas                       &
+     &         ,invtau_temp_nudg_prof_cas,invtau_qv_nudg_prof_cas,invtau_u_nudg_prof_cas,invtau_v_nudg_prof_cas &
+
      &         ,vitw_prof_cas,omega_prof_cas,tke_prof_cas                                                 &
      &         ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas                   &
@@ -47,4 +51,5 @@
      &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas                                                 &
      &         ,temp_nudg_mod_cas,qv_nudg_mod_cas,u_nudg_mod_cas,v_nudg_mod_cas                           &
+     &         ,invtau_temp_nudg_mod_cas,invtau_qv_nudg_mod_cas,invtau_u_nudg_mod_cas,invtau_v_nudg_mod_cas   &     
      &         ,w_mod_cas,omega_mod_cas,tke_mod_cas                                                       &
      &         ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas                         &
Index: LMDZ6/trunk/libf/phylmd/dyn1d/1D_read_forc_cases.h
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 4094)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 4104)
@@ -27,5 +27,6 @@
      &       ,u_cas,v_cas,ug_cas,vg_cas                                                     &
      &       ,temp_nudg_cas,qv_nudg_cas,u_nudg_cas,v_nudg_cas                               &
-     &       ,vitw_cas,omega_cas,tke_cas,du_cas,hu_cas,vu_cas                                       &
+     &       ,invtau_temp_nudg_cas,invtau_qv_nudg_cas,invtau_u_nudg_cas,invtau_v_nudg_cas    &
+     &       ,vitw_cas,omega_cas,tke_cas,du_cas,hu_cas,vu_cas                               &
      &       ,dv_cas,hv_cas,vv_cas,dt_cas,ht_cas,vt_cas,dtrad_cas                           &
      &       ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas       &
@@ -36,4 +37,5 @@
      &       ,u_prof_cas,v_prof_cas,ug_prof_cas,vg_prof_cas                                 &
      &       ,temp_nudg_prof_cas,qv_nudg_prof_cas,u_nudg_prof_cas,v_nudg_prof_cas           &
+     &       ,invtau_temp_nudg_prof_cas,invtau_qv_nudg_prof_cas,invtau_u_nudg_prof_cas,invtau_v_nudg_prof_cas &
      &       ,vitw_prof_cas,omega_prof_cas,tke_prof_cas                                    &
      &       ,du_prof_cas,hu_prof_cas,vu_prof_cas                                           &
@@ -54,5 +56,5 @@
      &         ,ug_prof_cas,vg_prof_cas                                                                   &
      &       ,temp_nudg_prof_cas,qv_nudg_prof_cas,u_nudg_prof_cas,v_nudg_prof_cas                         &
-
+     &       ,invtau_temp_nudg_prof_cas,invtau_qv_nudg_prof_cas,invtau_u_nudg_prof_cas,invtau_v_nudg_prof_cas       &
      &         ,vitw_prof_cas,omega_prof_cas,tke_prof_cas                                                 &
      &         ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas                   &
@@ -63,4 +65,5 @@
      &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas                                                 &
      &         ,temp_nudg_mod_cas,qv_nudg_mod_cas,u_nudg_mod_cas,v_nudg_mod_cas                           &
+     &         ,invtau_temp_nudg_mod_cas,invtau_qv_nudg_mod_cas,invtau_u_nudg_mod_cas,invtau_v_nudg_mod_cas        &
      &         ,w_mod_cas,omega_mod_cas,tke_mod_cas                                                       &
      &         ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas                         &
Index: LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 4094)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 4104)
@@ -326,5 +326,4 @@
       REAL, ALLOCATABLE :: time_val(:)
 
-      print*,'ON EST VRAIMENT LA'
       fich_cas='cas.nc'
       print*,'fich_cas ',fich_cas
Index: LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 4094)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 4104)
@@ -29,4 +29,5 @@
         real, allocatable::  ug_cas(:,:),vg_cas(:,:)
         real, allocatable::  temp_nudg_cas(:,:),qv_nudg_cas(:,:),u_nudg_cas(:,:),v_nudg_cas(:,:)
+        real, allocatable::  invtau_temp_nudg_cas(:,:),invtau_qv_nudg_cas(:,:),invtau_u_nudg_cas(:,:),invtau_v_nudg_cas(:,:)
         real, allocatable::  lat_cas(:),sens_cas(:),ts_cas(:),ps_cas(:),ustar_cas(:)
         real, allocatable::  uw_cas(:,:),vw_cas(:,:),q1_cas(:,:),q2_cas(:,:),tkes_cas(:)
@@ -52,4 +53,6 @@
         real, allocatable::  vg_prof_cas(:)
         real, allocatable::  temp_nudg_prof_cas(:),qv_nudg_prof_cas(:),u_nudg_prof_cas(:),v_nudg_prof_cas(:)
+        real, allocatable::  invtau_temp_nudg_prof_cas(:),invtau_qv_nudg_prof_cas(:),invtau_u_nudg_prof_cas(:),invtau_v_nudg_prof_cas(:)
+
         real, allocatable::  ht_prof_cas(:)
         real, allocatable::  hth_prof_cas(:)
@@ -74,6 +77,6 @@
 
 
-        real lat_prof_cas,sens_prof_cas,ts_prof_cas,ps_prof_cas,ustar_prof_cas,tkes_prof_cas
-        real o3_cas,orog_cas,albedo_cas,emiss_cas,t_skin_cas,q_skin_cas,mom_rough,heat_rough,rugos_cas,sand_cas,clay_cas
+        real o3_cas,lat_prof_cas,sens_prof_cas,ts_prof_cas,ps_prof_cas,ustar_prof_cas,tkes_prof_cas
+        real orog_cas,albedo_cas,emiss_cas,t_skin_cas,q_skin_cas,mom_rough,heat_rough,rugos_cas,sand_cas,clay_cas
       
 
@@ -93,5 +96,4 @@
       REAL, ALLOCATABLE :: time_val(:)
 
-      print*,'ON EST VRAIMENT DASN MOD_1D_CASES_READ_STD'
       fich_cas='cas.nc'
       print*,'fich_cas ',fich_cas
@@ -180,4 +182,6 @@
         allocate(temp_nudg_cas(nlev_cas,nt_cas),qv_nudg_cas(nlev_cas,nt_cas))
         allocate(u_nudg_cas(nlev_cas,nt_cas),v_nudg_cas(nlev_cas,nt_cas))
+        allocate(invtau_temp_nudg_cas(nlev_cas,nt_cas),invtau_qv_nudg_cas(nlev_cas,nt_cas))
+        allocate(invtau_u_nudg_cas(nlev_cas,nt_cas),invtau_v_nudg_cas(nlev_cas,nt_cas))
         allocate(lat_cas(nt_cas),sens_cas(nt_cas),ts_cas(nt_cas),ps_cas(nt_cas),ustar_cas(nt_cas),tkes_cas(nt_cas))
         allocate(uw_cas(nlev_cas,nt_cas),vw_cas(nlev_cas,nt_cas),q1_cas(nlev_cas,nt_cas),q2_cas(nlev_cas,nt_cas))
@@ -206,4 +210,6 @@
         allocate(temp_nudg_prof_cas(nlev_cas),qv_nudg_prof_cas(nlev_cas))
         allocate(u_nudg_prof_cas(nlev_cas),v_nudg_prof_cas(nlev_cas))
+        allocate(invtau_temp_nudg_prof_cas(nlev_cas),invtau_qv_nudg_prof_cas(nlev_cas))
+        allocate(invtau_u_nudg_prof_cas(nlev_cas),invtau_v_nudg_prof_cas(nlev_cas))
         allocate(ht_prof_cas(nlev_cas))
         allocate(hth_prof_cas(nlev_cas))
@@ -232,4 +238,5 @@
      &     ql_cas,qi_cas,rh_cas,rv_cas,u_cas,v_cas,vitw_cas,omega_cas,tke_cas,ug_cas,vg_cas,                            &
      &     temp_nudg_cas,qv_nudg_cas,u_nudg_cas,v_nudg_cas,                                                     &
+     &     invtau_temp_nudg_cas,invtau_qv_nudg_cas,invtau_u_nudg_cas,invtau_v_nudg_cas,                         &
      &     du_cas,hu_cas,vu_cas,                                                                                &
      &     dv_cas,hv_cas,vv_cas,dt_cas,ht_cas,vt_cas,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,               &
@@ -289,4 +296,5 @@
         deallocate(vg_prof_cas)
         deallocate(temp_nudg_prof_cas,qv_nudg_prof_cas,u_nudg_prof_cas,v_nudg_prof_cas)
+        deallocate(invtau_temp_nudg_prof_cas,invtau_qv_nudg_prof_cas,invtau_u_nudg_prof_cas,invtau_v_nudg_prof_cas)
         deallocate(ht_prof_cas)
         deallocate(hq_prof_cas)
@@ -317,4 +325,5 @@
      &     ap,bp,zz,pp,zzh,pph,temp,theta,thv,thl,qv,ql,qi,rh,rv,u,v,vitw,omega,tke,ug,vg,&
      &     temp_nudg,qv_nudg,u_nudg,v_nudg,                                        &
+     &     invtau_temp_nudg,invtau_qv_nudg,invtau_u_nudg,invtau_v_nudg,             &
      &     du,hu,vu,dv,hv,vv,dt,ht,vt,dq,hq,vq,                                    &
      &     dth,hth,vth,dr,hr,vr,dtrad,sens,flat,ts,ps,ustar,tkes,uw,vw,q1,q2,       &
@@ -339,4 +348,5 @@
       real u(nlevel,ntime),v(nlevel,ntime),tkes(ntime)
       real temp_nudg(nlevel,ntime),qv_nudg(nlevel,ntime),u_nudg(nlevel,ntime),v_nudg(nlevel,ntime)
+      real invtau_temp_nudg(nlevel,ntime),invtau_qv_nudg(nlevel,ntime),invtau_u_nudg(nlevel,ntime),invtau_v_nudg(nlevel,ntime)
       real ug(nlevel,ntime),vg(nlevel,ntime)
       real vitw(nlevel,ntime),omega(nlevel,ntime),tke(nlevel,ntime)
@@ -355,28 +365,65 @@
 
 
-      integer nid, ierr,ierr1,ierr2,rid,i
+      integer nid, ierr,ierr1,ierr2,rid,i,int_test
       integer nbvar3d
-      parameter(nbvar3d=74)
+      parameter(nbvar3d=78)
       integer var3didin(nbvar3d),missing_var(nbvar3d)
       character*13 name_var(1:nbvar3d)
 
 
+!      data name_var/ &
+!     ! coordonnees pression (n+1 niveaux) #4
+!     & 'coor_par_a','coor_par_b','height_h','pressure_h',& ! #1-#4
+!     ! coordonnees pression (n niveaux) #8
+!     &'temp','qv','ql','qi','u','v','tke','pressure',& ! #5-#12
+!     ! coordonnees pression + temps #42
+!     &'w','omega','ug','vg','uadv','uadvh','uadvv','vadv','vadvh','vadvv','temp_adv','tadvh','tadvv',& !  #13 - #25
+!     &'qv_adv','qvadvh','qvadvv','thadv','thadvh','thadvv','thladvh',                             & ! #26 - #32
+!     & 'radv','radvh','radvv','radcool','q1','q2','ustress','vstress',                           & ! #33 - #40
+!     & 'rh','temp_nudging','qv_nudging','u_nudging','v_nudging',                                       & ! #41-45
+!     &'height_f','pressure_forc','tempt','theta','thv','thl','qvt','qlt','qit','rv','ut','vt',   & ! #46-58
+!     ! coordonnees temps #12
+!     &'tkes','sfc_sens_flx','sfc_lat_flx','ts','ps','ustar',&
+!     &'orog','albedo','emiss','t_skin','q_skin','mom_rough','heat_rough',&
+!     ! scalaires #4
+!     &'o3','rugos','clay','sand'/
+
+
+
       data name_var/ &
      ! coordonnees pression (n+1 niveaux) #4
-     & 'coor_par_a','coor_par_b','height_h','pressure_h',& ! #1-#4
+     & 'coor_par_a','coor_par_b','zf','pressure_h',& ! #1-#4
      ! coordonnees pression (n niveaux) #8
-     &'temp','qv','ql','qi','u','v','tke','pressure',& ! #5-#12
-     ! coordonnees pression + temps #42
-     &'w','omega','ug','vg','uadv','uadvh','uadvv','vadv','vadvh','vadvv','temp_adv','tadvh','tadvv',& !  #13 - #25
-     &'qv_adv','qvadvh','qvadvv','thadv','thadvh','thadvv','thladvh',                             & ! #26 - #32
-     & 'radv','radvh','radvv','radcool','q1','q2','ustress','vstress',                           & ! #33 - #40
-     & 'rh','temp_nudging','qv_nudging','u_nudging','v_nudging',                                       & ! #41-45
-     &'height_f','pressure_forc','tempt','theta','thv','thl','qvt','qlt','qit','rv','ut','vt',   & ! #46-58
+     & 'ta','qv','ql','qi','ua','va','tke','pa',& ! #5-#12
+     ! coordonnees pression + temps #46
+     & 'wa','wap','ug','vg','tnua_adv','tnua_advh','tnua_advv','tnva_adv','tnva_advh','tnva_advv','tnta_adv','tnta_advh','tnta_advv',& !  #13 - #25
+     & 'tnqv_adv','tnqv_advh','tnqv_advv','thadv','thadvh','thadvv','thladvh',                             & ! #26 - #32
+     & 'radv','radvh','radvv','tnta_rad','q1','q2','ustress','vstress',                           & ! #33 - #40
+     & 'rh','ta_nud','qv_nud','ua_nud','va_nud',                                       & ! #41-45
+     & 'zh_forc','pa_forc','tat','thetat','thetavt','thetalt','qvt','qlt','qit','rv','uat','vat',   & ! #46-57
+     & 'nudging_constant_ta', 'nudging_constant_qv', 'nudging_constant_ua', 'nudging_constant_va',           & ! # 58-61
      ! coordonnees temps #12
-     &'tkes','sfc_sens_flx','sfc_lat_flx','ts','ps','ustar',&
-     &'orog','albedo','emiss','t_skin','q_skin','mom_rough','heat_rough',&
-     ! scalaires #4
-     &'o3','rugos','clay','sand'/
-
+     & 'tkes','hfss','hfls','ts_forc','ps_forc','ustar', &                                        ! 62-67
+     & 'orog','albedo','emiss','t_skin','q_skin','z0','z0h',       &                    ! 68-74
+     ! scalaires #4                               
+     & 'O3','rugos','clay','sand'/                                                      ! 75-78
+
+
+!-----------------------------------------------------------------------
+! First check that we are using a version > v2 of the 1D standard format
+! use the difference between 'temp' (old version) and 'ta' (new version)
+!-----------------------------------------------------------------------
+
+
+         ierr=NF_INQ_VARID(nid,'ta',int_test)
+         if(ierr/=NF_NOERR) then
+           print*, '++++++++++++++++++++++++++++++'
+           print*, 'variable ta missing in cas.nc '
+           print*, 'You are probably using an obsolete version of the 1D cases'
+           print*, 'please dowload the last version of the 1D archive from https://lmdz.lmd.jussieu.fr/pub/'
+           print*, '++++++++++++++++++++++++++++++'
+           CALL abort_gcm ('mod_1D_cases_read_std','bad version of 1D directory',0)
+         endif
+     
 !-----------------------------------------------------------------------
 ! Checking availability of variable #i in the cas.nc file
@@ -387,4 +434,5 @@
          missing_var(i)=0.
          ierr=NF_INQ_VARID(nid,name_var(i),var3didin(i)) 
+         print*, 'name_var(i)', name_var(i), var3didin(i)
          if(ierr/=NF_NOERR) then
            print *,'Variable manquante dans cas.nc:',i,name_var(i)
@@ -399,7 +447,7 @@
 ! A MODIFIER: il faudrait dire nudging_temp mais faut le declarer dans compar1d.h etc...        
 !           if ( name_var(i) == 'temp_nudging' .and. nint(nudging_t)==0) stop 'Nudging inconsistency temp'
-            if ( name_var(i) == 'qv_nudging' .and. nint(nudging_qv)==0) stop 'Nudging inconsistency qv'
-            if ( name_var(i) == 'u_nudging' .and. nint(nudging_u)==0) stop 'Nudging inconsistency u'
-            if ( name_var(i) == 'v_nudging' .and. nint(nudging_u)==0) stop 'Nudging inconsistency v'
+            if ( name_var(i) == 'qv_nud' .and. nint(nudging_qv)==0) stop 'Nudging inconsistency qv'
+            if ( name_var(i) == 'ua_nud' .and. nint(nudging_u)==0) stop 'Nudging inconsistency u'
+            if ( name_var(i) == 'va_nud' .and. nint(nudging_v)==0) stop 'Nudging inconsistency v'
     ELSE
              print*,'GUIDAGE : CONSISTENCY CHECK DEACTIVATED FOR TESTS of SANDU/REF'
@@ -441,5 +489,5 @@
 !  TBD : seems to be the same as above.
 !-----------------------------------------------------------------------
-           else if(i.gt.12.and.i.LE.57) then
+           else if(i.gt.12.and.i.LE.61) then
 #ifdef NC_DOUBLE
            ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul)
@@ -457,5 +505,5 @@
 !  Reading 1D time variables (time,lat,lon)
 !-----------------------------------------------------------------------
-           else if (i.gt.57.and.i.LE.63) then
+           else if (i.gt.62.and.i.LE.75) then
 #ifdef NC_DOUBLE
            ierr = NF_GET_VAR_DOUBLE(nid,var3didin(i),resul2)
@@ -549,21 +597,25 @@
            case(56) ; u=resul
            case(57) ; v=resul
-           case(58) ; tkes=resul2   ! donnees indexees en time
-           case(59) ; sens=resul2
-           case(60) ; flat=resul2
-           case(61) ; ts=resul2
-           case(62) ; ps=resul2
-           case(63) ; ustar=resul2
-           case(64) ; orog_cas=resul3      ! constantes
-           case(65) ; albedo_cas=resul3
-           case(66) ; emiss_cas=resul3
-           case(67) ; t_skin_cas=resul3
-           case(68) ; q_skin_cas=resul3
-           case(69) ; mom_rough=resul3
-           case(70) ; heat_rough=resul3
-           case(71) ; o3_cas=resul3        
-           case(72) ; rugos_cas=resul3
-           case(73) ; clay_cas=resul3
-           case(74) ; sand_cas=resul3
+           case(58) ; invtau_temp_nudg=resul
+           case(59) ; invtau_qv_nudg=resul
+           case(60) ; invtau_u_nudg=resul
+           case(61) ; invtau_v_nudg=resul
+           case(62) ; tkes=resul2   ! donnees indexees en time
+           case(63) ; sens=resul2
+           case(64) ; flat=resul2
+           case(65) ; ts=resul2
+           case(66) ; ps=resul2
+           case(67) ; ustar=resul2
+           case(68) ; orog_cas=resul3      ! constantes
+           case(69) ; albedo_cas=resul3
+           case(70) ; emiss_cas=resul3
+           case(71) ; t_skin_cas=resul3
+           case(72) ; q_skin_cas=resul3
+           case(73) ; mom_rough=resul3
+           case(74) ; heat_rough=resul3
+           case(75) ; o3_cas=resul3        
+           case(76) ; rugos_cas=resul3
+           case(77) ; clay_cas=resul3
+           case(78) ; sand_cas=resul3
          end select
          resul=0.
@@ -606,4 +658,5 @@
      &         ,qv_cas,ql_cas,qi_cas,u_cas,v_cas                                  &
      &         ,ug_cas,vg_cas,temp_nudg_cas,qv_nudg_cas,u_nudg_cas,v_nudg_cas     &
+     &         ,invtau_temp_nudg_cas,invtau_qv_nudg_cas,invtau_u_nudg_cas,invtau_v_nudg_cas     &
      &         ,vitw_cas,omega_cas,tke_cas,du_cas,hu_cas,vu_cas             &
      &         ,dv_cas,hv_cas,vv_cas,dt_cas,ht_cas,vt_cas,dtrad_cas               &
@@ -616,4 +669,5 @@
      &         ,u_prof_cas,v_prof_cas,ug_prof_cas,vg_prof_cas                     &
      &         ,temp_nudg_prof_cas,qv_nudg_prof_cas,u_nudg_prof_cas,v_nudg_prof_cas     &
+     &         ,invtau_temp_nudg_prof_cas,invtau_qv_nudg_prof_cas,invtau_u_nudg_prof_cas,invtau_v_nudg_prof_cas     &     
      &         ,vitw_prof_cas,omega_prof_cas,tke_prof_cas,du_prof_cas,hu_prof_cas,vu_prof_cas  &
      &         ,dv_prof_cas,hv_prof_cas,vv_prof_cas,dt_prof_cas                   &
@@ -656,4 +710,7 @@
         real u_nudg_cas(nlev_cas,nt_cas),v_nudg_cas(nlev_cas,nt_cas)
 
+        real invtau_temp_nudg_cas(nlev_cas,nt_cas),invtau_qv_nudg_cas(nlev_cas,nt_cas)
+        real invtau_u_nudg_cas(nlev_cas,nt_cas),invtau_v_nudg_cas(nlev_cas,nt_cas)
+
         real vitw_cas(nlev_cas,nt_cas),omega_cas(nlev_cas,nt_cas),tke_cas(nlev_cas,nt_cas)
         real du_cas(nlev_cas,nt_cas),hu_cas(nlev_cas,nt_cas),vu_cas(nlev_cas,nt_cas)
@@ -675,4 +732,7 @@
         real temp_nudg_prof_cas(nlev_cas),qv_nudg_prof_cas(nlev_cas)
         real u_nudg_prof_cas(nlev_cas),v_nudg_prof_cas(nlev_cas)
+
+        real invtau_temp_nudg_prof_cas(nlev_cas),invtau_qv_nudg_prof_cas(nlev_cas)
+        real invtau_u_nudg_prof_cas(nlev_cas),invtau_v_nudg_prof_cas(nlev_cas)
 
         real vitw_prof_cas(nlev_cas),omega_prof_cas(nlev_cas),tke_prof_cas(nlev_cas)
@@ -810,4 +870,12 @@
         v_nudg_prof_cas(k) = v_nudg_cas(k,it_cas2)                          &
      &          -frac*(v_nudg_cas(k,it_cas2)-v_nudg_cas(k,it_cas1))
+        invtau_temp_nudg_prof_cas(k) = invtau_temp_nudg_cas(k,it_cas2)                    &
+     &          -frac*(invtau_temp_nudg_cas(k,it_cas2)-invtau_temp_nudg_cas(k,it_cas1))
+        invtau_qv_nudg_prof_cas(k) = invtau_qv_nudg_cas(k,it_cas2)                        &
+     &          -frac*(invtau_qv_nudg_cas(k,it_cas2)-invtau_qv_nudg_cas(k,it_cas1))
+        invtau_u_nudg_prof_cas(k) = invtau_u_nudg_cas(k,it_cas2)                          &
+     &          -frac*(invtau_u_nudg_cas(k,it_cas2)-invtau_u_nudg_cas(k,it_cas1))
+        invtau_v_nudg_prof_cas(k) = invtau_v_nudg_cas(k,it_cas2)                          &
+     &          -frac*(invtau_v_nudg_cas(k,it_cas2)-invtau_v_nudg_cas(k,it_cas1))
         vitw_prof_cas(k) = vitw_cas(k,it_cas2)                           &
      &          -frac*(vitw_cas(k,it_cas2)-vitw_cas(k,it_cas1))
@@ -868,4 +936,5 @@
      &         ,ug_prof_cas,vg_prof_cas                                                                &
      &         ,temp_nudg_prof_cas,qv_nudg_prof_cas,u_nudg_prof_cas,v_nudg_prof_cas                    &
+     &         ,invtau_temp_nudg_prof_cas,invtau_qv_nudg_prof_cas,invtau_u_nudg_prof_cas,invtau_v_nudg_prof_cas &     
      &         ,vitw_prof_cas,omega_prof_cas,tke_prof_cas                                              &
      &         ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas                &
@@ -877,4 +946,5 @@
      &         ,ug_mod_cas,vg_mod_cas                                                                  &
      &         ,temp_nudg_mod_cas,qv_nudg_mod_cas,u_nudg_mod_cas,v_nudg_mod_cas                        &
+     &         ,invtau_temp_nudg_mod_cas,invtau_qv_nudg_mod_cas,invtau_u_nudg_mod_cas,invtau_v_nudg_mod_cas                        &     
      &         ,w_mod_cas,omega_mod_cas,tke_mod_cas                                                    &
      &         ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas                      &
@@ -907,4 +977,6 @@
        real temp_nudg_prof_cas(nlev_cas),qv_nudg_prof_cas(nlev_cas)
        real u_nudg_prof_cas(nlev_cas),v_nudg_prof_cas(nlev_cas)
+       real invtau_temp_nudg_prof_cas(nlev_cas),invtau_qv_nudg_prof_cas(nlev_cas)
+       real invtau_u_nudg_prof_cas(nlev_cas),invtau_v_nudg_prof_cas(nlev_cas)
 
        real du_prof_cas(nlev_cas),hu_prof_cas(nlev_cas),vu_prof_cas(nlev_cas)
@@ -920,4 +992,6 @@
        real temp_nudg_mod_cas(llm),qv_nudg_mod_cas(llm)
        real u_nudg_mod_cas(llm),v_nudg_mod_cas(llm)
+       real invtau_temp_nudg_mod_cas(llm),invtau_qv_nudg_mod_cas(llm)
+       real invtau_u_nudg_mod_cas(llm),invtau_v_nudg_mod_cas(llm)
        real du_mod_cas(llm),hu_mod_cas(llm),vu_mod_cas(llm)
        real dv_mod_cas(llm),hv_mod_cas(llm),vv_mod_cas(llm)
@@ -979,4 +1053,10 @@
          u_nudg_mod_cas(l)= u_nudg_prof_cas(k2) - frac*(u_nudg_prof_cas(k2)-u_nudg_prof_cas(k1))
          v_nudg_mod_cas(l)= v_nudg_prof_cas(k2) - frac*(v_nudg_prof_cas(k2)-v_nudg_prof_cas(k1))
+
+         invtau_temp_nudg_mod_cas(l)= invtau_temp_nudg_prof_cas(k2) - frac*(invtau_temp_nudg_prof_cas(k2)-invtau_temp_nudg_prof_cas(k1))
+         invtau_qv_nudg_mod_cas(l)= invtau_qv_nudg_prof_cas(k2) - frac*(invtau_qv_nudg_prof_cas(k2)-invtau_qv_nudg_prof_cas(k1))
+         invtau_u_nudg_mod_cas(l)= invtau_u_nudg_prof_cas(k2) - frac*(invtau_u_nudg_prof_cas(k2)-invtau_u_nudg_prof_cas(k1))
+         invtau_v_nudg_mod_cas(l)= invtau_v_nudg_prof_cas(k2) - frac*(invtau_v_nudg_prof_cas(k2)-invtau_v_nudg_prof_cas(k1))
+
          w_mod_cas(l)= vitw_prof_cas(k2) - frac*(vitw_prof_cas(k2)-vitw_prof_cas(k1))
          omega_mod_cas(l)= omega_prof_cas(k2) - frac*(omega_prof_cas(k2)-omega_prof_cas(k1))
@@ -1021,4 +1101,10 @@
          u_nudg_mod_cas(l)= frac1*u_nudg_prof_cas(k1) - frac2*u_nudg_prof_cas(k2)
          v_nudg_mod_cas(l)= frac1*v_nudg_prof_cas(k1) - frac2*v_nudg_prof_cas(k2)
+
+         invtau_temp_nudg_mod_cas(l)= frac1*invtau_temp_nudg_prof_cas(k1) - frac2*invtau_temp_nudg_prof_cas(k2)
+         invtau_qv_nudg_mod_cas(l)= frac1*invtau_qv_nudg_prof_cas(k1) - frac2*invtau_qv_nudg_prof_cas(k2)
+         invtau_u_nudg_mod_cas(l)= frac1*invtau_u_nudg_prof_cas(k1) - frac2*invtau_u_nudg_prof_cas(k2)
+         invtau_v_nudg_mod_cas(l)= frac1*invtau_v_nudg_prof_cas(k1) - frac2*invtau_v_nudg_prof_cas(k2)
+
          w_mod_cas(l)= frac1*vitw_prof_cas(k1) - frac2*vitw_prof_cas(k2)
          omega_mod_cas(l)= frac1*omega_prof_cas(k1) - frac2*omega_prof_cas(k2)
@@ -1063,4 +1149,10 @@
          u_nudg_mod_cas(l)= u_nudg_prof_cas(nlev_cas)                  !jyg
          v_nudg_mod_cas(l)= v_nudg_prof_cas(nlev_cas)                  !jyg
+
+         invtau_temp_nudg_mod_cas(l)= invtau_temp_nudg_prof_cas(nlev_cas)            !jyg
+         invtau_qv_nudg_mod_cas(l)= invtau_qv_nudg_prof_cas(nlev_cas)                !jyg
+         invtau_u_nudg_mod_cas(l)= invtau_u_nudg_prof_cas(nlev_cas)                  !jyg
+         invtau_v_nudg_mod_cas(l)= invtau_v_nudg_prof_cas(nlev_cas)                  !jyg
+
          thv_mod_cas(l)= thv_prof_cas(nlev_cas)                        !jyg
          w_mod_cas(l)= 0.0                                             !jyg
Index: LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90	(revision 4094)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/old_lmdz1d.F90	(revision 4104)
@@ -889,5 +889,5 @@
         clwcon=0.
         zmax0 = 0.
-        zmea=0.
+        zmea=zsurf
         zstd=0.
         zsig=0.
Index: LMDZ6/trunk/libf/phylmd/dyn1d/scm.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/dyn1d/scm.F90	(revision 4094)
+++ LMDZ6/trunk/libf/phylmd/dyn1d/scm.F90	(revision 4104)
@@ -654,5 +654,5 @@
         clwcon=0.
         zmax0 = 0.
-        zmea=0.
+        zmea=zsurf
         zstd=0.
         zsig=0.
@@ -815,6 +815,8 @@
 !  Geopotential :
 !---------------------------------------------------------------------
-!        phis(1)=zsurf*RG
+        phis(1)=zsurf*RG
 !        phi(1)=phis(1)+RD*temp(1)*(plev(1)-play(1))/(.5*(plev(1)+play(1)))
+
+        ! Calculate geopotential from the ground surface since phi and phis are added in physiq_mod
         phi(1)=RD*temp(1)*(plev(1)-play(1))/(.5*(plev(1)+play(1)))
 
@@ -823,5 +825,4 @@
      &    (play(l)-play(l+1))/(play(l)+play(l+1))
         enddo
-
 
 !---------------------------------------------------------------------
@@ -852,7 +853,5 @@
       d_t_adv(:)=d_t_adv(:)+d_t_vert_adv(:)
       d_q_adv(:,1)=d_q_adv(:,1)+d_q_vert_adv(:,1)
-
-      print*,'OMEGA ',w_adv(10),z_adv(10)
-
+   
    ENDIF
 
@@ -938,4 +937,6 @@
 !---------------------------------------------------------------------
 !  Nudging
+!  EV: rewrite the section to account for a time- and height-varying
+!  nudging
 !---------------------------------------------------------------------
       d_t_nudge(:) = 0.
@@ -943,13 +944,56 @@
       d_v_nudge(:) = 0.
       d_q_nudge(:,:) = 0.
+
       DO l=1,llm
-         IF ( play(l) < p_nudging_u .AND. nint(nudging_u) /= 0 ) &
+
+         IF (nudging_u .LT. 0) THEN
+              
+             d_u_nudge(l)=(u_nudg_mod_cas(l)-u(l))*invtau_u_nudg_mod_cas(l)
+       
+         ELSE
+
+             IF ( play(l) < p_nudging_u .AND. nint(nudging_u) /= 0 ) &
              & d_u_nudge(l)=(u_nudg_mod_cas(l)-u(l))/nudging_u
-         IF ( play(l) < p_nudging_v .AND. nint(nudging_v) /= 0 ) &
+
+         ENDIF 
+
+
+         IF (nudging_v .LT. 0) THEN
+              
+             d_v_nudge(l)=(v_nudg_mod_cas(l)-v(l))*invtau_v_nudg_mod_cas(l)
+       
+         ELSE
+
+
+             IF ( play(l) < p_nudging_v .AND. nint(nudging_v) /= 0 ) &
              & d_v_nudge(l)=(v_nudg_mod_cas(l)-v(l))/nudging_v
-         IF ( play(l) < p_nudging_t .AND. nint(nudging_t) /= 0 ) &
+
+         ENDIF
+
+
+         IF (nudging_t .LT. 0) THEN
+              
+             d_t_nudge(l)=(temp_nudg_mod_cas(l)-temp(l))*invtau_temp_nudg_mod_cas(l)
+       
+         ELSE
+
+
+             IF ( play(l) < p_nudging_t .AND. nint(nudging_t) /= 0 ) &
              & d_t_nudge(l)=(temp_nudg_mod_cas(l)-temp(l))/nudging_t
-         IF ( play(l) < p_nudging_qv .AND. nint(nudging_qv) /= 0 ) &
+
+          ENDIF
+
+
+         IF (nudging_qv .LT. 0) THEN
+              
+             d_q_nudge(l,1)=(qv_nudg_mod_cas(l)-q(l,1))*invtau_qv_nudg_mod_cas(l)
+       
+         ELSE
+
+             IF ( play(l) < p_nudging_qv .AND. nint(nudging_qv) /= 0 ) &
              & d_q_nudge(l,1)=(qv_nudg_mod_cas(l)-q(l,1))/nudging_qv
+
+         ENDIF
+
       ENDDO
 
@@ -957,4 +1001,5 @@
 !  Optional outputs
 !---------------------------------------------------------------------
+
 #ifdef OUTPUT_PHYS_SCM
       CALL iophys_ecrit('w_adv',klev,'w_adv','K/day',w_adv)
