Index: trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.fcm
===================================================================
--- trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.fcm	(revision 3612)
+++ trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.fcm	(revision 3613)
@@ -5,5 +5,5 @@
 %MAKE                make
 %FPP                 mpif90 -E
-%FPP_FLAGS           
+%FPP_FLAGS
 %CPP_FLAGS           -P
 %FPP_DEF             NC_DOUBLE LAPACK FFT_MKL
@@ -16,6 +16,6 @@
 %C_OPTIM             -O3
 %MPI_FFLAGS
-%OMP_FFLAGS          -qopenmp 
+%OMP_FFLAGS          -qopenmp
 %BASE_LD             -i4 -r8 -auto -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread
 %MPI_LD
-%OMP_LD              -qopenmp 
+%OMP_LD              -qopenmp
Index: trunk/LMDZ.PLUTO/libf/phypluto/callcorrk.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/callcorrk.F90	(revision 3612)
+++ trunk/LMDZ.PLUTO/libf/phypluto/callcorrk.F90	(revision 3613)
@@ -221,5 +221,6 @@
 
       ! local variable
-      REAL dpp  ! intermediate
+      REAL, save :: dpp  ! intermediate
+!$OMP THREADPRIVATE(dpp)
 
       integer ok ! status (returned by NetCDF functions)
@@ -461,10 +462,10 @@
                reffrad(:,:,1) = mp2m_rc_sph(:,:) * exp(5.*sig**2 / 2.)
             elsewhere
-               reffrad(:,:,1) = 0d0     
+               reffrad(:,:,1) = 0d0
             endwhere
             if (exp(sig**2) - 1 > 0.1) then
                nueffrad(:,:,1) = exp(sig**2) - 1
             else
-               nueffrad(:,:,1) = 0.1    
+               nueffrad(:,:,1) = 0.1
             endif
             ! Fractal aerosols
@@ -478,7 +479,7 @@
                nueffrad(:,:,2) = exp(sig**2) - 1
             else
-               nueffrad(:,:,2) = 0.1    
+               nueffrad(:,:,2) = 0.1
             endif
-           
+
          else
             do iaer=1,naerkind
@@ -724,5 +725,5 @@
          end do
          qvar(1)=qvar(2)
-      
+
       else
          do k=1,L_LEVELS
@@ -736,5 +737,5 @@
 
       DO l=1,nlayer
-         muvarrad(2*l)   = muvar(ig,nlayer+2-l)    
+         muvarrad(2*l)   = muvar(ig,nlayer+2-l)
          muvarrad(2*l+1) = (muvar(ig,nlayer+2-l)+muvar(ig,max(nlayer+1-l,1)))/2
       END DO
@@ -949,9 +950,10 @@
             nfluxtopv       = 0.0d0
             fluxtopvdn      = 0.0d0
+            nfluxtopv_nu(:) = 0.0d0
             nfluxoutv_nu(:) = 0.0d0
             nfluxgndv_nu(:) = 0.0d0
+            fmnetv_nu(:,:)=0.0
             do l=1,L_NLAYRAD
                fmnetv(l)=0.0d0
-               fmnetv_nu(l,:)=0.0d0
                fluxupv(l)=0.0d0
                fluxdnv(l)=0.0d0
Index: trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90	(revision 3612)
+++ trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90	(revision 3613)
@@ -14,5 +14,5 @@
       use radinc_h
       use radcommon_h
-      use ioipsl_getincom
+      use ioipsl_getin_p_mod, only: getin_p
       use suaer_corrk_mod, only: suaer_corrk
       use radii_mod, only: su_aer_radii,haze_reffrad_fix
@@ -68,5 +68,5 @@
       REAL zzlev(ngrid,nlayer)             ! Altitude at the layer boundaries.
       REAL pplev(ngrid,nlayer+1)           ! pres. level at GCM layer boundaries
- 
+
       REAL pt(ngrid,nlayer)               ! air temperature (K)
       REAL tsurf(ngrid)                     ! surface temperature (K)
@@ -223,5 +223,5 @@
 
          if (is_master) print*, "callcorrk: Correlated-k data folder:",trim(datadir)
-         call getin("corrkdir",corrkdir)
+         call getin_p("corrkdir",corrkdir)
          print*, "corrkdir = ",corrkdir
          write( tmp1, '(i3)' ) L_NSPECTI
@@ -248,5 +248,5 @@
                reffrad(:,:,1) = mp2m_rc_sph(:,:) * exp(5.*sig**2 / 2.)
             ELSEWHERE
-               reffrad(:,:,1) = 0d0         
+               reffrad(:,:,1) = 0d0
             ENDWHERE
             nueffrad(:,:,1) = exp(sig**2) - 1
@@ -259,5 +259,5 @@
             ENDWHERE
             nueffrad(:,:,2) = exp(sig**2) - 1
-           
+
            else
             do iaer=1,naerkind
Index: trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90	(revision 3612)
+++ trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90	(revision 3613)
@@ -145,6 +145,6 @@
   SAVE ccond
 
-  LOGICAL firstcall
-  SAVE firstcall
+  LOGICAL,SAVE :: firstcall=.true.
+!$OMP THREADPRIVATE(firstcall)
   REAL SSUM
   EXTERNAL SSUM
Index: trunk/LMDZ.PLUTO/libf/phypluto/diffusion.h
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/diffusion.h	(revision 3612)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!**********************************************************************
-
-!	diffusion.h
-
-!**********************************************************************
-
-      real*8 Pdiff
-      real*8 tdiffmin
-      real*8 dzres
-
-      parameter (Pdiff=1.)      ! pressure below which diffusion is computed
-      parameter (tdiffmin=5d0)
-      parameter (dzres=2d0)	 ! grid resolution (km) for diffusion
-
Index: trunk/LMDZ.PLUTO/libf/phypluto/diffusion_h.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/diffusion_h.F90	(revision 3612)
+++ trunk/LMDZ.PLUTO/libf/phypluto/diffusion_h.F90	(revision 3613)
@@ -4,11 +4,7 @@
        implicit none
 
-       real*8 Pdiff
-       real*8 tdiffmin
-       real*8 dzres
-!$OMP THREADPRIVATE(Pdiff,tdiffmin,dzres)
-       parameter (Pdiff=1.)      ! pressure below which diffusion is computed
-       parameter (tdiffmin=5d0)
-       parameter (dzres=2d0)	 ! grid resolution (km) for diffusion
+       real*8, parameter :: Pdiff = 1. ! pressure below which diffusion is computed
+       real*8, parameter :: tdiffmin = 5d0
+       real*8, parameter :: dzres = 2d0 ! grid resolution (km) for diffusion
 
        end module diffusion_h
Index: trunk/LMDZ.PLUTO/libf/phypluto/lymalpha.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/lymalpha.F90	(revision 3612)
+++ trunk/LMDZ.PLUTO/libf/phypluto/lymalpha.F90	(revision 3613)
@@ -2,4 +2,6 @@
       use datafile_mod
       use comcstfi_mod, only: pi
+      use mod_phys_lmdz_para, only : is_master, bcast
+
       implicit none
 
@@ -33,7 +35,6 @@
       REAL :: vectls
       REAL :: vectflux
-      LOGICAL firstcall
-      SAVE firstcall
-      DATA firstcall/.true./
+      LOGICAL,SAVE :: firstcall=.true.
+!$OMP THREADPRIVATE(firstcall)
 
       !!read lyman alpha flux
@@ -43,4 +44,6 @@
       character(len=100) :: file_path
       real,save :: lsdat(Nfine),fluxdat(Nfine)
+!$OMP THREADPRIVATE(lsdat,fluxdat)
+
 
 !---------------- INPUT ------------------------------------------------
@@ -49,14 +52,21 @@
         firstcall=.false.
         file_path=trim(datadir)//'/sol_uv_flux.txt'
-        print*,file_path
+        if (is_master) print*,file_path
         open(222,file=file_path,form='formatted')
+
+        if (is_master) then
         do ifine=1,Nfine
            read(222,*) lsdat(ifine), fluxdat(ifine)
         enddo
         close(222)
+        endif ! is_master
+
+        call bcast(lsdat)
+        call bcast(fluxdat)
       ENDIF
 
+
       CALL interp_line(lsdat,fluxdat,Nfine,pls*180./pi,pflux,1)
-      !write(*,*) 'flux=',pflux
+      !if (is_master) write(*,*) 'flux=',pflux
 
 
Index: trunk/LMDZ.PLUTO/libf/phypluto/phys_state_var_mod.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/phys_state_var_mod.F90	(revision 3612)
+++ trunk/LMDZ.PLUTO/libf/phypluto/phys_state_var_mod.F90	(revision 3613)
@@ -78,4 +78,5 @@
       real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW
       real,allocatable,dimension(:,:,:),save :: reffrad
+!$OMP THREADPRIVATE(nueffrad,reffrad)
 
       real,dimension(:,:),allocatable,save :: dEzdiff   ! Turbulent diffusion heating (W.m-2)
Index: trunk/LMDZ.PLUTO/libf/phypluto/suaer_corrk.F90
===================================================================
--- trunk/LMDZ.PLUTO/libf/phypluto/suaer_corrk.F90	(revision 3612)
+++ trunk/LMDZ.PLUTO/libf/phypluto/suaer_corrk.F90	(revision 3613)
@@ -136,5 +136,5 @@
                        TRIM(aersprop_file)
             write(*,*)'Suaer fractal aerosols optical properties, using: ', &
-                       TRIM(aerfprop_file) 
+                       TRIM(aerfprop_file)
          endif
          ! Visible
@@ -149,6 +149,6 @@
             lamrefir(iaer)  = 2.E-6    ! Reference wavelength for opacity IR (in the LEISA range)
          enddo ! end iaer=1,naerkind
-         
-      else 
+
+      else
          do iaer=1,naerkind
             if (iaer.eq.1) then
