Index: /LMDZ6/trunk/libf/dyn3d_common/infotrac.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3d_common/infotrac.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/dyn3d_common/infotrac.F90	(revision 3666)
@@ -422,5 +422,5 @@
     IF (type_trac == 'repr') THEN
 #ifdef REPROBUS
-       CALL Init_chem_rep_trac(nbtr)
+       CALL Init_chem_rep_trac(nbtr,nqo,tnom_0)
 #endif
     END IF
Index: /LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F	(revision 3665)
+++ /LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F	(revision 3666)
@@ -1543,4 +1543,9 @@
          endif
 #endif
+#ifdef REPROBUS
+         if (type_trac == 'repr') then
+         call finalize_reprobus
+         endif
+#endif
 
 c$OMP MASTER
@@ -1593,4 +1598,9 @@
               endif
 #endif
+#ifdef REPROBUS
+              if (type_trac == 'repr') then
+         call finalize_reprobus
+              endif
+#endif
 
 c$OMP MASTER
@@ -1742,4 +1752,9 @@
                  if (type_trac == 'inca') then 
                     call finalize_inca
+                 endif
+#endif
+#ifdef REPROBUS
+                 if (type_trac == 'repr') then
+         call finalize_reprobus
                  endif
 #endif
@@ -1834,4 +1849,9 @@
       endif
 #endif
+#ifdef REPROBUS
+      if (type_trac == 'repr') then
+         call finalize_reprobus
+      endif
+#endif
 
 c$OMP MASTER
Index: /LMDZ6/trunk/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 3666)
@@ -27,4 +27,9 @@
 #ifdef REPROBUS
   USE CHEM_REP, ONLY : Init_chem_rep_phys
+#ifdef CPP_PARA
+  USE parallel_lmdz, ONLY : mpi_size, mpi_rank
+  USE bands, ONLY : distrib_phys
+#endif
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
 #endif
   USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq, config_inca
@@ -46,7 +51,4 @@
   USE ioipsl_getin_p_mod, ONLY: getin_p
   USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom
-#ifdef REPROBUS
-  USE CHEM_REP, ONLY : Init_chem_rep_phys
-#endif
   IMPLICIT NONE
 
@@ -152,5 +154,8 @@
   IF (type_trac == 'repr') THEN
 #ifdef REPROBUS
-    CALL Init_chem_rep_phys(klon_omp,nlayer)
+    call Init_chem_rep_phys(klon_omp,nlayer)
+    call init_reprobus_para( &
+          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
+          distrib_phys,communicator)
 #endif
   ENDIF
@@ -168,4 +173,11 @@
 #endif
   END IF
+  IF (type_trac == 'repr') THEN
+#ifdef REPROBUS
+    call init_reprobus_para( &
+          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
+          distrib_phys,communicator)
+#endif
+  ENDIF
 
 !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
Index: /LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 3666)
@@ -1776,7 +1776,4 @@
   TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_trac(:)
   TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_trac_cum(:)
-#ifdef REPROBUS
-  TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_nas(:)
-#endif
   TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_dtr_vdf(:)
   TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_dtr_the(:)
Index: /LMDZ6/trunk/libf/phylmd/phys_output_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_mod.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_mod.F90	(revision 3666)
@@ -46,7 +46,4 @@
     USE vertical_layers_mod, ONLY: ap,bp,preff,presnivs, aps, bps, pseudoalt
     USE time_phylmdz_mod, ONLY: day_ini, itau_phy, start_time, annee_ref, day_ref
-#ifdef REPROBUS
-    USE chem_rep, ONLY: nbnas, tnamenas, ttextnas
-#endif
 #ifdef CPP_XIOS
     ! ug Pour les sorties XIOS
@@ -160,7 +157,4 @@
     IF (.NOT. ALLOCATED(o_trac)) ALLOCATE(o_trac(nqtot))
     IF (.NOT. ALLOCATED(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot))
-#ifdef REPROBUS
-    IF (.NOT. ALLOCATED(o_nas)) ALLOCATE(o_nas(nbnas))
-#endif
     ALLOCATE(o_dtr_the(nqtot),o_dtr_con(nqtot),o_dtr_lessi_impa(nqtot))
     ALLOCATE(o_dtr_lessi_nucl(nqtot),o_dtr_insc(nqtot),o_dtr_bcscav(nqtot))
@@ -581,13 +575,4 @@
             ENDDO
       ENDIF
-      IF (type_trac=='repr') THEN
-#ifdef REPROBUS
-         DO iiq=1,nbnas
-            o_nas(iiq) = ctrl_out((/ 4, 5, 5, 5, 10, 10, 11, 11, 11, 11 /), &
-                 tnamenas(iiq),ttextnas(iiq), "-", &
-                 (/ '', '', '', '', '', '', '', '', '', '' /))
-         ENDDO
-#endif
-      ENDIF
 
    ENDDO !  iff
Index: /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 3666)
@@ -172,7 +172,4 @@
          o_uxv, o_vxq, o_vxT, o_wxq, o_vxphi, &
          o_wxT, o_uxu, o_vxv, o_TxT, o_trac, &
-#ifdef REPROBUS
-         o_nas, &
-#endif
          o_dtr_vdf, o_dtr_the, o_dtr_con, &
          o_dtr_lessi_impa, o_dtr_lessi_nucl, &
@@ -331,8 +328,4 @@
          surf_PM25_sulf, tau_strat_550, tausum_strat, &
          vsed_aer, tau_strat_1020, f_r_wet
-#endif
-
-#ifdef REPROBUS
-    USE CHEM_REP, ONLY : nas, nbnas, tnamenas, ttextnas
 #endif
 
@@ -2267,5 +2260,5 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        IF (iflag_phytrac == 1 ) then
-         IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN
+         IF (type_trac == 'lmdz' .OR. type_trac == 'coag') THEN
            DO iq=nqo+1, nqtot
              !--3D fields
@@ -2292,7 +2285,5 @@
                 ENDDO
              ENDIF
-#ifndef REPROBUS
              CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
-#endif
            ENDDO !--iq
          ENDIF   !--type_trac
@@ -2322,12 +2313,4 @@
          ENDIF !--type_trac co2i
 
-         IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-           DO iq=1,nbnas
-             CALL histwrite_phy(o_nas(iq), nas(:,:,iq))
-           ENDDO
-#endif
-         ENDIF
-
        ENDIF   !(iflag_phytrac==1)
 
Index: /LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 3666)
@@ -246,5 +246,7 @@
 #endif
 #ifdef REPROBUS
-    USE CHEM_REP, ONLY : Init_chem_rep_xjour
+    USE CHEM_REP, ONLY : Init_chem_rep_xjour, &
+         d_q_rep,d_ql_rep,d_qi_rep,ptrop,ttrop, &
+         ztrop, gravit,itroprep, Z1,Z2,fac,B
 #endif
     USE indice_sol_mod
@@ -1950,4 +1952,18 @@
 #endif
        ENDIF
+       IF (type_trac == 'repr') THEN
+#ifdef REPROBUS
+          CALL chemini_rep(  &
+               presnivs, &
+               pdtphys, &
+               annee_ref, &
+               day_ref,  &
+               day_ini, &
+               start_time, &
+               itau_phy, &
+               io_lon, &
+               io_lat)
+#endif
+       ENDIF
 
        !$omp single
@@ -2286,4 +2302,20 @@
 
           wo(:,:,1)=ozonecm(latitude_deg, paprs,read_climoz,rjour=zzz)
+#ifdef REPROBUS
+          ptrop=dyn_tropopause(t_seri, ztsol, paprs, pplay, rot)/100.
+          DO i = 1, klon
+             Z1=t_seri(i,itroprep(i)+1)
+             Z2=t_seri(i,itroprep(i))
+             fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))
+             B=Z2-fac*alog(pplay(i,itroprep(i)))
+             ttrop(i)= fac*alog(ptrop(i))+B
+!        
+             Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit
+             Z2= 1.e-3 * ( pphi(i,itroprep(i))  +pphis(i) ) / gravit
+             fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))
+             B=Z2-fac*alog(pplay(i,itroprep(i)))
+             ztrop(i)=fac*alog(ptrop(i))+B
+          ENDDO
+#endif
        ELSE
           !--- ro3i = elapsed days number since current year 1st january, 0h
@@ -3754,5 +3786,10 @@
 #endif 
     ENDIF !type_trac = inca
-
+    IF (type_trac == 'repr') THEN
+#ifdef REPROBUS
+    !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap)
+    CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap) 
+#endif
+    ENDIF
 
     !
@@ -4719,5 +4756,12 @@
 
     IF (type_trac=='repr') THEN
+!MM pas d'impact, car on recupere q_seri,tr_seri,t_seri via phys_local_var_mod
+!MM                               dans Reprobus
        sh_in(:,:) = q_seri(:,:)
+#ifdef REPROBUS
+       d_q_rep(:,:) = 0.
+       d_ql_rep(:,:) = 0.
+       d_qi_rep(:,:) = 0.
+#endif
     ELSE
        sh_in(:,:) = qx(:,:,ivap)
@@ -4769,4 +4813,18 @@
          d_tr_dyn, &                                 !<<RomP
          tr_seri, init_source)
+#ifdef REPROBUS
+
+
+          print*,'avt add phys rep',abortphy
+
+     CALL add_phys_tend &
+            (du0,dv0,dt0,d_q_rep,d_ql_rep,d_qi_rep,paprs,&
+             'rep',abortphy,flag_inhib_tend,itap,0)
+        IF (abortphy==1) Print*,'ERROR ABORT REP'
+
+          print*,'apr add phys rep',abortphy
+
+#endif
+
 #endif
     ENDIF    ! (iflag_phytrac=1)
Index: /LMDZ6/trunk/libf/phylmd/radiation_AR4.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/radiation_AR4.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/radiation_AR4.F90	(revision 3666)
@@ -482,4 +482,5 @@
 #ifdef REPROBUS
   USE chem_rep, ONLY: rsuntime, ok_suntime
+  USE print_control_mod, ONLY: lunout
 #endif
 
Index: /LMDZ6/trunk/libf/phylmd/radlwsw_m.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/radlwsw_m.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/radlwsw_m.F90	(revision 3666)
@@ -453,6 +453,8 @@
   IF (type_trac == 'repr') THEN
 #ifdef REPROBUS
-     if(ok_SUNTIME) PSCT = solaireTIME/zdist/zdist
-     print*,'Constante solaire: ',PSCT*zdist*zdist
+    IF (iflag_rrtm==0) THEN
+      if(ok_SUNTIME) PSCT = solaireTIME/zdist/zdist
+      print*,'Constante solaire: ',PSCT*zdist*zdist
+    END IF
 #endif
   END IF
Index: /LMDZ6/trunk/libf/phylmd/rrtm/lwu.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/rrtm/lwu.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/rrtm/lwu.F90	(revision 3666)
@@ -74,4 +74,8 @@
 !USE YOERDI   , ONLY : RCH4     ,RN2O     ,RCFC11   ,RCFC12
 USE YOERDU   , ONLY : R10E     ,REPSCO   ,REPSCQ
+#ifdef REPROBUS
+USE chem_rep, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d
+USE infotrac_phy, ONLY : type_trac
+#endif
 
 
@@ -316,4 +320,25 @@
       PABCU(JL,17,IC)=PABCU(JL,17,ICP1)+ ZUAER(JL,4)    *ZDUC(JL,IC)*ZDIFF
       PABCU(JL,18,IC)=PABCU(JL,18,ICP1)+ ZUAER(JL,5)    *ZDUC(JL,IC)*ZDIFF
+#ifdef REPROBUS
+        IF (type_trac=='repr'.and. ok_rtime2d) THEN
+!- CH4
+      PABCU(JL,19,IC)=PABCU(JL,19,ICP1)&
+       & + ZABLY(JL,2,IC)*RCH42D(JL, IC)/PCCO2*ZPHM6(JL)*ZDIFF
+      PABCU(JL,20,IC)=PABCU(JL,20,ICP1)&
+       & + ZABLY(JL,3,IC)*RCH42D(JL, IC)/PCCO2*ZPSM6(JL)*ZDIFF
+!- N2O
+      PABCU(JL,21,IC)=PABCU(JL,21,ICP1)&
+       & + ZABLY(JL,2,IC)*RN2O2D(JL, IC)/PCCO2*ZPHN6(JL)*ZDIFF
+      PABCU(JL,22,IC)=PABCU(JL,22,ICP1)&
+       & + ZABLY(JL,3,IC)*RN2O2D(JL, IC)/PCCO2*ZPSN6(JL)*ZDIFF
+!- CFC11
+      PABCU(JL,23,IC)=PABCU(JL,23,ICP1)&
+       & + ZABLY(JL,2,IC)*RCFC112D(JL, IC)/PCCO2        *ZDIFF
+!- CFC12
+      PABCU(JL,24,IC)=PABCU(JL,24,ICP1)&
+       & + ZABLY(JL,2,IC)*RCFC122D(JL, IC)/PCCO2        *ZDIFF
+
+         ELSE
+#endif
 !- CH4
       PABCU(JL,19,IC)=PABCU(JL,19,ICP1)&
@@ -332,4 +357,7 @@
       PABCU(JL,24,IC)=PABCU(JL,24,ICP1)&
        & + ZABLY(JL,2,IC)*RCFC12/PCCO2        *ZDIFF  
+#ifdef REPROBUS
+        END IF
+#endif
     ENDDO
   ENDDO
Index: /LMDZ6/trunk/libf/phylmd/tracreprobus_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/tracreprobus_mod.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/tracreprobus_mod.F90	(revision 3666)
@@ -16,5 +16,6 @@
     USE CHEM_REP, ONLY : pdt_rep, &  ! pas de temps reprobus
          daynum, iter, &             ! jourjulien, iteration chimie
-         pdel
+         pdel,&
+         d_q_rep,d_ql_rep,d_qi_rep
 #endif
     IMPLICIT NONE
@@ -46,9 +47,11 @@
 ! Local variables
 !----------------
-    INTEGER :: it, k
+    INTEGER :: it, k, niter
 
 #ifdef REPROBUS
     !   -- CHIMIE REPROBUS --
-    pdt_rep=pdtphys/2.
+!    pdt_rep=pdtphys/2.
+    niter=pdtphys/pdt_rep
+    write(*,*)'nb d appel de REPROBUS',niter
     
     DO k = 1, klev
@@ -60,9 +63,13 @@
        tr_seri(:,:,11)=tr_seri(:,:,8)
     END IF
+
+    d_q_rep(:,:)  =0.
+    d_ql_rep(:,:) =0.
+    d_qi_rep(:,:) =0.
     
-    DO  iter = 1,2
+    DO  iter = 1,niter
        daynum = FLOAT(julien) + gmtime + (iter-1)*pdt_rep/86400.
        
-       DO it=1, nbtr
+!       DO it=1, nbtr
 !     WRITE(lunout,*)it,' ',minval(tr_seri(:,:,it)),maxval(tr_seri(:,:,it))
 ! seulement pour les especes chimiques (pas l'age de l'air)
@@ -70,13 +77,13 @@
 ! correction: a 1.e-30 quand =0 ou negatif et
 ! call abort si >ou= 1.e10
-          WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr
-          IF (it < nqtot) THEN
-             WRITE(*,*)'iciav',it,nqtot
-#ifdef REPROBUS
-             CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'avant chimie ')
-#endif
-             WRITE(*,*)iter,'avpres'
-          ENDIF
-       ENDDO
+!          WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr
+!          IF (it < nqtot) THEN
+!             WRITE(*,*)'iciav',it,nqtot
+!#ifdef REPROBUS
+!             CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'avant chimie ')
+!#endif
+!             WRITE(*,*)iter,'avpres'
+!          ENDIF
+!       ENDDO
        
 #ifdef REPROBUS
@@ -95,5 +102,5 @@
        !                 et transporte par CHEM_REP
 
-       DO it=1, nbtr
+!       DO it=1, nbtr
 !     WRITE(lunout,*)it,' ',minval(tr_seri(:,:,it)),maxval(tr_seri(:,:,it))
 ! seulement pour les especes chimiques (pas l'age de l'air)
@@ -101,11 +108,11 @@
 ! correction: a 1.e-30 quand =0 ou negatif et
 ! call abort si >ou= 1.e10
-          WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr
-          IF (it < nqtot) THEN
-             WRITE(*,*)'iciap',it,nqtot
-             CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'apres chemmain')
-             WRITE(*,*)iter,'appres'
-          ENDIF
-       ENDDO
+!          WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr
+!          IF (it < nqtot) THEN
+!             WRITE(*,*)'iciap',it,nqtot
+!             CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'apres chemmain')
+!             WRITE(*,*)iter,'appres'
+!          ENDIF
+!       ENDDO
 
 #endif        
Index: /LMDZ6/trunk/libf/phylmd/tropopause_m.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/tropopause_m.F90	(revision 3665)
+++ /LMDZ6/trunk/libf/phylmd/tropopause_m.F90	(revision 3666)
@@ -17,4 +17,7 @@
   USE geometry_mod, ONLY: latitude_deg, longitude_deg
   USE vertical_layers_mod, ONLY: aps, bps, preff
+#ifdef REPROBUS
+  USE chem_rep, ONLY: itroprep
+#endif
 
 !-------------------------------------------------------------------------------
@@ -108,4 +111,7 @@
       DO kt=1,klev-1; IF(pplay(i,kt+1)>dyn_tropopause(i)) EXIT; END DO; kp=kt
     END IF
+#ifdef REPROBUS
+    itroprep(i)=MAX(kt,kp)
+#endif
     !--- LAST TROPOSPHERIC LAYER INDEX NEEDED
     IF(PRESENT(itrop)) itrop(i)=MAX(kt,kp)
