Index: trunk/LMDZ.VENUS/libf/phyvenus/compo_hedin_mod2.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/compo_hedin_mod2.F90	(revision 4088)
+++ trunk/LMDZ.VENUS/libf/phyvenus/compo_hedin_mod2.F90	(revision 4092)
@@ -2,14 +2,25 @@
   !!05/2013 Laura Salmi
   !!03/2014 revision Gabriella Gilli
-  !!Calcul des vmr pour CO2, CO, O, N et N2 en s'appuyant sur les tables donnees dans l'article Hedin (1983)
+  !!Compute vmr for CO2, CO, O, N and N2 based on tables from Hedin (1983) paper
   
   implicit none      
+
+  integer, parameter :: zsize=23  ! for z from 100 to 210 km
+  integer, parameter :: musize=10 ! for sza ranging from -1 to 1
+  
+  real, save, protected :: co2_hedin(musize,zsize)
+  real, save, protected :: co_hedin(musize,zsize)
+  real, save, protected :: n2_hedin(musize,zsize)
+  real, save, protected :: o_hedin(musize,zsize)
+  real, save, protected :: n_hedin(musize,zsize)
+  
+  real, save, protected :: pres_hedin(musize,zsize)
+  real, save, protected :: mu_hedin(musize)
+  
   contains
 
         subroutine compo_hedin83_init2
-        use YOMCST_mod
+        use YOMCST_mod, only: RKBOL
         implicit none
-!#include "YOMCST.h"
-#include "hedin.h"
 
 	REAL :: alpha
@@ -133,7 +144,7 @@
 !!Interpolation des profils de Hedin (1983) sur la grille du modele
 
-	use dimphy
+	use dimphy, only: klon, klev
 	implicit none
-	include 'hedin.h'
+
 	REAL, intent(in) :: pression(klon,klev), mu0(klon)
 	integer :: i,k,iz,jmu,jz,z_ok, mu_ok
Index: trunk/LMDZ.VENUS/libf/phyvenus/hedin.h
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/hedin.h	(revision 4088)
+++ 	(revision )
@@ -1,13 +1,0 @@
-
-      integer musize,zsize
-      parameter (zsize=23)        ! pour z de 100 a 210 km
-      parameter (musize=10)	  ! pour sza de 1 a -1
-      common /hedin/ o_hedin,co2_hedin,n2_hedin,co_hedin,pres_hedin,    &
-     &			mu_hedin,n_hedin
-      		
-
-      real  :: co2_hedin(musize,zsize),co_hedin(musize,zsize)
-      real  :: n2_hedin(musize,zsize),o_hedin(musize,zsize)
-      real  :: n_hedin(musize,zsize)
-      real  :: pres_hedin(musize,zsize), mu_hedin(musize)
-    
Index: trunk/LMDZ.VENUS/libf/phyvenus/nir_leedat.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/nir_leedat.F	(revision 4088)
+++ 	(revision )
@@ -1,40 +1,0 @@
-c***********************************************************************
-      subroutine NIR_leedat                              
-                                                
-c 	reads parameters for NIR NLTE calculation    
-                                                
-c 	nov 2011    fgg+malv    first version                
-c***********************************************************************
-
-      implicit none                                  
-                                                
-     
-      include 'nirdata.h'
-c      include 'datafile.h'                                          
-                                                
-c local variables                               
-
-      integer 	ind                      
-      character (len=100) :: datafile="HIGHATM"
-                              
-c***********************************************************************
-      
-      open(43,file=trim(datafile)//'/NIRcorrection_feb2011.dat',
-     $       status='old')         
-      do ind=1,9
-         read(43,*)
-      enddo
-      
-      do ind=1,npres
-         read(43,*)pres1d(ind),corgcm(ind),oco21d(ind),p1999(ind),
-     $        alfa(ind)
-                                !Tabulated pression to Pa
-         pres1d(ind)=pres1d(ind)*100.
-        
-      enddo
-    
-      close(43)
-      
-      return
-
-      end
Index: trunk/LMDZ.VENUS/libf/phyvenus/nirco2abs.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/nirco2abs.F	(revision 4088)
+++ trunk/LMDZ.VENUS/libf/phyvenus/nirco2abs.F	(revision 4092)
@@ -8,5 +8,5 @@
        use clesphys_mod
        use YOMCST_mod
-c       use compo_hedin83_mod2 
+       use nirdata_mod, only: pres1d, corgcm, alfa, npres, oco21d
 
 
@@ -57,11 +57,4 @@
 c    ------------------
 c
-
-c#include "YOMCST.h"
-c#include "clesphys.h"
-c#include "comdiurn.h"
-#include "nirdata.h"
-c#include "tracer.h"
-c#include "mmol.h"
 
 c-----------------------------------------------------------------------
Index: trunk/LMDZ.VENUS/libf/phyvenus/nirdata.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/nirdata.F90	(revision 4092)
+++ trunk/LMDZ.VENUS/libf/phyvenus/nirdata.F90	(revision 4092)
@@ -0,0 +1,58 @@
+module nirdata_mod
+
+implicit none
+
+! Number of pressures in NIR correction table
+integer,parameter :: npres=42   
+
+real,save,protected :: pres1d(npres)
+real,save,protected :: corgcm(npres)
+real,save,protected :: oco21d(npres)
+real,save,protected :: alfa(npres)
+real,save,protected :: p1999(npres)
+!$OMP THREADPRIVATE(pres1d,corgcm,oco21d,alfa,p1999)
+
+contains
+
+  subroutine nir_leedat 
+
+! 	reads parameters for NIR NLTE calculation    
+
+! 	nov 2011    fgg+malv    first version                
+!***********************************************************************
+
+    use mod_phys_lmdz_para, only: is_master, bcast
+
+    implicit none
+  
+    integer :: ind
+    character (len=100) :: datafile="HIGHATM"
+    
+    if (is_master) then ! only the master needs read the file
+      open(43,file=trim(datafile)//'/NIRcorrection_feb2011.dat', &
+              status='old')
+      do ind=1,9
+         read(43,*)
+      enddo
+      
+      do ind=1,npres
+         read(43,*)pres1d(ind),corgcm(ind),oco21d(ind),p1999(ind), &
+                   alfa(ind)
+         ! Tabulated pressure to Pa
+         pres1d(ind)=pres1d(ind)*100.
+      enddo
+      
+      close(43)
+    
+    endif ! of if (is_master)
+  
+    ! broadcast to all cores
+    call bcast(pres1d)
+    call bcast(corgcm)
+    call bcast(oco21d)
+    call bcast(p1999)
+    call bcast(alfa)
+
+  end subroutine nir_leedat 
+
+end module nirdata_mod
Index: trunk/LMDZ.VENUS/libf/phyvenus/nirdata.h
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/nirdata.h	(revision 4088)
+++ 	(revision )
@@ -1,9 +1,0 @@
-
-      integer npres                ! Number of pressures in NIR correction
-      parameter (npres=42)         ! table
-
-      common /NIRdata/ pres1d,corgcm,oco21d,alfa,p1999
-      real    pres1d(npres)
-      real    corgcm(npres)
-      real    oco21d(npres),alfa(npres),p1999(npres)
-    
Index: trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F	(revision 4088)
+++ trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F	(revision 4092)
@@ -77,5 +77,7 @@
       USE conc
       USE param_v4_h
-      USE compo_hedin83_mod2
+      use compo_hedin83_mod2, only: compo_hedin83_init2
+      use compo_hedin83_mod2, only: compo_hedin83_mod
+      use nirdata_mod, only: nir_leedat
       use radlwsw_newtoncool_mod, only: radlwsw_newtoncool
       use radlwsw_mod, only: radlwsw
@@ -130,6 +132,4 @@
 c======================================================================
 #include "iniprint.h"
-#include "nirdata.h"
-#include "hedin.h"
 c======================================================================
       LOGICAL, SAVE :: ok_journe ! flag to output IOIPSL file histday
