Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 2611)
+++ /trunk/LMDZ.MARS/README	(revision 2612)
@@ -3584,2 +3584,5 @@
 == 18/01/2022 == RV
 Open_MP files reading for moldiff : callmoldiff = .true.
+
+== 18/01/2022 == RV
+Open_MP : Put all the "COMMON" of *.h file as "$OMP THREADPRIVATE"
Index: /trunk/LMDZ.MARS/libf/aeronomars/chimiedata.h
===================================================================
--- /trunk/LMDZ.MARS/libf/aeronomars/chimiedata.h	(revision 2611)
+++ /trunk/LMDZ.MARS/libf/aeronomars/chimiedata.h	(revision 2612)
@@ -18,4 +18,6 @@
       common/chimiedata/jphot,colairtab,table_ozo
 
+!$OMP THREADPRIVATE(/chimiedata/)
+
       real jphot(ntemp,nsza,nz,nozo,ntau,nd)
       real colairtab(nz)
Index: /trunk/LMDZ.MARS/libf/phymars/callkeys.h
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/callkeys.h	(revision 2611)
+++ /trunk/LMDZ.MARS/libf/phymars/callkeys.h	(revision 2612)
@@ -18,11 +18,15 @@
      &   ,latentheat_surfwater,gwd_convective_source,startphy_file      &
      &   ,hdo,hdofrac,cst_cap_albedo,temp_dependant_m,refill_watercap
+!$OMP THREADPRIVATE(/callkeys_l/)
+
      
       COMMON/callkeys_i/iradia,iaervar,ilwd,ilwb,ilwn,ncouche           &
      &   ,nltemodel,nircorr,solvarmod,solvaryear,dustinjection
+!$OMP THREADPRIVATE(/callkeys_i/)
      
       COMMON/callkeys_r/semi,alphan,euveff,                             &
      &   tke_heat_flux,dustrefir,fixed_euv_value,CLFfixval,             &
      &   coeff_injection,ti_injection,tf_injection,coeff_detrainment
+!$OMP THREADPRIVATE(/callkeys_r/)
      
       LOGICAL callrad,calldifv,calladj,callcond,callsoil,               &
@@ -34,4 +38,5 @@
 
       COMMON/aeroutput/dustiropacity
+!$OMP THREADPRIVATE(/aeroutput/)
 
       logical startphy_file
Index: /trunk/LMDZ.MARS/libf/phymars/comg1d.h
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/comg1d.h	(revision 2611)
+++ /trunk/LMDZ.MARS/libf/phymars/comg1d.h	(revision 2612)
@@ -47,4 +47,6 @@
      &             ,g2d_appel
      &             ,g1d_nvar
+!$OMP THREADPRIVATE(/COMG1DI/)
+
       COMMON/COMG1DC/g1d_dimvar(0:g1d_nvarmx)
      &             ,g1d_nomfich
@@ -54,6 +56,10 @@
      &             ,g1d_tmp1
      &             ,g1d_tmp2
+!$OMP THREADPRIVATE(/COMG1DC/)
+
       COMMON/COMG1DL/g1d_premier
      &             ,g2d_premier
+!$OMP THREADPRIVATE(/COMG1DL/)
+
 c
 c.......................................................................
Index: /trunk/LMDZ.MARS/libf/phymars/microphys.h
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/microphys.h	(revision 2611)
+++ /trunk/LMDZ.MARS/libf/phymars/microphys.h	(revision 2612)
@@ -94,4 +94,7 @@
       COMMON/microphys/rad_cld,vo1,rad_cldco2,vo1co2
 		  COMMON/microphys_2/mteta
+!$OMP THREADPRIVATE(/microphys/)
+!$OMP THREADPRIVATE(/microphys_2/)
+
       
 !     EXAMPLE:
Index: /trunk/LMDZ.MARS/libf/phymars/nirdata.h
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/nirdata.h	(revision 2611)
+++ /trunk/LMDZ.MARS/libf/phymars/nirdata.h	(revision 2612)
@@ -4,4 +4,5 @@
 
       common /NIRdata/ pres1d,corgcm,oco21d,alfa,p1999
+!$OMP THREADPRIVATE(/NIRdata/)
       real    pres1d(npres)
       real    corgcm(npres)
Index: /trunk/LMDZ.MARS/libf/phymars/nlte_commons.h
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/nlte_commons.h	(revision 2611)
+++ /trunk/LMDZ.MARS/libf/phymars/nlte_commons.h	(revision 2612)
@@ -8,4 +8,5 @@
 c
 	common /spectralv11/ elow, deltanu
+!$OMP THREADPRIVATE(/spectralv11/)
 	real elow(nisot,nb), deltanu(nisot,nb)
 
@@ -13,4 +14,5 @@
 	common/nu_levs_bands_v11/ nu11, nu12, nu121,  
      @  	nu21, nu31, nu41
+!$OMP THREADPRIVATE(/nu_levs_bands_v11/)
 	real*8 nu11, nu12, nu121
 	real*8 nu21
@@ -20,7 +22,11 @@
 
 	common /aeinstein1v11/ a1_010_000, a1_020_010
-	common /aeinstein2v11/ a2_010_000        
+!$OMP THREADPRIVATE(/aeinstein1v11/)
+	common /aeinstein2v11/ a2_010_000    
+!$OMP THREADPRIVATE(/aeinstein2v11/)    
 	common /aeinstein3v11/ a3_010_000        
+!$OMP THREADPRIVATE(/aeinstein3v11/)
 	common /aeinstein4v11/ a4_010_000        
+!$OMP THREADPRIVATE(/aeinstein4v11/)
 
 	real*8 a1_010_000, a1_020_010
@@ -35,4 +41,5 @@
      @  	tstar11tab, tstar21tab, tstar31tab, tstar41tab,
      @  	vc210tab, vc310tab, vc410tab
+!$OMP THREADPRIVATE(/input_tab_v11/)
 
 	real*8 lnpnbtab(nztabul)
@@ -45,11 +52,16 @@
 
 	common/input_avilable_from/ input_cza
+!$OMP THREADPRIVATE(/input_avilable_from/)
 	integer input_cza 
 
 c temperatura vibracional de entrada:
 	common/temp626/ v626t1
+!$OMP THREADPRIVATE(/temp626/)
 	common/temp628/ v628t1 
+!$OMP THREADPRIVATE(/temp628/)
 	common/temp636/ v636t1 
+!$OMP THREADPRIVATE(/temp636/)
 	common/temp627/ v627t1 
+!$OMP THREADPRIVATE(/temp627/)
 	real*8 v626t1(nl)
 	real*8 v628t1(nl)
@@ -59,11 +71,14 @@
 c output de cza.for
 	common /tv15um/	vt11, vt12, vt21, vt31, vt41
+!$OMP THREADPRIVATE(/tv15um/)
 	real*8  vt11(nl), vt12(nl), vt21(nl), vt31(nl), vt41(nl)
 
 	common /hr15um/	hr110,hr210,hr310,hr410,hr121
+!$OMP THREADPRIVATE(/hr15um/)
 	real*8  hr110(nl),hr121(nl), 
      @      	hr210(nl),hr310(nl),hr410(nl)
 
         common/sf15um/ el11,el12, el21, el31, el41
+!$OMP THREADPRIVATE(/sf15um/)
         real*8 el11(nl), el12(nl)
         real*8 el21(nl)
@@ -72,4 +87,5 @@
 
         common/sl15um/ sl110,sl121, sl210,sl310,sl410
+!$OMP THREADPRIVATE(/sl15um/)
         real*8 sl110(nl), sl121(nl)
         real*8 sl210(nl)
@@ -85,4 +101,5 @@
      @  	c310,c410,
      @  	vc110,vc121,vc210,vc310,vc410
+!$OMP THREADPRIVATE(/curtis_matrixes_15um/)
 	real*8 c110(nl,nl), c121(nl,nl)
 	real*8 c210(nl,nl)
@@ -96,4 +113,5 @@
 	common/taustar_15um/ taustar11, taustar21, taustar31, 
      @         taustar41, taustar12, taustar11_cts
+!$OMP THREADPRIVATE(/taustar_15um/)
 	real*8 taustar11(nl), taustar21(nl), taustar31(nl)
 	real*8 taustar41(nl), taustar12(nl)
@@ -109,4 +127,5 @@
      @    co2vmr, n2vmr, covmr, o3pvmr, 
      @    hrkday_factor
+!$OMP THREADPRIVATE(/atm_nl/)
 
         real zl(nl), t(nl), pl(nl), nt(nl),  
@@ -119,4 +138,5 @@
 c
         common /atm_ny/ zy, ty, py, nty, co2y
+!$OMP THREADPRIVATE(/atm_ny/)
         real zy(nzy), ty(nzy), py(nzy), nty(nzy), co2y(nzy)
 
@@ -124,4 +144,5 @@
 	common/deltazetas/ deltaz, deltazy, deltaz_cts, deltazy_cts, 
      @        jlowerboundary, jtopboundary, jtopCTS
+!$OMP THREADPRIVATE(/deltazetas/)
 	real    deltaz, deltazy, deltaz_cts, deltazy_cts
 	integer jlowerboundary, jtopboundary, jtopCTS
@@ -134,4 +155,5 @@
      @    co2vmr_cts, n2vmr_cts, covmr_cts, o3pvmr_cts, 
      @    hrkday_factor_cts,mmean_cts,cpnew_cts
+!$OMP THREADPRIVATE(/atm_nl_cts/)
 
         real zl_cts(nl_cts), t_cts(nl_cts), pl_cts(nl_cts), 
@@ -147,4 +169,5 @@
 c
         common /atm_ny_cts/ zy_cts, ty_cts, py_cts, nty_cts, co2y_cts
+!$OMP THREADPRIVATE(/atm_ny_cts/)
         real zy_cts(nzy_cts), ty_cts(nzy_cts), py_cts(nzy_cts), 
      @          nty_cts(nzy_cts), co2y_cts(nzy_cts)
@@ -157,4 +180,5 @@
      @      k19ca(4),k19cb(4),k19cc(4), k19cap(4),k19cbp(4),k19ccp(4),
      @      k20b(4),k20c(4), k20bp(4),k20cp(4)
+!$OMP THREADPRIVATE(/rates_vt/)
 
 	real*8 k19ba,k19bb,k19bc, k19bap,k19bbp,k19bcp
@@ -165,4 +189,5 @@
      @      	k21b(4),k21c(4), k21bp(4),k21cp(4),
      @      	k33c, k33cp(2:4)
+!$OMP THREADPRIVATE(/rates_vv/)
 
 	real*8 k21b,k21c, k21bp,k21cp
@@ -171,4 +196,5 @@
 	common/rates_last/ k23k21c, k24k21c, k34k21c, 
      @      	k23k21cp, k24k21cp, k34k21cp
+!$OMP THREADPRIVATE(/rates_last/)
 
 	real*8 k23k21c,k24k21c,k34k21c, k23k21cp,k24k21cp,k34k21cp 
@@ -179,17 +205,22 @@
 
         common /ini_file/ ibcode1
+!$OMP THREADPRIVATE(/ini_file/)
 	character ibcode1*1
 
 	common/block1/ alsa,alda,ka,kr
+!$OMP THREADPRIVATE(/block1/)
 	real*8 ka(nbox_max),alsa(nbox_max),alda(nbox_max)
-	integer kr
+	integer kr   
 
 	common/block2/ hisfile
+!$OMP THREADPRIVATE(/block2/)
 	character hisfile*75
 
 	common/block3/ pp,ta,w
+!$OMP THREADPRIVATE(/block3/)
 	real*8 pp,ta(nbox_max),w
 
 	common/block4/ no,sk1,xls1,xld1,thist,nbox
+!$OMP THREADPRIVATE(/block4/)
 	real*8	sk1(nhist,nbox_max)
 	real*8  xls1(nhist,nbox_max)	
@@ -200,4 +231,5 @@
 
 	common/block5/eqw, aa,  cc, dd, ddbox, ccbox, mr, mr_cts
+!$OMP THREADPRIVATE(/block5/)
 	real*8 eqw, aa, cc, dd
 	real*8 ddbox(nbox_max), ccbox(nbox_max)
@@ -207,4 +239,5 @@
      &          xld1_stored, thist_stored, nbox_stored, 
      &          mm_stored
+!$OMP THREADPRIVATE(/blockstore/)
          real*8 sk1_stored(nb,nhist,nbox_max)
 	 real*8 xls1_stored(nb,nhist,nbox_max)	
Index: /trunk/LMDZ.MARS/libf/phymars/yoegwd.h
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/yoegwd.h	(revision 2611)
+++ /trunk/LMDZ.MARS/libf/phymars/yoegwd.h	(revision 2612)
@@ -8,4 +8,5 @@
       COMMON/YOEGWD/ GFRCRIT,GRCRIT,GVCRIT,GKDRAG,GKDRAGL,GHMAX         &
      &             ,GRAHILO,GSIGCR,NKTOPG,GSSEC, GTSEC, GVSEC,GKWAKE
+!$OMP THREADPRIVATE(/YOEGWD/)
 
 
