Index: LMDZ6/trunk/libf/phylmd/YOEGWD.h
===================================================================
--- LMDZ6/trunk/libf/phylmd/YOEGWD.h	(revision 5307)
+++ 	(revision )
@@ -1,32 +1,0 @@
-!
-! $Header$
-!
-!  ATTENTION : ce fichier include est compatible format fixe/format libre
-!                 veillez  n'utiliser que des ! pour les commentaires
-!                 et  bien positionner les & des lignes de continuation
-!                 (les placer en colonne 6 et en colonne 73)
-!     -----------------------------------------------------------------
-!*    *COMMON* *YOEGWD* - PARAMETERS FOR GRAVITY WAVE DRAG CALCULATIONS
-!     -----------------------------------------------------------------
-!
-      integer NKTOPG,NSTRA
-      real GFRCRIT,GKWAKE,GRCRIT,GVCRIT,GKDRAG,GKLIFT
-      real GHMAX,GRAHILO,GSIGCR,GSSEC,GTSEC,GVSEC
-
-      REAL GWD_RANDO_RUWMAX
-!     Maximum Eliassen-Palm flux at launch level, in "FLOTT_GWD_rando"
-
-      REAL GWD_RANDO_SAT ! saturation parameter in "FLOTT_GWD_rando"
-!     S_c in equation (12) of Lott (JGR, vol 118, page 8897, 2013)
-
-      REAL GWD_FRONT_RUWMAX,GWD_FRONT_SAT 
-! Same as GWD_RANDO params but for fronal GWs
-
-
-      COMMON/YOEGWD/ GFRCRIT,GKWAKE,GRCRIT,GVCRIT,GKDRAG,GKLIFT,        &
-     &     GHMAX,GRAHILO,GSIGCR,NKTOPG,NSTRA,GSSEC,GTSEC,GVSEC,         &
-     &     GWD_RANDO_RUWMAX, gwd_rando_sat,                             &
-     &     GWD_FRONT_RUWMAX, gwd_front_sat
-
-      save /YOEGWD/
-!$OMP THREADPRIVATE(/YOEGWD/)
Index: LMDZ6/trunk/libf/phylmd/acama_gwd_rando_m.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/acama_gwd_rando_m.f90	(revision 5307)
+++ LMDZ6/trunk/libf/phylmd/acama_gwd_rando_m.f90	(revision 5309)
@@ -22,5 +22,6 @@
 
 !  ONLINE:
-    USE yomcst_mod_h
+USE yoegwd_mod_h
+        USE yomcst_mod_h
 use dimphy, only: klon, klev
     use assert_m, only: assert
@@ -33,5 +34,4 @@
 !   include "dimphy.h"
 !END DIFFERENCE
-    include "YOEGWD.h"
 
     ! 0. DECLARATIONS:
Index: LMDZ6/trunk/libf/phylmd/conf_phys_m.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/conf_phys_m.f90	(revision 5307)
+++ LMDZ6/trunk/libf/phylmd/conf_phys_m.f90	(revision 5309)
@@ -24,5 +24,6 @@
        alp_offset)
 
-USE yomcst2_mod_h
+USE yoegwd_mod_h
+    USE yomcst2_mod_h
         USE compbl_mod_h
     USE alpale_mod
@@ -45,5 +46,4 @@
     USE nuage_params_mod_h
 
-    INCLUDE "YOEGWD.h"
     !
     ! Configuration de la "physique" de LMDZ a l'aide de la fonction
Index: LMDZ6/trunk/libf/phylmd/flott_gwd_rando_m.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/flott_gwd_rando_m.f90	(revision 5307)
+++ LMDZ6/trunk/libf/phylmd/flott_gwd_rando_m.f90	(revision 5309)
@@ -25,7 +25,7 @@
       USE ioipsl_getin_p_mod, ONLY : getin_p
       USE vertical_layers_mod, ONLY : presnivs
+      USE yoegwd_mod_h
       CHARACTER (LEN=20) :: modname='flott_gwd_rando'
       CHARACTER (LEN=80) :: abort_message
-
 
     ! OFFLINE:
@@ -33,5 +33,4 @@
     ! include "dimphy.h"
     ! END OF DIFFERENCE ONLINE-OFFLINE
-    include "YOEGWD.h"
 
     ! 0. DECLARATIONS:
Index: LMDZ6/trunk/libf/phylmd/freinage.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/freinage.f90	(revision 5307)
+++ LMDZ6/trunk/libf/phylmd/freinage.f90	(revision 5309)
@@ -6,5 +6,6 @@
 
     !ONLINE:
-USE dimpft_mod_h
+USE yoegwd_mod_h
+    USE dimpft_mod_h
     USE compbl_mod_h
         USE clesphys_mod_h
@@ -18,5 +19,4 @@
 
 
-    include "YOEGWD.h"
 !FC
 
Index: LMDZ6/trunk/libf/phylmd/hines_gwd.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/hines_gwd.f90	(revision 5307)
+++ LMDZ6/trunk/libf/phylmd/hines_gwd.f90	(revision 5309)
@@ -13,9 +13,9 @@
 
 
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
 
-  include "YOEGWD.h"
 
 
Index: LMDZ6/trunk/libf/phylmd/inlandsis/sisvat_weq.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/inlandsis/sisvat_weq.f90	(revision 5307)
+++ 	(revision )
@@ -1,104 +1,0 @@
-
-
-subroutine SISVAT_wEq( labWEq ,istart)
-
-  ! +------------------------------------------------------------------------+
-  ! | MAR          SISVAT_wEq                                22-09-2001  MAR |
-  ! |   SubRoutine SISVAT_wEq computes the Snow/Ice  Water  Equivalent       |
-  ! |                                                                        |
-  ! |                                                                        |
-  ! |   Preprocessing  Option: SISVAT IO (not always a standard preprocess.) |
-  ! |   ^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^                                     |
-  ! |   FILE                 |      CONTENT                                  |
-  ! |   ~~~~~~~~~~~~~~~~~~~~~+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
-  ! | # SISVAT_wEq.ve        | #ve: OUTPUT/Verification: Snow/Ice Water Eqv. |
-  ! |                        |      unit 45, SubRoutine  SISVAT_wEq **ONLY** |
-  ! +------------------------------------------------------------------------+
-
-
-
-
-  ! +--Global Variables
-  ! +  ================
-
-  use VARphy
-  use VAR_SV
-  use VARxSV
-
-  IMPLICIT NONE
-
-
-
-  character(len=6) :: labWEq
-  integer :: istart
-
-  logical :: logWEq
-  common/SISVAT_wEq_L/logWEq
-
-
-  ! +--Local  Variables
-  ! +  ================
-
-  integer :: ikl   ,isn
-  real :: SnoWEQ,IceWEQ
-
-
-  ! +--Switch Initialization
-  ! +  =====================
-
-  IF (.NOT.logWEq)                                              THEN
-           logWEq = .true.
-           open(unit=45,status='unknown',file='SISVAT_wEq.ve')
-           rewind    45
-  END IF
-
-
-  ! +--Snow Water Equivalent
-  ! +  =====================
-
-       ikl   = 1
-  IF          (isnoSV(ikl).gt.iiceSV(ikl))                      THEN
-
-      SnoWEQ = 0.
-    DO isn   = iiceSV(ikl)+1 ,isnoSV(ikl)
-      SnoWEQ = SnoWEQ       + ro__SV(ikl,isn) * dzsnSV(ikl,isn)
-    END DO
-
-  END IF
-
-
-  ! +--Ice  Water Equivalent
-  ! +  =====================
-
-  IF        (iiceSV(1).gt.0)                                    THEN
-
-      IceWEQ = 0.
-    DO isn   =             1 ,iiceSV(ikl)
-      IceWEQ = IceWEQ       + ro__SV(ikl,isn) * dzsnSV(ikl,isn)
-    END DO
-
-  END IF
-
-
-  ! +--OUTPUT
-  ! +  ======
-
-  !!      IF (istart.eq.1)                                              THEN
-  !!        write(45,45)dahost,i___SV(lwriSV(1)),j___SV(lwriSV(1)),
-  !!     .              n___SV(lwriSV(1))
-  !! 45     format(a18,10('-'),'Pt.',3i4,60('-'))
-  !!      END IF
-
-  !!      write(45,450) labWEq,IceWEQ,iiceSV(ikl),SnoWEQ
-  !!     .                    ,IceWEQ+SnoWEQ,isnoSV(ikl)
-  !!     .                                  ,drr_SV(ikl)*dt__SV
-  !!     .                                  ,dsn_SV(ikl)*dt__SV
-  !!     .                                  ,BufsSV(ikl)
-  !! 450  format(a6,3x,'  I+S =',f11.4,'(',i2,') +',f11.4,' =',
-  !!     .                       f11.4,'(',i2,')',
-  !!     .             '  drr =', f7.4,
-  !!     .             '  dsn =', f7.4,
-  !!     .             '  Buf =', f7.4)
-
-  return
-end subroutine sisvat_weq
Index: LMDZ6/trunk/libf/phylmd/inlandsis/sisvat_weq_mod.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/inlandsis/sisvat_weq_mod.f90	(revision 5309)
+++ LMDZ6/trunk/libf/phylmd/inlandsis/sisvat_weq_mod.f90	(revision 5309)
@@ -0,0 +1,77 @@
+MODULE sisvat_weq_mod
+  IMPLICIT NONE; PRIVATE
+  PUBLIC sisvat_weq
+
+  LOGICAL :: logWEq
+
+CONTAINS
+
+  SUBROUTINE SISVAT_wEq(labWEq, istart)
+
+    ! +------------------------------------------------------------------------+
+    ! | MAR          SISVAT_wEq                                22-09-2001  MAR |
+    ! |   SubRoutine SISVAT_wEq computes the Snow/Ice  Water  Equivalent       |
+    ! |                                                                        |
+    ! |                                                                        |
+    ! |   Preprocessing  Option: SISVAT IO (not always a standard preprocess.) |
+    ! |   ^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^                                     |
+    ! |   FILE                 |      CONTENT                                  |
+    ! |   ~~~~~~~~~~~~~~~~~~~~~+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
+    ! | # SISVAT_wEq.ve        | #ve: OUTPUT/Verification: Snow/Ice Water Eqv. |
+    ! |                        |      unit 45, SubRoutine  SISVAT_wEq **ONLY** |
+    ! +------------------------------------------------------------------------+
+
+    ! +--Global Variables
+    ! +  ================
+    USE VARphy
+    USE VAR_SV
+    USE VARxSV
+
+    IMPLICIT NONE
+
+    CHARACTER(LEN = 6) :: labWEq
+    INTEGER :: istart
+
+    ! +--Local  Variables
+    ! +  ================
+
+    INTEGER :: ikl, isn
+    REAL :: SnoWEQ, IceWEQ
+
+
+    ! +--Switch Initialization
+    ! +  =====================
+
+    IF (.NOT.logWEq)                                              THEN
+      logWEq = .TRUE.
+      open(unit = 45, status = 'unknown', file = 'SISVAT_wEq.ve')
+      rewind    45
+    END IF
+
+
+    ! +--Snow Water Equivalent
+    ! +  =====================
+
+    ikl = 1
+    IF          (isnoSV(ikl)>iiceSV(ikl))                      THEN
+      SnoWEQ = 0.
+      DO isn = iiceSV(ikl) + 1, isnoSV(ikl)
+        SnoWEQ = SnoWEQ + ro__SV(ikl, isn) * dzsnSV(ikl, isn)
+      END DO
+
+    END IF
+
+
+    ! +--Ice  Water Equivalent
+    ! +  =====================
+    IF        (iiceSV(1)>0)                                    THEN
+      IceWEQ = 0.
+      DO isn = 1, iiceSV(ikl)
+        IceWEQ = IceWEQ + ro__SV(ikl, isn) * dzsnSV(ikl, isn)
+      END DO
+
+    END IF
+
+  END SUBROUTINE sisvat_weq
+
+END MODULE sisvat_weq_mod
Index: LMDZ6/trunk/libf/phylmd/orografi.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/orografi.f90	(revision 5307)
+++ LMDZ6/trunk/libf/phylmd/orografi.f90	(revision 5309)
@@ -122,4 +122,5 @@
   USE yomcst_mod_h
   USE dimphy
+  USE yoegwd_mod_h
   IMPLICIT NONE
 
@@ -168,8 +169,4 @@
 
   ! f.lott + m. miller    e.c.m.w.f.     22/11/94
-  ! -----------------------------------------------------------------------
-
-
-  include "YOEGWD.h"
   ! -----------------------------------------------------------------------
 
@@ -397,5 +394,6 @@
 
   ! -----------------------------------------------------------------------
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
@@ -403,5 +401,4 @@
 
 
-  include "YOEGWD.h"
 
   ! -----------------------------------------------------------------------
@@ -843,9 +840,9 @@
 
   ! -----------------------------------------------------------------------
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
 
-  include "YOEGWD.h"
 
   ! -----------------------------------------------------------------------
@@ -969,5 +966,6 @@
   ! PASSAGE OF THE NEW GWDRAG TO I.F.S. (F. LOTT, 22/11/93)
   ! -----------------------------------------------------------------------
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
@@ -977,5 +975,4 @@
 
 
-  include "YOEGWD.h"
 
   ! -----------------------------------------------------------------------
@@ -1313,5 +1310,6 @@
   ! F.LOTT  LMD 22/11/95
 
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
@@ -1319,5 +1317,4 @@
 
 
-  include "YOEGWD.h"
   ! -----------------------------------------------------------------------
 
@@ -1562,5 +1559,6 @@
 
 SUBROUTINE sugwd(nlon, nlev, paprs, pplay)
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE mod_phys_lmdz_para
   USE mod_grid_phy_lmdz
@@ -1611,5 +1609,4 @@
 
   ! -----------------------------------------------------------------
-  include "YOEGWD.h"
   ! ----------------------------------------------------------------
 
Index: LMDZ6/trunk/libf/phylmd/orografi_strato.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/orografi_strato.f90	(revision 5307)
+++ LMDZ6/trunk/libf/phylmd/orografi_strato.f90	(revision 5309)
@@ -5,4 +5,5 @@
   USE yomcst_mod_h
   USE dimphy
+  USE yoegwd_mod_h
   IMPLICIT NONE
   ! ======================================================================
@@ -63,5 +64,4 @@
 
   ! ======================================================================
-  include "YOEGWD.h"
 
   ! ARGUMENTS
@@ -161,4 +161,5 @@
   USE yomcst_mod_h
   USE dimphy
+  USE yoegwd_mod_h
   IMPLICIT NONE
 
@@ -237,9 +238,4 @@
 
   ! f.lott + m. miller    e.c.m.w.f.     22/11/94
-  ! -----------------------------------------------------------------------
-
-
-  include "YOEGWD.h"
-
   ! -----------------------------------------------------------------------
 
@@ -543,5 +539,6 @@
 
   ! -----------------------------------------------------------------------
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
@@ -549,5 +546,4 @@
 
 
-  include "YOEGWD.h"
 
   ! -----------------------------------------------------------------------
@@ -997,10 +993,10 @@
 
   ! -----------------------------------------------------------------------
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
 
 
-  include "YOEGWD.h"
 
   ! -----------------------------------------------------------------------
@@ -1115,10 +1111,10 @@
   ! nstra.
 
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
 
 
-  include "YOEGWD.h"
 
   ! -----------------------------------------------------------------------
@@ -1295,4 +1291,5 @@
   USE yomcst_mod_h
   USE dimphy
+  USE yoegwd_mod_h
   IMPLICIT NONE
   ! ======================================================================
@@ -1354,6 +1351,4 @@
   ! ======================================================================
 
-  include "YOEGWD.h"
-
   ! ARGUMENTS
 
@@ -1507,5 +1502,6 @@
   ! F.LOTT  LMD 22/11/95
 
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE yomcst_mod_h
 IMPLICIT NONE
@@ -1513,5 +1509,4 @@
 
 
-  include "YOEGWD.h"
   ! -----------------------------------------------------------------------
 
@@ -1820,5 +1815,6 @@
   ! LAST:  99-07-09     (FRANCOIS LOTT,LMD)
   ! ------------------------------------------------------------------
-  USE dimphy
+USE yoegwd_mod_h
+    USE dimphy
   USE mod_phys_lmdz_para
   USE mod_grid_phy_lmdz
@@ -1827,5 +1823,4 @@
 
   ! -----------------------------------------------------------------
-  include "YOEGWD.h"
   ! ----------------------------------------------------------------
 
Index: LMDZ6/trunk/libf/phylmd/yoegwd_mod_h.f90
===================================================================
--- LMDZ6/trunk/libf/phylmd/yoegwd_mod_h.f90	(revision 5309)
+++ LMDZ6/trunk/libf/phylmd/yoegwd_mod_h.f90	(revision 5309)
@@ -0,0 +1,22 @@
+! PARAMETERS FOR GRAVITY WAVE DRAG CALCULATIONS
+MODULE yoegwd_mod_h
+  IMPLICIT NONE; PRIVATE
+  PUBLIC GFRCRIT, GKWAKE, GRCRIT, GVCRIT, GKDRAG, GKLIFT, GHMAX, GRAHILO, GSIGCR, NKTOPG, NSTRA, GSSEC, GTSEC, GVSEC, &
+          GWD_RANDO_RUWMAX, gwd_rando_sat, GWD_FRONT_RUWMAX, gwd_front_sat
+
+  INTEGER NKTOPG, NSTRA
+  REAL GFRCRIT, GKWAKE, GRCRIT, GVCRIT, GKDRAG, GKLIFT
+  REAL GHMAX, GRAHILO, GSIGCR, GSSEC, GTSEC, GVSEC
+
+  REAL GWD_RANDO_RUWMAX
+  !     Maximum Eliassen-Palm flux at launch level, in "FLOTT_GWD_rando"
+
+  REAL GWD_RANDO_SAT ! saturation parameter in "FLOTT_GWD_rando"
+  !     S_c in equation (12) of Lott (JGR, vol 118, page 8897, 2013)
+
+  REAL GWD_FRONT_RUWMAX, GWD_FRONT_SAT
+  ! Same as GWD_RANDO params but for fronal GWs
+
+  !$OMP THREADPRIVATE(GFRCRIT, GKWAKE, GRCRIT, GVCRIT, GKDRAG, GKLIFT, GHMAX, GRAHILO, GSIGCR, NKTOPG, NSTRA, GSSEC, GTSEC, GVSEC, &
+  !$OMP          GWD_RANDO_RUWMAX, gwd_rando_sat, GWD_FRONT_RUWMAX, gwd_front_sat)
+END MODULE yoegwd_mod_h
