Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/YOEGWD.h
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/YOEGWD.h	(revision 153)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/YOEGWD.h	(revision 155)
@@ -3,4 +3,7 @@
 C     -----------------------------------------------------------------
 C
+      integer NKTOPG,NSTRA
+      real GFRCRIT,GKWAKE,GRCRIT,GVCRIT,GKDRAG,GKLIFT
+      real GHMAX,GRAHILO,GSIGCR,GSSEC,GTSEC,GVSEC
       COMMON/YOEGWD/ GFRCRIT,GKWAKE,GRCRIT,GVCRIT,GKDRAG,GKLIFT
      *        ,GHMAX,GRAHILO,GSIGCR,NKTOPG,NSTRA,GSSEC,GTSEC,GVSEC
Index: LMDZ.3.3/branches/rel-LF/libf/phylmd/orografi.F
===================================================================
--- LMDZ.3.3/branches/rel-LF/libf/phylmd/orografi.F	(revision 153)
+++ LMDZ.3.3/branches/rel-LF/libf/phylmd/orografi.F	(revision 155)
@@ -1,5 +1,5 @@
       SUBROUTINE drag_noro (nlon,nlev,dtime,paprs,pplay,
      e                   pmea,pstd, psig, pgam, pthe,ppic,pval,
-     e                   kgwd,kgwdim,kdx,ktest,
+     e                   kgwd,kdx,ktest,
      e                   t, u, v,
      s                   pulow, pvlow, pustr, pvstr,
@@ -39,5 +39,5 @@
       REAL d_t(nlon,nlev), d_u(nlon,nlev), d_v(nlon,nlev)
 c
-      INTEGER i, k, kgwd, kgwdim, kdx(nlon), ktest(nlon)
+      INTEGER i, k, kgwd, kdx(nlon), ktest(nlon)
 c
 c Variables locales:
@@ -96,5 +96,5 @@
 c appeler la routine principale
 c
-      CALL orodrag(klon,klev,kgwd,kgwdim,kdx,ktest,
+      CALL orodrag(klon,klev,kgwd,kdx,ktest,
      .            dtime,
      .            papmh, papmf, zgeom,
@@ -119,5 +119,5 @@
       END
       SUBROUTINE orodrag( nlon,nlev 
-     i                 , kgwd, kgwdim, kdx, ktest
+     i                 , kgwd, kdx, ktest
      r                 , ptsphy
      r                 , paphm1,papm1,pgeom1,ptm1,pum1,pvm1
@@ -126,4 +126,7 @@
      r                 , pulow,pvlow
      r                 , pvom,pvol,pte )
+
+      implicit none
+
 c
 c
@@ -152,5 +155,5 @@
 c        --------------------
 c
-      implicit logical (l)
+c      implicit logical (l)
 c
 c     method.
@@ -183,4 +186,9 @@
 c
 c
+      integer nlon, nlev, klevm1
+      integer kgwd, jl, ilevp1, jk, ji
+      real zdelp, ztemp, zforc, ztend
+      real rover, zb, zc, zconb, zabsv
+      real zzd1, ratio, zbet, zust,zvst, zdis
       real  pte(nlon,nlev),
      *      pvol(nlon,nlev),
@@ -223,9 +231,9 @@
      *       zdedt(klon),
      *       zvidis(klon),
-     *       ztfr(klon),
      *       znu(klon),
      *       zd1(klon),
      *       zd2(klon),
      *       zdmod(klon)
+      real ztmst, ptsphy, zrtmst 
 c
 c------------------------------------------------------------------
@@ -272,6 +280,6 @@
 c
       call orosetup
-     *     ( nlon, nlev , ktest 
-     *     , ikcrit, ikcrith, icrit, isect, ikhlim, ikenvh,iknu,iknu2
+     *     ( nlon, ktest 
+     *     , ikcrit, ikcrith, icrit,  ikenvh,iknu,iknu2
      *     , paphm1, papm1 , pum1   , pvm1 , ptm1 , pgeom1, pstd
      *     , zrho  , zri   , zstab  , ztau , zvph , zpsi, zzdep
@@ -292,8 +300,8 @@
       call gwstress
      *    ( nlon  , nlev
-     *    , ikcrit, isect, ikhlim, ktest, ikcrith, icrit, ikenvh, iknu
-     *    , zrho  , zstab, zvph  , pstd,  psig, pmea, ppic, pval
-     *    , ztfr   , ztau 
-     *    , pgeom1,pgamma,zd1,zd2,zdmod,znu)
+     *    , ktest , icrit, ikenvh, iknu
+     *    , zrho  , zstab, zvph  , pstd,  psig, pmea, ppic
+     *    , ztau 
+     *    , pgeom1,zdmod)
 c
 c
@@ -306,10 +314,9 @@
       call gwprofil
      *       (  nlon , nlev
-     *       , kgwd   , kdx  , ktest
-     *       , ikcrit, ikcrith, icrit  , ikenvh, iknu
-     *       ,iknu2 , paphm1, zrho   , zstab , ztfr   , zvph
-     *       , zri   , ztau   , ztauf
-c
-     *       , zdmod , znu    , psig  , pgamma , pstd , ppic , pval)
+     *       , kgwd   , kdx
+     *       , ikcrith, icrit
+     *       , paphm1, zrho   , zstab ,  zvph
+     *       , zri   , ztau   
+     *       , zdmod , psig  , pstd)
 c
 c
@@ -401,6 +408,6 @@
       end
       SUBROUTINE orosetup
-     *         ( nlon   , nlev  , ktest
-     *         , kkcrit, kkcrith, kcrit, ksect , kkhlim
+     *         ( nlon   , ktest
+     *         , kkcrit, kkcrith, kcrit
      *         , kkenvh, kknu  , kknu2
      *         , paphm1, papm1 , pum1   , pvm1 , ptm1  , pgeom1, pstd
@@ -448,5 +455,5 @@
 c
 c-----------------------------------------------------------------------
-      implicit logical (l)
+      implicit none
 c
 
@@ -461,6 +468,11 @@
 c              ---------
 c
-      integer kkcrit(nlon),kkcrith(nlon),kcrit(nlon),ksect(nlon),
-     *        kkhlim(nlon),ktest(nlon),kkenvh(nlon)
+      integer nlon
+      integer jl, jk
+      real zdelp
+      real  zb, zc
+
+      integer kkcrit(nlon),kkcrith(nlon),kcrit(nlon),
+     *        ktest(nlon),kkenvh(nlon)
 
 c
@@ -480,4 +492,10 @@
 c
 c
+      integer ilevm1, ilevm2, ilevh
+      real zcons1, zcons2,zcons3, zhgeo
+      real zu, zphi, zvt1,zvt2, zst, zvar, zdwind, zwind
+      real zstabm, zstabp, zrhom,  zrhop, alpha
+      real zggeenv, zggeom1,zgvar 
+      logical lo 
       logical ll1(klon,klev+1)
       integer kknu(klon),kknu2(klon),kknub(klon),kknul(klon),
@@ -486,5 +504,5 @@
       real zhcrit(klon,klev),zvpf(klon,klev),
      *     zdp(klon,klev)
-      real znorm(klon),zpsi(klon),zb(klon),zc(klon),
+      real znorm(klon),zb(klon),zc(klon),
      *      zulow(klon),zvlow(klon),znup(klon),znum(klon)
 c
@@ -862,9 +880,9 @@
       SUBROUTINE gwstress
      *         (  nlon  , nlev
-     *         , kkcrit, ksect, kkhlim, ktest, kkcrith, kcrit, kkenvh
+     *         , ktest, kcrit, kkenvh
      *         , kknu
      *         , prho  , pstab , pvph  , pstd, psig
-     *         , pmea , ppic , pval  , ptfr  , ptau  
-     *         , pgeom1 , pgamma , pd1  , pd2   , pdmod , pnu )
+     *         , pmea , ppic  , ptau  
+     *         , pgeom1 , pdmod )
 c
 c**** *gwstress*
@@ -906,5 +924,5 @@
 c
 c-----------------------------------------------------------------------
-      implicit logical (l)
+      implicit none
 #include "dimensions.h"
 #include "dimphy.h"
@@ -917,13 +935,14 @@
 c              ---------
 c
-      integer kkcrit(nlon),kkcrith(nlon),kcrit(nlon),ksect(nlon),
-     *        kkhlim(nlon),ktest(nlon),kkenvh(nlon),kknu(nlon)
+      integer nlon, nlev
+      integer kcrit(nlon),
+     *        ktest(nlon),kkenvh(nlon),kknu(nlon)
 c
       real prho(nlon,nlev+1),pstab(nlon,nlev+1),ptau(nlon,nlev+1),
-     *     pvph(nlon,nlev+1),ptfr(nlon),
+     *     pvph(nlon,nlev+1),
      *     pgeom1(nlon,nlev),pstd(nlon)
 c
-      real pd1(nlon),pd2(nlon),pnu(nlon),psig(nlon),pgamma(nlon)
-      real pmea(nlon),ppic(nlon),pval(nlon)
+      real psig(nlon)
+      real pmea(nlon),ppic(nlon)
       real pdmod(nlon)
 c
@@ -932,4 +951,7 @@
 c*       0.2   local arrays
 c              ------------
+      integer jl
+      real zblock, zvar, zeff
+      logical lo
 c
 c-----------------------------------------------------------------------
@@ -985,8 +1007,8 @@
       SUBROUTINE GWPROFIL
      *         ( NLON, NLEV
-     *         , kgwd ,kdx  , ktest
-     *         , KKCRIT, KKCRITH, KCRIT ,  kkenvh, kknu,kknu2
-     *         , PAPHM1, PRHO   , PSTAB , PTFR , PVPH , PRI , PTAU
-     *         , ptauf ,pdmod   , pnu   , psig ,pgamma, pvar, ppic,pval)
+     *         , kgwd, kdx
+     *         , KKCRITH, KCRIT
+     *         , PAPHM1, PRHO   , PSTAB  , PVPH , PRI , PTAU
+     *         , pdmod   , psig , pvar)
 
 C**** *GWPROFIL*
@@ -1036,5 +1058,5 @@
 C     PASSAGE OF THE NEW GWDRAG TO I.F.S. (F. LOTT, 22/11/93)
 C-----------------------------------------------------------------------
-      IMPLICIT LOGICAL (L)
+      implicit none
 C
 
@@ -1051,15 +1073,14 @@
 C              ---------
 C
-      INTEGER KKCRIT(NLON),KKCRITH(NLON),KCRIT(NLON)
-     *       ,kdx(nlon),ktest(NLON)
-     *       ,kkenvh(NLON),kknu(NLON),kknu2(NLON)
+      integer nlon,nlev
+      INTEGER KKCRITH(NLON),KCRIT(NLON)
+     *       ,kdx(nlon)
 C
       REAL PAPHM1(NLON,NLEV+1), PSTAB(NLON,NLEV+1),
      *     PRHO  (NLON,NLEV+1), PVPH (NLON,NLEV+1),
-     *     PRI   (NLON,NLEV+1), PTFR (NLON), PTAU(NLON,NLEV+1),
-     *     ptauf (NLON,nlev+1)
+     *     PRI   (NLON,NLEV+1), PTAU(NLON,NLEV+1)
      
-      REAL pdmod (NLON) , pnu (NLON) , psig(NLON),
-     *     pgamma(NLON) , pvar(NLON) , ppic(NLON), pval(NLON)
+      REAL pdmod (NLON) , psig(NLON),
+     *     pvar(NLON)
      
 C-----------------------------------------------------------------------
@@ -1068,4 +1089,7 @@
 C              ------------
 C
+      integer ilevh, ji, kgwd, jl, jk
+      real zsqr, zalfa, zriw, zdel, zb, zalpha,zdz2n
+      real zdelp, zdelpt 
       REAL ZDZ2 (KLON,KLEV) , ZNORM(KLON) , zoro(KLON)
       REAL ZTAU (KLON,KLEV+1)
@@ -1221,6 +1245,6 @@
       END
       SUBROUTINE lift_noro (nlon,nlev,dtime,paprs,pplay,      
-     e                   plat,pmea,pstd, psig, pgam, pthe, ppic,pval,
-     e                   kgwd,kgwdim,kdx,ktest,
+     e                   plat,pmea,pstd, ppic,
+     e                   ktest,
      e                   t, u, v,
      s                   pulow, pvlow, pustr, pvstr,
@@ -1255,11 +1279,11 @@
       REAL pplay(klon,klev)
       REAL plat(nlon),pmea(nlon)
-      REAL pstd(nlon),psig(nlon),pgam(nlon),pthe(nlon)
-      REAL ppic(nlon),pval(nlon)
+      REAL pstd(nlon)
+      REAL ppic(nlon)
       REAL pulow(nlon),pvlow(nlon),pustr(nlon),pvstr(nlon)
       REAL t(nlon,nlev), u(nlon,nlev), v(nlon,nlev)
       REAL d_t(nlon,nlev), d_u(nlon,nlev), d_v(nlon,nlev)
 c
-      INTEGER i, k, kgwd, kgwdim, kdx(nlon), ktest(nlon)
+      INTEGER i, k, ktest(nlon)
 c
 c Variables locales:
@@ -1318,9 +1342,9 @@
 c appeler la routine principale
 c
-      CALL OROLIFT(klon,klev,kgwd,kgwdim,kdx,ktest,
+      CALL OROLIFT(klon,klev,ktest,
      .            dtime,
-     .            papmh, papmf, zgeom,
+     .            papmh, zgeom,
      .            pt, pu, pv,
-     .            plat,pmea, pstd, psig, pgam, pthe, ppic,pval,
+     .            plat,pmea, pstd, ppic,
      .            pulow,pvlow,
      .            pdudt,pdvdt,pdtdt)
@@ -1341,9 +1365,9 @@
       END
       SUBROUTINE OROLIFT( NLON,NLEV
-     I                 , KGWD, KGWDIM, KDX, KTEST
+     I                 , KTEST
      R                 , PTSPHY
-     R                 , PAPHM1,PAPM1,PGEOM1,PTM1,PUM1,PVM1
+     R                 , PAPHM1,PGEOM1,PTM1,PUM1,PVM1
      R                 , PLAT
-     R                 , PMEA, PVAROR, PSIG, PGAMMA, PTHETA,ppic,pval
+     R                 , PMEA, PVAROR, ppic
 C OUTPUTS
      R                 , PULOW,PVLOW
@@ -1365,5 +1389,5 @@
 C     F.LOTT  LMD 22/11/95
 C
-      IMPLICIT LOGICAL (L)
+      implicit none
 C
 C
@@ -1378,4 +1402,5 @@
 C
 C
+      integer nlon, nlev
       REAL  PTE(NLON,NLEV),
      *      PVOL(NLON,NLEV),
@@ -1387,43 +1412,29 @@
      *      PTM1(NLON,NLEV),
      *      PLAT(NLON),PMEA(NLON),
-     *      PVAROR(NLON),PSIG(NLON),PGAMMA(NLON),
-     *      PTHETA(NLON),ppic(NLON),pval(NLON),
+     *      PVAROR(NLON),
+     *      ppic(NLON),
      *      PGEOM1(NLON,NLEV),
-     *      PAPM1(NLON,NLEV),
      *      PAPHM1(NLON,NLEV+1)
 C
-      INTEGER  KDX(NLON),KTEST(NLON)
+      INTEGER  KTEST(NLON)
+      real ptsphy
 C-----------------------------------------------------------------------
 C
 C*       0.2   LOCAL ARRAYS
 C              ------------
-      INTEGER  ISECT(KLON),
-     *         ICRIT(KLON),
-     *         IKCRITH(KLON),
-     *         IKenvh(klon),
+      logical lifthigh, ll1
+      integer klevm1, jl, ilevh, jk
+      real zcons1, ztmst, zrtmst,zpi, zhgeo
+      real zdelp, zslow, zsqua, zscav, zbet
+      INTEGER  
      *         IKNUB(klon),
-     *         IKNUL(klon),
-     *         IKCRIT(KLON),
-     *         IKHLIM(KLON)
+     *         IKNUL(klon)
       LOGICAL LL1(KLON,KLEV+1)
 C
       REAL   ZTAU(KLON,KLEV+1),
      *       ZTAV(KLON,KLEV+1),
-     *       ZSTAB(KLON,KLEV+1),
-     *       ZVPH(KLON,KLEV+1),
-     *       ZRHO(KLON,KLEV+1),
-     *       ZRI(KLON,KLEV+1),
-     *       ZpsI(KLON,KLEV+1),
-     *       Zzdep(KLON,KLEV)
+     *       ZRHO(KLON,KLEV+1)
       REAL   ZDUDT(KLON),
-     *       ZDVDT(KLON),
-     *       ZDTDT(KLON),
-     *       ZDEDT(KLON),
-     *       ZVIDIS(KLON),
-     *       ZTFR(KLON),
-     *       Znu(KLON),
-     *       Zd1(KLON),
-     *       Zd2(KLON),
-     *       Zdmod(KLON)
+     *       ZDVDT(KLON)
       REAL ZHCRIT(KLON,KLEV)
 C-----------------------------------------------------------------------
@@ -1680,5 +1691,5 @@
 C        ORIGINAL : 90-01-01
 C     ------------------------------------------------------------------
-      IMPLICIT LOGICAL(L)
+      implicit none
 C
 C     -----------------------------------------------------------------
@@ -1686,7 +1697,8 @@
 C      ----------------------------------------------------------------
 C
-      integer nlon,nlev
+      integer nlon,nlev, jk
       REAL paprs(nlon,nlev+1)
       REAL pplay(nlon,nlev)
+      real zpr,zstra,zsigt,zpm1r
 C
 C*       1.    SET THE VALUES OF THE PARAMETERS
@@ -1724,5 +1736,5 @@
 C
       GKDRAG=0.2 
-      GRAHILO=1    
+      GRAHILO=1.    
       GRCRIT=0.01
       GFRCRIT=1.0
