Index: LMDZ6/trunk/libf/phylmd/clesphys_mod_h.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/clesphys_mod_h.f90	(revision 5469)
+++ LMDZ6/trunk/libf/phylmd/clesphys_mod_h.f90	(revision 5470)
@@ -22,5 +22,5 @@
           , co2_ppm0                                                   &
           , tau_thermals                                               &
-          , Cd_frein, zrel_oro_t, zpmm_orodr_t, zpmm_orolf_t, zstd_orodr_t &
+          , Cd_frein, nm_oro_t, zpmm_orodr_t, zpmm_orolf_t, zstd_orodr_t &
           , ecrit_LES                                                  &
           , ecrit_ins, ecrit_hf, ecrit_day                             &
@@ -55,6 +55,5 @@
 
   ! threshold on to activate SSO schemes
-  ! threshold on to activate SSO schemes
-  REAL zrel_oro_t, zpmm_orodr_t, zpmm_orolf_t, zstd_orodr_t
+  REAL nm_oro_t, zpmm_orodr_t, zpmm_orolf_t, zstd_orodr_t
   INTEGER iflag_cycle_diurne
   LOGICAL soil_model, new_oliq, ok_orodr, ok_orolf
Index: LMDZ6/trunk/libf/phylmd/conf_phys_m.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/conf_phys_m.f90	(revision 5469)
+++ LMDZ6/trunk/libf/phylmd/conf_phys_m.f90	(revision 5470)
@@ -213,5 +213,5 @@
     LOGICAL, SAVE :: ok_lic_cond_omp
     !
-    REAL, SAVE    :: zrel_oro_t_omp, zstd_orodr_t_omp
+    REAL, SAVE    :: nm_oro_t_omp, zstd_orodr_t_omp
     REAL, SAVE    :: zpmm_orodr_t_omp, zpmm_orolf_t_omp
     INTEGER, SAVE :: iflag_cycle_diurne_omp
@@ -893,10 +893,10 @@
 
 
-    !Config  Key  =  zrel_oro_t
-    !Config  Desc = zrel_oro_t
-    !Config  Def  = 9999.
+    !Config  Key  =  nm_oro_t
+    !Config  Desc = nm_oro_t
+    !Config  Def  = -1
     !Config  Help = Connais pas !
-    zrel_oro_t_omp = 9999.
-    CALL getin('zrel_oro_t', zrel_oro_t_omp)
+    nm_oro_t_omp = -1.
+    CALL getin('nm_oro_t', nm_oro_t_omp)
 
     !Config  Key  =  zstd_orodr_t
@@ -2313,5 +2313,5 @@
     ok_orodr = ok_orodr_omp
     ok_orolf = ok_orolf_omp
-    zrel_oro_t=zrel_oro_t_omp
+    nm_oro_t=nm_oro_t_omp
     zstd_orodr_t=zstd_orodr_t_omp
     zpmm_orodr_t=zpmm_orodr_t_omp
@@ -2732,5 +2732,5 @@
     WRITE(lunout,*) ' ok_orodr=',ok_orodr
     WRITE(lunout,*) ' ok_orolf=',ok_orolf
-    WRITE(lunout,*) ' zrel_oro_t=',zrel_oro_t
+    WRITE(lunout,*) ' nm_oro_t=',nm_oro_t
     WRITE(lunout,*) ' zstd_orodr_t=',zstd_orodr_t
     WRITE(lunout,*) ' zpmm_orodr_t=',zpmm_orodr_t
Index: LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 5469)
+++ LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 5470)
@@ -1019,5 +1019,5 @@
 
     REAL picefra(klon,klev)
-    REAL zrel_oro(klon)
+    REAL nm_oro(klon)
     !IM cf. AM 081204 END
     !
@@ -4841,4 +4841,15 @@
     ! a l'echelle sous-maille:
     !
+
+    ! calculation of nm_oro
+    DO i=1,klon
+          ! nm_oro is a proxy for the number of subgrid scale mountains
+          ! -> condition on nm_oro can deactivate the lifting on tilted planar terrains
+          !    such as ice sheets (work by V. Wiener)
+          ! in such a case, the SSO scheme should activate only where nm_oro>0 i.e. by setting
+          ! nm_oro_t=0.
+          nm_oro(i)=zsig(i)*sqrt(cell_area(i)*(pctsrf(i,is_ter)+pctsrf(i,is_lic)))/(4.*MAX(zstd(i),1.e-8))-1.
+    ENDDO
+
     IF (prt_level .GE.10) THEN
        print *,' call orography ? ', ok_orodr
@@ -4851,11 +4862,7 @@
        DO i=1,klon
           itest(i)=0
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the drag on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
           ! zpmm_orodr_t and zstd_orodr_t are activation thresholds set by F. Lott to
           ! earn computation time but they are not physical.
-          IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+          IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
@@ -4906,9 +4913,5 @@
        DO i=1,klon
           itest(i)=0
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the lifting on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          IF (((zpic(i)-zmea(i)).GT.zpmm_orolf_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+          IF (((zpic(i)-zmea(i)).GT.zpmm_orolf_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
@@ -5151,5 +5154,5 @@
 ! car on peut s'attendre a ce que les petites echelles produisent aussi de la TKE
 ! Mais attention, cela ne va pas dans le sens de la conservation de l'energie!
-          IF ((zstd(i).GT.1.0) .AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+          IF ((zstd(i).GT.1.0) .AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
@@ -5163,5 +5166,5 @@
        DO i=1,klon
           itest(i)=0
-        IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+        IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
Index: LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 5469)
+++ LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 5470)
@@ -1121,5 +1121,5 @@
 
     REAL picefra(klon,klev)
-    REAL zrel_oro(klon)
+    REAL nm_oro(klon)
     !IM cf. AM 081204 END
     !
@@ -6283,8 +6283,19 @@
     ! a l'echelle sous-maille:
     !
+   
+    ! calculation of nm_oro 
+    DO i=1,klon
+          ! nm_oro is a proxy for the number of subgrid scale mountains
+          ! -> condition on nm_oro can deactivate the lifting on tilted planar terrains
+          !    such as ice sheets (work by V. Wiener)
+          ! in such a case, the SSO scheme should activate only where nm_oro>0 i.e. by setting
+          ! nm_oro_t=0.
+          nm_oro(i)=zsig(i)*sqrt(cell_area(i)*(pctsrf(i,is_ter)+pctsrf(i,is_lic)))/(4.*MAX(zstd(i),1.e-8))-1.
+    END DO
+
     IF (prt_level .GE.10) THEN
        print *,' call orography ? ', ok_orodr
     ENDIF
-    !
+
     IF (ok_orodr) THEN
        !
@@ -6293,11 +6304,7 @@
        DO i=1,klon
           itest(i)=0
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the drag on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
           ! zpmm_orodr_t and zstd_orodr_t are activation thresholds set by F. Lott to
           ! earn computation time but they are not physical.
-          IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+          IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
@@ -6352,9 +6359,5 @@
        DO i=1,klon
           itest(i)=0
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the lifting on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          IF (((zpic(i)-zmea(i)).GT.zpmm_orolf_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+          IF (((zpic(i)-zmea(i)).GT.zpmm_orolf_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
@@ -6630,5 +6633,5 @@
 ! car on peut s'attendre a ce que les petites echelles produisent aussi de la TKE
 ! Mais attention, cela ne va pas dans le sens de la conservation de l'energie! 
-          IF ((zstd(i).GT.1.0) .AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+          IF ((zstd(i).GT.1.0) .AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
@@ -6642,5 +6645,5 @@
        DO i=1,klon
           itest(i)=0
-        IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
+        IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
              itest(i)=1
              igwd=igwd+1
