Index: LMDZ5/trunk/libf/dyn3dmem/advtrac_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/advtrac_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/advtrac_loc.F	(revision 2601)
@@ -35,5 +35,4 @@
       include "comgeom2.h"
       include "logic.h"
-      include "temps.h"
       include "ener.h"
       include "description.h"
Index: LMDZ5/trunk/libf/dyn3dmem/bilan_dyn_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/bilan_dyn_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/bilan_dyn_loc.F	(revision 2601)
@@ -19,4 +19,5 @@
       USE comconst_mod, ONLY: cpp, pi
       USE comvert_mod, ONLY: presnivs
+      USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn
       
       IMPLICIT NONE
@@ -25,5 +26,4 @@
       include "paramet.h"
       include "comgeom2.h"
-      include "temps.h"
       include "iniprint.h"
 
Index: LMDZ5/trunk/libf/dyn3dmem/call_calfis_mod.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/call_calfis_mod.F90	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/call_calfis_mod.F90	(revision 2601)
@@ -84,8 +84,8 @@
   USE comconst_mod, ONLY: dtphys
   USE comvert_mod, ONLY: ap, bp, pressure_exner
+  USE temps_mod, ONLY: day_ini, day_ref, jd_ref, jh_ref, start_time
   
   IMPLICIT NONE
     INCLUDE "logic.h"
-    INCLUDE "temps.h"
     INCLUDE "iniprint.h"
 
Index: LMDZ5/trunk/libf/dyn3dmem/conf_gcm.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/conf_gcm.F90	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/conf_gcm.F90	(revision 2601)
@@ -22,4 +22,5 @@
   USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, &
                        alphax,alphay,taux,tauy
+  USE temps_mod, ONLY: calend
 
   IMPLICIT NONE
@@ -42,5 +43,4 @@
   include "logic.h"
   include "comdissnew.h"
-  include "temps.h"
   include "iniprint.h"
 
Index: LMDZ5/trunk/libf/dyn3dmem/dynetat0_loc.f90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/dynetat0_loc.f90	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/dynetat0_loc.f90	(revision 2601)
@@ -16,9 +16,10 @@
                           omeg, rad
   USE serre_mod, ONLY: clon, clat, grossismx, grossismy
+  USE temps_mod, ONLY: annee_ref,day_ref,itau_dyn, &
+                       start_time,day_ini,hour_ini
   
   IMPLICIT NONE
   include "dimensions.h"
   include "paramet.h"
-  include "temps.h"
   include "comgeom.h"
   include "ener.h"
Index: LMDZ5/trunk/libf/dyn3dmem/dynredem_loc.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/dynredem_loc.F90	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/dynredem_loc.F90	(revision 2601)
@@ -18,4 +18,5 @@
   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
 
   IMPLICIT NONE
@@ -23,5 +24,4 @@
   include "paramet.h"
   include "comgeom.h"
-  include "temps.h"
   include "ener.h"
   include "logic.h"
@@ -179,4 +179,6 @@
   USE dynredem_mod, ONLY: dynredem_write_u, dynredem_write_v, dynredem_read_u, &
                           err, modname, fil, msg
+  USE temps_mod, ONLY: itau_dyn, itaufin
+  
   IMPLICIT NONE
   include "dimensions.h"
@@ -184,5 +186,4 @@
   include "description.h"
   include "comgeom.h"
-  include "temps.h"
   include "iniprint.h"
 !===============================================================================
Index: LMDZ5/trunk/libf/dyn3dmem/gcm.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/gcm.F90	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/gcm.F90	(revision 2601)
@@ -22,4 +22,8 @@
 #endif
   USE comconst_mod, ONLY: cpp, daysec, dtphys, dtvr, g, r, rad
+  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
 
@@ -58,5 +62,4 @@
   include "comgeom.h"
   include "logic.h"
-  include "temps.h"
   include "ener.h"
   include "description.h"
@@ -449,5 +452,9 @@
   !       write(78,*) 'q',q
 
-  !$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logici/,/logicl/)
+  !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logici/,/logicl/)
+  !$OMP PARALLEL DEFAULT(SHARED) COPYIN(/logici/,/logicl/) &
+  !     Copy all threadprivate variables in temps_mod
+  !$OMP COPYIN(dt,jD_ref,jH_ref,start_time,hour_ini,day_ini,day_end) &
+  !$OMP COPYIN(annee_ref,day_ref,itau_dyn,itau_phy,itaufin,calend)
   CALL leapfrog_loc(ucov,vcov,teta,ps,masse,phis,q,time_0)
   !$OMP END PARALLEL
Index: LMDZ5/trunk/libf/dyn3dmem/iniacademic_loc.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/iniacademic_loc.F90	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/iniacademic_loc.F90	(revision 2601)
@@ -20,4 +20,5 @@
   USE comconst_mod, ONLY: cpp, kappa, g, daysec, dtvr, pi, im, jm
   USE comvert_mod, ONLY: ap, bp, preff, presnivs, pressure_exner
+  USE temps_mod, ONLY: annee_ref, day_ini, day_ref
 
   !   Author:    Frederic Hourdin      original: 15/01/93
@@ -35,5 +36,4 @@
   include "academic.h"
   include "ener.h"
-  include "temps.h"
   include "iniprint.h"
   include "logic.h"
Index: LMDZ5/trunk/libf/dyn3dmem/initdynav_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/initdynav_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/initdynav_loc.F	(revision 2601)
@@ -16,4 +16,5 @@
        USE comconst_mod, ONLY: pi
        USE comvert_mod, ONLY: presnivs
+       USE temps_mod, ONLY: itau_dyn
        
        implicit none
@@ -47,5 +48,4 @@
       include "paramet.h"
       include "comgeom.h"
-      include "temps.h"
       include "ener.h"
       include "logic.h"
Index: LMDZ5/trunk/libf/dyn3dmem/initfluxsto_p.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/initfluxsto_p.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/initfluxsto_p.F	(revision 2601)
@@ -15,4 +15,5 @@
        USE comconst_mod, ONLY: pi
        USE comvert_mod, ONLY: nivsigs
+       USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn
        
       implicit none
@@ -48,5 +49,4 @@
       include "paramet.h"
       include "comgeom.h"
-      include "temps.h"
       include "ener.h"
       include "logic.h"
Index: LMDZ5/trunk/libf/dyn3dmem/inithist_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/inithist_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/inithist_loc.F	(revision 2601)
@@ -16,4 +16,5 @@
        USE comconst_mod, ONLY: pi
        USE comvert_mod, ONLY: presnivs
+       USE temps_mod, ONLY: itau_dyn
        
        implicit none
@@ -46,5 +47,4 @@
       include "paramet.h"
       include "comgeom.h"
-      include "temps.h"
       include "ener.h"
       include "logic.h"
Index: LMDZ5/trunk/libf/dyn3dmem/integrd_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/integrd_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/integrd_loc.F	(revision 2601)
@@ -14,4 +14,5 @@
       USE comconst_mod, ONLY: pi
       USE comvert_mod, ONLY: ap, bp
+      USE temps_mod, ONLY: dt
       
       IMPLICIT NONE
@@ -37,5 +38,4 @@
       include "comgeom.h"
       include "logic.h"
-      include "temps.h"
       include "iniprint.h"
 
Index: LMDZ5/trunk/libf/dyn3dmem/leapfrog_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/leapfrog_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/leapfrog_loc.F	(revision 2601)
@@ -34,4 +34,6 @@
        USE comconst_mod, ONLY: cpp, dtvr, ihf
        USE comvert_mod, ONLY: ap, bp, pressure_exner
+       USE temps_mod, ONLY: itaufin,jD_ref,jH_ref,day_ini,
+     &                        day_ref,start_time,dt
        
       IMPLICIT NONE
@@ -73,5 +75,4 @@
       include "comgeom.h"
       include "logic.h"
-      include "temps.h"
       include "ener.h"
       include "description.h"
Index: LMDZ5/trunk/libf/dyn3dmem/temps.h
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/temps.h	(revision 2600)
+++ 	(revision )
@@ -1,27 +1,0 @@
-!
-! $Id$
-!
-!  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)
-!
-!
-! jD_ref = jour julien de la date de reference (lancement de l'experience)
-! hD_ref = "heure" julienne de la date de reference
-!-----------------------------------------------------------------------
-! INCLUDE 'temps.h'
-
-      COMMON/temps/ dt, jD_ref, jH_ref, start_time,                     &
-     &             day_ini, day_end, annee_ref, day_ref,                &
-     &             itau_dyn, itau_phy, itaufin, calend
-
-
-      INTEGER   itaufin
-      INTEGER itau_dyn, itau_phy 
-      INTEGER day_ini, day_end, annee_ref, day_ref
-      REAL      dt, jD_ref, jH_ref, start_time
-      CHARACTER (len=10) :: calend
-
-!$OMP THREADPRIVATE(/temps/)
-!-----------------------------------------------------------------------
Index: LMDZ5/trunk/libf/dyn3dmem/temps_mod.F90
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/temps_mod.F90	(revision 2601)
+++ LMDZ5/trunk/libf/dyn3dmem/temps_mod.F90	(revision 2601)
@@ -0,0 +1,33 @@
+!
+! $Id: temps_mod.F90 -1   $
+!
+MODULE temps_mod
+
+IMPLICIT NONE  
+
+  INTEGER   itaufin ! total number of dynamical steps for the run
+  INTEGER   itau_dyn
+  INTEGER   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 ! reference julian day date (beginning of experiment)
+  REAL      jH_ref ! reference julian "hour" of reference julian date
+  REAL      start_time
+  CHARACTER (len=10) :: calend ! calendar type
+
+  ! 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)        
+
+!WARNING: when adding a threadprivate variable in this module
+!        do not forget to add it to the copyin clause when opening an OpenMP
+!        parallel section. e.g. in gcm before call leapfrog_loc and/or
+!        possibly in iniphysiq
+
+END MODULE temps_mod
Index: LMDZ5/trunk/libf/dyn3dmem/writedynav_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/writedynav_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/writedynav_loc.F	(revision 2601)
@@ -14,4 +14,6 @@
       use com_io_dyn_mod, only : histaveid,histvaveid,histuaveid
       USE comconst_mod, ONLY: cpp
+      USE temps_mod, ONLY: itau_dyn
+      
       implicit none
 
@@ -45,5 +47,4 @@
       include "paramet.h"
       include "comgeom.h"
-      include "temps.h"
       include "ener.h"
       include "logic.h"
Index: LMDZ5/trunk/libf/dyn3dmem/writehist_loc.F
===================================================================
--- LMDZ5/trunk/libf/dyn3dmem/writehist_loc.F	(revision 2600)
+++ LMDZ5/trunk/libf/dyn3dmem/writehist_loc.F	(revision 2601)
@@ -14,4 +14,6 @@
       use com_io_dyn_mod, only : histid,histvid,histuid
       USE comconst_mod, ONLY: cpp
+      USE temps_mod, ONLY: itau_dyn
+      
       implicit none
 
@@ -45,5 +47,4 @@
       include "paramet.h"
       include "comgeom.h"
-      include "temps.h"
       include "ener.h"
       include "logic.h"
