Index: trunk/LMDZ.COMMON/libf/dyn3dpar/addfi_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/addfi_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/addfi_p.F	(revision 1422)
@@ -8,4 +8,5 @@
       USE infotrac, ONLY : nqtot
       USE control_mod, ONLY : planet_type
+      USE comconst_mod, ONLY: kappa
       IMPLICIT NONE
 c
@@ -48,7 +49,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom.h"
-#include "serre.h"
 c
 c    Arguments :
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/advect_new_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/advect_new_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/advect_new_p.F	(revision 1422)
@@ -6,4 +6,6 @@
       USE parallel_lmdz
       USE write_field_p
+      USE comconst_mod, ONLY: daysec
+      USE logic_mod, ONLY: conser
       IMPLICIT NONE
 c=======================================================================
@@ -28,9 +30,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "logic.h"
-#include "ener.h"
 
 c   Arguments:
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/advect_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/advect_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/advect_p.F	(revision 1422)
@@ -5,4 +5,6 @@
       USE parallel_lmdz
       USE write_field_p
+      USE comconst_mod, ONLY: daysec
+      USE logic_mod, ONLY: conser
       IMPLICIT NONE
 c=======================================================================
@@ -27,9 +29,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "logic.h"
-#include "ener.h"
 
 c   Arguments:
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/advtrac_p.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/advtrac_p.F90	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/advtrac_p.F90	(revision 1422)
@@ -18,16 +18,11 @@
   USE infotrac, ONLY: nqtot, iadv
   USE control_mod, ONLY: iapp_tracvl, day_step, planet_type
+  USE comconst_mod, ONLY: dtvr
   IMPLICIT NONE
   !
   include "dimensions.h"
   include "paramet.h"
-  include "comconst.h"
-  include "comvert.h"
   include "comdissip.h"
   include "comgeom2.h"
-  include "logic.h"
-  include "temps.h"
-  include "ener.h"
-  include "description.h"
 
   !-------------------------------------------------------------------
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/bernoui_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/bernoui_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/bernoui_p.F	(revision 1422)
@@ -25,5 +25,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
 c
 c   Arguments:
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/bilan_dyn_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/bilan_dyn_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/bilan_dyn_p.F	(revision 1422)
@@ -17,12 +17,12 @@
       use misc_mod
       use write_field_p
+      USE comvert_mod, ONLY: presnivs
+      USE comconst_mod, ONLY: cpp,pi
+      USE temps_mod, ONLY: annee_ref,day_ref,itau_dyn
       IMPLICIT NONE
 
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom2.h"
-#include "temps.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/caldyn_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/caldyn_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/caldyn_p.F	(revision 1422)
@@ -10,4 +10,5 @@
       USE parallel_lmdz
       USE Write_Field_p
+      USE comvert_mod, ONLY: ap,bp
       
       IMPLICIT NONE
@@ -31,6 +32,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/ce0l.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/ce0l.F90	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/ce0l.F90	(revision 1422)
@@ -42,6 +42,4 @@
 !#include "indicesol.h"
 #include "iniprint.h"
-#include "temps.h"
-#include "logic.h"
 #ifdef CPP_MPI
       include 'mpif.h'
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F90	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F90	(revision 1422)
@@ -19,4 +19,14 @@
   use assert_m, only: assert
   use sponge_mod_p, only: callsponge,mode_sponge,nsponge,tetasponge
+  USE comconst_mod, ONLY: dissip_factz,dissip_deltaz,dissip_zref, 		&
+		dissip_fac_mid,dissip_fac_up,dissip_hdelta,dissip_pupstart, 	&
+		mode_top_bound,tau_top_bound,iflag_top_bound
+  USE logic_mod, ONLY: tidal,purmats,ok_guide,read_start,iflag_phys,iflag_trac,	&
+		ok_strato,ok_gradsfile,ok_limit,ok_etat0,moyzon_mu,moyzon_ch,	&
+		fxyhypb,ysinus
+  USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy,		&
+		alphax,alphay,taux,tauy
+  USE temps_mod, ONLY: calend
+
   IMPLICIT NONE
 !-----------------------------------------------------------------------
@@ -36,10 +46,6 @@
   include "dimensions.h"
   include "paramet.h"
-  include "logic.h"
-  include "serre.h"
   include "comdissnew.h"
   include "iniprint.h"
-  include "temps.h"
-  include "comconst.h"
 
 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/convmas1_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/convmas1_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/convmas1_p.F	(revision 1422)
@@ -32,6 +32,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
-#include "logic.h"
 
       REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm )
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/convmas2_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/convmas2_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/convmas2_p.F	(revision 1422)
@@ -32,6 +32,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
-#include "logic.h"
 
       REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm )
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/convmas_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/convmas_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/convmas_p.F	(revision 1422)
@@ -32,6 +32,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
-#include "logic.h"
 
       REAL pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm )
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/dissip_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/dissip_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/dissip_p.F	(revision 1422)
@@ -6,4 +6,5 @@
       USE parallel_lmdz
       USE write_field_p
+      USE comconst_mod, ONLY: dtdiss
       IMPLICIT NONE
 
@@ -29,5 +30,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom.h"
 #include "comdissnew.h"
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/divgrad_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/divgrad_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/divgrad_p.F	(revision 1422)
@@ -23,5 +23,4 @@
 #include "comgeom.h"
 #include "comdissipn.h"
-#include "logic.h"
 c
       INTEGER klevel
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/dteta1_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/dteta1_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/dteta1_p.F	(revision 1422)
@@ -22,5 +22,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
 
       REAL teta( ip1jmp1,llm ),pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm)
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/dudv2_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/dudv2_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/dudv2_p.F	(revision 1422)
@@ -25,5 +25,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
 
       REAL teta( ip1jmp1,llm ),pkf( ip1jmp1,llm ) ,bern( ip1jmp1,llm ),
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F	(revision 1422)
@@ -11,4 +11,13 @@
       use netcdf95, only: NF95_PUT_VAR
       use control_mod, only : planet_type
+      USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff,nivsig,nivsigs,
+     .			presnivs,pseudoalt
+      USE comconst_mod, ONLY: daysec,dtvr,rad,omeg,g,cpp,kappa,pi
+      USE logic_mod, ONLY: fxyhypb,ysinus
+      USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy,
+     .			taux,tauy
+      USE temps_mod, ONLY: annee_ref,day_ref,itau_dyn,itaufin,
+     .			start_time,hour_ini
+      USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
 
       IMPLICIT NONE
@@ -20,13 +29,6 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom2.h"
-#include "temps.h"
-#include "ener.h"
-#include "logic.h"
 #include "netcdf.inc"
-#include "description.h"
-#include "serre.h"
 #include "iniprint.h"
 
@@ -590,4 +592,5 @@
       use netcdf, only: NF90_get_VAR
       use netcdf95, only: NF95_PUT_VAR
+      USE temps_mod, ONLY: itau_dyn,itaufin
 
       IMPLICIT NONE
@@ -597,9 +600,6 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "description.h"
 #include "netcdf.inc"
-#include "comvert.h"
 #include "comgeom.h"
-#include "temps.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/exner_hyb_p_m.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/exner_hyb_p_m.F90	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/exner_hyb_p_m.F90	(revision 1422)
@@ -33,11 +33,10 @@
     !
     USE parallel_lmdz
+    USE comvert_mod, ONLY: preff
+    USE comconst_mod, ONLY: jmp1,kappa,cpp,r
     !
     include "dimensions.h"
     include "paramet.h"
-    include "comconst.h"
     include "comgeom.h"
-    include "comvert.h"
-    include "serre.h"
 
     INTEGER  ngrid
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/exner_milieu_p_m.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/exner_milieu_p_m.F90	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/exner_milieu_p_m.F90	(revision 1422)
@@ -1,3 +1,5 @@
 module exner_milieu_p_m
+
+  USE comconst_mod, ONLY: jmp1,kappa,cpp,r
 
   IMPLICIT NONE
@@ -30,11 +32,9 @@
     !
     USE parallel_lmdz
+    USE comvert_mod, ONLY: preff
     !
     include "dimensions.h"
     include "paramet.h"
-    include "comconst.h"
     include "comgeom.h"
-    include "comvert.h"
-    include "serre.h"
 
     INTEGER  ngrid
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/fluxstokenc_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/fluxstokenc_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/fluxstokenc_p.F	(revision 1422)
@@ -21,9 +21,6 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
 #include "tracstoke.h"
-#include "temps.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/friction_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/friction_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/friction_p.F	(revision 1422)
@@ -12,4 +12,5 @@
       USE ioipsl_getincom
 #endif
+      USE comconst_mod, ONLY: pi
       IMPLICIT NONE
 
@@ -29,5 +30,4 @@
 #include "paramet.h"
 #include "comgeom2.h"
-#include "comconst.h"
 #include "iniprint.h"
 #include "academic.h"
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F	(revision 1422)
@@ -39,4 +39,9 @@
       USE comgeomphy
 #endif
+      USE comconst_mod, ONLY: daysec,dtvr,dtphys,rad,g,r,cpp
+      USE logic_mod
+      USE temps_mod, ONLY: calend,start_time,annee_ref,day_ref,
+     .		itau_dyn,itau_phy,day_ini,jD_ref,jH_ref,day_end,
+     .		dt,hour_ini,itaufin
       IMPLICIT NONE
 
@@ -73,14 +78,7 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comdissnew.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "logic.h"
-#include "temps.h"
 !!!!!!!!!!!#include "control.h"
-#include "ener.h"
-#include "description.h"
-#include "serre.h"
 !#include "com_io_dyn.h"
 #include "iniprint.h"
@@ -166,5 +164,4 @@
       abort_message = 'last timestep reached'
       modname = 'gcm'
-      descript = 'Run GCM LMDZ'
       lafin    = .FALSE.
       dynhist_file = 'dyn_hist'
@@ -608,5 +605,14 @@
 !variable temps no longer exists
 c$OMP PARALLEL DEFAULT(SHARED)
-c$OMP1 COPYIN(/temps_r/,/temps_i/,/temps_c/,/logici/,/logicl/)
+c	Copy all threadprivate variables from temps_mod
+c$OMP1 COPYIN(dt,jD_ref,jH_ref,start_time,hour_ini,day_ini,day_end)
+c$OMP1 COPYIN(annee_ref,day_ref,itau_dyn,itau_phy,itaufin,calend)
+c	Copy all threadprivate variables from logic_mod
+c$OMP1 COPYIN(purmats,forward,leapf,apphys,statcl,conser,apdiss,apdelq)
+c$OMP1 COPYIN(saison,ecripar,fxyhypb,ysinus,read_start,ok_guide)
+c$OMP1 COPYIN(ok_strato,tidal,ok_gradsfile,ok_limit,ok_etat0,physic)
+c$OMP1 COPYIN(grireg,iflag_phys,iflag_trac)
+
+
       CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,
      .              time_0)
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/geopot_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/geopot_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/geopot_p.F	(revision 1422)
@@ -28,5 +28,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
 
 c   Arguments:
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/gradiv_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/gradiv_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/gradiv_p.F	(revision 1422)
@@ -21,5 +21,4 @@
 #include "paramet.h"
 #include "comdissipn.h"
-#include "logic.h"
 
       INTEGER klevel
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/groupe_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/groupe_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/groupe_p.F	(revision 1422)
@@ -16,7 +16,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom2.h"
-#include "comvert.h"
 
       integer ngroup
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/groupeun_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/groupeun_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/groupeun_p.F	(revision 1422)
@@ -6,5 +6,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom2.h"
 
@@ -140,5 +139,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom2.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90	(revision 1422)
@@ -69,4 +69,5 @@
 
     USE control_mod
+    USE serre_mod, ONLY: grossismx
 
     IMPLICIT NONE
@@ -75,7 +76,4 @@
     INCLUDE "paramet.h"
     INCLUDE "netcdf.inc"
-
-    ! For grossismx:
-    include "serre.h"
 
     INTEGER                :: error,ncidpl,rid,rcod
@@ -341,4 +339,6 @@
     USE parallel_lmdz
     USE control_mod
+    USE comvert_mod, ONLY: ap,bp,preff,presnivs,pressure_exner
+    USE comconst_mod, ONLY: daysec,dtvr,kappa,cpp
     
     IMPLICIT NONE
@@ -346,6 +346,4 @@
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h"
-    INCLUDE "comconst.h"
-    INCLUDE "comvert.h"
 
     ! Variables entree
@@ -619,4 +617,6 @@
   SUBROUTINE guide_zonave(typ,hsize,vsize,field)
 
+    USE comconst_mod, ONLY: pi
+
     IMPLICIT NONE
 
@@ -624,5 +624,4 @@
     INCLUDE "paramet.h"
     INCLUDE "comgeom.h"
-    INCLUDE "comconst.h"
     
     ! input/output variables
@@ -707,11 +706,11 @@
   USE mod_hallo
   USE Bands
+  USE comvert_mod, ONLY: ap,bp,preff,pressure_exner
+  USE comconst_mod, ONLY: kappa,cpp
   IMPLICIT NONE
 
   include "dimensions.h"
   include "paramet.h"
-  include "comvert.h"
   include "comgeom2.h"
-  include "comconst.h"
 
   REAL, DIMENSION (iip1,jjp1),     INTENT(IN) :: psi ! Psol gcm
@@ -1099,11 +1098,12 @@
 ! Calcul des constantes de rappel alpha (=1/tau)
 
+    USE comconst_mod, ONLY: pi
+    USE serre_mod, ONLY: clon,clat,grossismx,grossismy
+
     implicit none
 
     include "dimensions.h"
     include "paramet.h"
-    include "comconst.h"
     include "comgeom2.h"
-    include "serre.h"
 
 ! input arguments :
@@ -1813,4 +1813,6 @@
   SUBROUTINE guide_out(varname,hsize,vsize,field,factt)
     USE parallel_lmdz
+    USE comvert_mod, ONLY: presnivs
+    USE comconst_mod, ONLY: pi
     IMPLICIT NONE
 
@@ -1819,6 +1821,4 @@
     INCLUDE "netcdf.inc"
     INCLUDE "comgeom2.h"
-    INCLUDE "comconst.h"
-    INCLUDE "comvert.h"
     
     ! Variables entree
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/initdynav_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/initdynav_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/initdynav_p.F	(revision 1422)
@@ -12,4 +12,7 @@
        use misc_mod
        USE infotrac
+       USE comvert_mod, ONLY: nivsigs
+       USE comconst_mod, ONLY: pi
+       USE temps_mod, ONLY: itau_dyn
 
       implicit none
@@ -43,12 +46,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "temps.h"
-#include "ener.h"
-#include "logic.h"
-#include "description.h"
-#include "serre.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/initfluxsto_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/initfluxsto_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/initfluxsto_p.F	(revision 1422)
@@ -13,4 +13,7 @@
        use Write_field
        use misc_mod
+       USE comvert_mod, ONLY: nivsigs
+       USE comconst_mod, ONLY: pi
+       USE temps_mod, ONLY: annee_ref,day_ref,itau_dyn
        
       implicit none
@@ -45,12 +48,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "temps.h"
-#include "ener.h"
-#include "logic.h"
-#include "description.h"
-#include "serre.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/inithist_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/inithist_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/inithist_p.F	(revision 1422)
@@ -13,4 +13,7 @@
        use misc_mod
        USE infotrac
+       USE comvert_mod, ONLY: nivsigs
+       USE comconst_mod, ONLY: pi
+       USE temps_mod, ONLY: itau_dyn
 
       implicit none
@@ -45,12 +48,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "temps.h"
-#include "ener.h"
-#include "logic.h"
-#include "description.h"
-#include "serre.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/integrd_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/integrd_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/integrd_p.F	(revision 1422)
@@ -7,4 +7,8 @@
       USE parallel_lmdz
       USE control_mod, only : planet_type
+      USE comvert_mod, ONLY: ap,bp
+      USE comconst_mod, ONLY: pi
+      USE logic_mod, ONLY: leapf
+      USE temps_mod, ONLY: dt
       IMPLICIT NONE
 
@@ -27,10 +31,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom.h"
-#include "comvert.h"
-#include "logic.h"
-#include "temps.h"
-#include "serre.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/leapfrog_p.F	(revision 1422)
@@ -33,4 +33,12 @@
        use sponge_mod_p, only: callsponge,mode_sponge,sponge_p
        use comuforc_h
+       USE comvert_mod, ONLY: ap,bp,pressure_exner,presnivs
+       USE comconst_mod, ONLY: jmp1,daysec,dtvr,dtphys,dtdiss,
+     .			cpp,ihf,iflag_top_bound,pi
+       USE logic_mod, ONLY: iflag_phys,ok_guide,forward,leapf,apphys,
+     .			statcl,conser,apdiss,purmats,tidal,ok_strato
+       USE temps_mod, ONLY: itaufin,jD_ref,jH_ref,day_ini,
+     .			day_ref,start_time,dt
+
 
       IMPLICIT NONE
@@ -69,13 +77,6 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comdissnew.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "logic.h"
-#include "temps.h"
-#include "ener.h"
-#include "description.h"
-#include "serre.h"
 !#include "com_io_dyn.h"
 #include "iniprint.h"
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/logic_mod.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/logic_mod.F90	(revision 1422)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/logic_mod.F90	(revision 1422)
@@ -0,0 +1,24 @@
+MODULE logic_mod
+
+IMPLICIT NONE  
+
+      LOGICAL purmats,forward,leapf,apphys,statcl,conser,               &
+     & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus                      &
+     &  ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile               &
+     &  ,ok_limit,ok_etat0,physic,grireg
+      logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
+                     ! (only used if disvert_type==2)
+      logical moyzon_mu,moyzon_ch ! used for zonal averages in Titan
+
+      integer iflag_phys,iflag_trac
+
+!$OMP THREADPRIVATE(purmats,forward,leapf,apphys,statcl,conser,       &
+  !$OMP     apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,              &
+  !$OMP     read_start,ok_guide,ok_strato,tidal,ok_gradsfile,         &
+  !$OMP     ok_limit,ok_etat0,physic,grireg)
+!$OMP THREADPRIVATE(iflag_phys,iflag_trac)
+
+!BE CAREFUL: when adding a threadprivate variable in this module
+!	do not forget to add it to copyin clause of gcm.F (before CALL leapfrog_p)
+
+END MODULE logic_mod
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/massbar_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/massbar_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/massbar_p.F	(revision 1422)
@@ -18,5 +18,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom.h"
 c
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/massbarxy_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/massbarxy_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/massbarxy_p.F	(revision 1422)
@@ -17,5 +17,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom.h"
 c
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/massdair_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/massdair_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/massdair_p.F	(revision 1422)
@@ -18,5 +18,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
 #include "comgeom.h"
 c
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/nxgrarot_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/nxgrarot_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/nxgrarot_p.F	(revision 1422)
@@ -22,5 +22,4 @@
 #include "paramet.h"
 #include "comdissipn.h"
-#include "logic.h"
 c
       INTEGER klevel
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/qminimum_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/qminimum_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/qminimum_p.F	(revision 1422)
@@ -1,4 +1,5 @@
       SUBROUTINE qminimum_p( q,nq,deltap )
       USE parallel_lmdz
+      USE comvert_mod, ONLY: presnivs
       IMPLICIT none
 c
@@ -8,5 +9,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
 c
       INTEGER nq
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/sponge_mod_p.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/sponge_mod_p.F90	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/sponge_mod_p.F90	(revision 1422)
@@ -1,3 +1,5 @@
 module sponge_mod_p
+
+USE comvert_mod, ONLY: ap,bp,preff,scaleheight
 
 implicit none
@@ -36,5 +38,4 @@
 #include "paramet.h"
 #include "comdissip.h"
-#include "comvert.h"
 #include "comgeom2.h"
 #include "iniprint.h"
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/sw_case_williamson91_6.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/sw_case_williamson91_6.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/sw_case_williamson91_6.F	(revision 1422)
@@ -26,4 +26,7 @@
 c
 c=======================================================================
+      USE comvert_mod, ONLY: ap,bp,preff
+      USE comconst_mod, ONLY: cpp,omeg,rad
+
       IMPLICIT NONE
 c-----------------------------------------------------------------------
@@ -33,6 +36,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
-#include "comconst.h"
 #include "comgeom.h"
 #include "iniprint.h"
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/temps_mod.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/temps_mod.F90	(revision 1422)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/temps_mod.F90	(revision 1422)
@@ -0,0 +1,28 @@
+MODULE temps_mod
+
+IMPLICIT NONE  
+
+! jD_ref = jour julien de la date de reference (lancement de l'experience)
+! hD_ref = "heure" julienne de la date de reference
+
+      INTEGER   itaufin ! total number of dynamical steps for the run
+      INTEGER   itau_dyn, itau_phy
+      INTEGER   day_ini ! initial day # of simulation sequence
+      INTEGER   day_end ! final day # ; i.e. day # when this simulation ends
+      INTEGER   annee_ref
+      INTEGER   day_ref
+      REAL      dt ! (dynamics) time step (changes if doing Matsuno or LF step)
+      REAL      jD_ref, jH_ref, start_time
+      CHARACTER (len=10) :: calend
+
+      ! Additionnal Mars stuff:
+      real hour_ini ! initial fraction of day of simulation sequence (0=<hour_ini<1)
+
+!$OMP THREADPRIVATE(dt,jD_ref,jH_ref,start_time,hour_ini,			&
+  !$OMP		day_ini,day_end,annee_ref,day_ref,itau_dyn,itau_phy,itaufin,	&
+  !$OMP		calend)	
+
+!BE CAREFUL: when adding a threadprivate variable in this module
+!	do not forget to add it to copyin clause of gcm.F (before CALL leapfrog_p)
+
+END MODULE temps_mod
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/top_bound_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/top_bound_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/top_bound_p.F	(revision 1422)
@@ -4,10 +4,11 @@
       SUBROUTINE top_bound_p(vcov,ucov,teta,masse,dt,ducov)
       USE parallel_lmdz
+      USE comvert_mod, ONLY: presnivs,preff,scaleheight
+      USE comconst_mod, ONLY: iflag_top_bound,tau_top_bound,
+     .			mode_top_bound
       IMPLICIT NONE
 c
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom2.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/tourpot_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/tourpot_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/tourpot_p.F	(revision 1422)
@@ -23,5 +23,4 @@
 #include "paramet.h"
 #include "comgeom.h"
-#include "logic.h"
 
       REAL  rot( ip1jm,llm )
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/vitvert_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/vitvert_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/vitvert_p.F	(revision 1422)
@@ -2,4 +2,5 @@
 c
       USE parallel_lmdz
+      USE comvert_mod, ONLY: bp
       IMPLICIT NONE
 
@@ -28,5 +29,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comvert.h"
 
       REAL w(ip1jmp1,llm),convm(ip1jmp1,llm)
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/vlsplt_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/vlsplt_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/vlsplt_p.F	(revision 1422)
@@ -21,7 +21,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 
 c
@@ -204,7 +201,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 c
 c
@@ -535,11 +529,10 @@
 c   --------------------------------------------------------------------
       USE parallel_lmdz
+      USE comconst_mod, ONLY: pi
+
       IMPLICIT NONE
 c
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 #include "comgeom.h"
 c
@@ -928,7 +921,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 c
 c
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/vlspltgen_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/vlspltgen_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/vlspltgen_p.F	(revision 1422)
@@ -27,4 +27,5 @@
       USE VAMPIR
       USE infotrac, ONLY : nqtot
+      USE comconst_mod, ONLY: cpp
       IMPLICIT NONE
 
@@ -32,7 +33,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 
 c
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/vlspltqs_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/vlspltqs_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/vlspltqs_p.F	(revision 1422)
@@ -31,7 +31,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 
 c
@@ -245,7 +242,4 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 c
 c
@@ -593,11 +587,9 @@
 c   --------------------------------------------------------------------
       USE parallel_lmdz
+      USE comconst_mod, ONLY: pi
       IMPLICIT NONE
 c
 #include "dimensions.h"
 #include "paramet.h"
-#include "logic.h"
-#include "comvert.h"
-#include "comconst.h"
 #include "comgeom.h"
 c
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/writedynav_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/writedynav_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/writedynav_p.F	(revision 1422)
@@ -12,4 +12,6 @@
       USE misc_mod
       USE infotrac
+      USE comconst_mod, ONLY: cpp
+      USE temps_mod, ONLY: itau_dyn
       implicit none
 
@@ -42,12 +44,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "temps.h"
-#include "ener.h"
-#include "logic.h"
-#include "description.h"
-#include "serre.h"
 #include "iniprint.h"
 
Index: trunk/LMDZ.COMMON/libf/dyn3dpar/writehist_p.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3dpar/writehist_p.F	(revision 1403)
+++ trunk/LMDZ.COMMON/libf/dyn3dpar/writehist_p.F	(revision 1422)
@@ -12,4 +12,5 @@
       USE misc_mod
       USE infotrac
+      USE temps_mod, ONLY: itau_dyn
       implicit none
 
@@ -43,12 +44,5 @@
 #include "dimensions.h"
 #include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
 #include "comgeom.h"
-#include "temps.h"
-#include "ener.h"
-#include "logic.h"
-#include "description.h"
-#include "serre.h"
 #include "iniprint.h"
 
