Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxhyp_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxhyp_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxhyp_m.F90	(revision 5160)
@@ -41,5 +41,5 @@
     !----------------------------------------------------------------------
 
-    print *, "Call sequence information: fxhyp"
+    PRINT *, "Call sequence information: fxhyp"
 
     test_iim: if (iim==1) THEN
@@ -126,11 +126,11 @@
         END DO
 
-        print *, "ffdx = ", ffdx
+        PRINT *, "ffdx = ", ffdx
         beta = (grossismx * ffdx - pi_d) / (ffdx - pi_d)
-        print *, "beta = ", beta
+        PRINT *, "beta = ", beta
 
         IF (2. * beta - grossismx <= 0.) THEN
-          print *, 'Bad choice of grossismx, taux, dzoomx.'
-          print *, 'Decrease dzoomx or grossismx.'
+          PRINT *, 'Bad choice of grossismx, taux, dzoomx.'
+          PRINT *, 'Decrease dzoomx or grossismx.'
           STOP 1
         END IF
@@ -192,5 +192,5 @@
 
           IF (rlonm025(is2) < - pi) THEN
-            print *, 'Rlonm025 plus petit que - pi !'
+            PRINT *, 'Rlonm025 plus petit que - pi !'
             STOP 1
           end if
@@ -203,5 +203,5 @@
 
           IF (rlonm025(is2) > pi) THEN
-            print *, 'Rlonm025 plus grand que pi !'
+            PRINT *, 'Rlonm025 plus grand que pi !'
             STOP 1
           end if
@@ -215,7 +215,7 @@
 
       forall (i = 1:iim) d_rlonv(i) = rlonv(i + 1) - rlonv(i)
-      print *, "Minimum longitude step:", MINval(d_rlonv) * 180. / pi, &
+      PRINT *, "Minimum longitude step:", MINval(d_rlonv) * 180. / pi, &
               "degrees"
-      print *, "Maximum longitude step:", MAXval(d_rlonv) * 180. / pi, &
+      PRINT *, "Maximum longitude step:", MAXval(d_rlonv) * 180. / pi, &
               "degrees"
 
@@ -223,18 +223,18 @@
       DO i = 1, iim + 1
         IF (rlonp025(i) < rlonv(i)) THEN
-          print *, 'rlonp025(', i, ') = ', rlonp025(i)
-          print *, "< rlonv(", i, ") = ", rlonv(i)
+          PRINT *, 'rlonp025(', i, ') = ', rlonp025(i)
+          PRINT *, "< rlonv(", i, ") = ", rlonv(i)
           STOP 1
         END IF
 
         IF (rlonv(i) < rlonm025(i)) THEN
-          print *, 'rlonv(', i, ') = ', rlonv(i)
-          print *, "< rlonm025(", i, ") = ", rlonm025(i)
+          PRINT *, 'rlonv(', i, ') = ', rlonv(i)
+          PRINT *, "< rlonm025(", i, ") = ", rlonm025(i)
           STOP 1
         END IF
 
         IF (rlonp025(i) > rlonu(i)) THEN
-          print *, 'rlonp025(', i, ') = ', rlonp025(i)
-          print *, "> rlonu(", i, ") = ", rlonu(i)
+          PRINT *, 'rlonp025(', i, ') = ', rlonp025(i)
+          PRINT *, "> rlonu(", i, ") = ", rlonu(i)
           STOP 1
         END IF
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fyhyp_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fyhyp_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fyhyp_m.F90	(revision 5160)
@@ -59,5 +59,5 @@
     !-------------------------------------------------------------------
 
-    print *, "Call sequence information: fyhyp"
+    PRINT *, "Call sequence information: fyhyp"
 
     pi = 2.*asin(1.)
@@ -67,6 +67,6 @@
     y0 = clat*pi/180.
     dzoom = dzoomy*pi
-    print *, 'yzoom(rad), grossismy, tauy, dzoom (rad):'
-    print *, y0, grossismy, tauy, dzoom
+    PRINT *, 'yzoom(rad), grossismy, tauy, dzoom (rad):'
+    PRINT *, y0, grossismy, tauy, dzoom
 
     DO i = 0, nmax2
@@ -132,5 +132,5 @@
 
     IF (2. * beta - grossismy <= 0.) THEN
-       print *, 'Attention ! La valeur beta calculee dans la routine fyhyp ' &
+       PRINT *, 'Attention ! La valeur beta calculee dans la routine fyhyp ' &
             // 'est mauvaise. Modifier les valeurs de grossismy, tauy ou ' &
             // 'dzoomy et relancer.'
@@ -209,5 +209,5 @@
           END DO
           IF (abs(yi-yo1) > epsilon) THEN
-             print *, 'Pas de solution.', j, ylon2
+             PRINT *, 'Pas de solution.', j, ylon2
              STOP 1
           end if
@@ -220,5 +220,5 @@
        DO j = 1, jlat - 1
           IF (yvrai(j + 1)<yvrai(j)) THEN
-             print *, 'Problème avec rlat(', j + 1, ') plus petit que rlat(', &
+             PRINT *, 'Problème avec rlat(', j + 1, ') plus petit que rlat(', &
                   j, ')'
              STOP 1
@@ -226,5 +226,5 @@
        END DO
 
-       print *, 'Reorganisation des latitudes pour avoir entre - pi/2 et pi/2'
+       PRINT *, 'Reorganisation des latitudes pour avoir entre - pi/2 et pi/2'
 
        IF (ik==1) THEN
@@ -299,35 +299,35 @@
     DO j = 1, jjm
        IF (rlatu1(j) <= rlatu2(j)) THEN
-          print *, 'Attention ! rlatu1 < rlatu2 ', rlatu1(j), rlatu2(j), j
+          PRINT *, 'Attention ! rlatu1 < rlatu2 ', rlatu1(j), rlatu2(j), j
           STOP 13
        ENDIF
 
        IF (rlatu2(j) <= rlatu(j+1)) THEN
-          print *, 'Attention ! rlatu2 < rlatup1 ', rlatu2(j), rlatu(j+1), j
+          PRINT *, 'Attention ! rlatu2 < rlatup1 ', rlatu2(j), rlatu(j+1), j
           STOP 14
        ENDIF
 
        IF (rlatu(j) <= rlatu1(j)) THEN
-          print *, ' Attention ! rlatu < rlatu1 ', rlatu(j), rlatu1(j), j
+          PRINT *, ' Attention ! rlatu < rlatu1 ', rlatu(j), rlatu1(j), j
           STOP 15
        ENDIF
 
        IF (rlatv(j) <= rlatu2(j)) THEN
-          print *, ' Attention ! rlatv < rlatu2 ', rlatv(j), rlatu2(j), j
+          PRINT *, ' Attention ! rlatv < rlatu2 ', rlatv(j), rlatu2(j), j
           STOP 16
        ENDIF
 
        IF (rlatv(j) >= rlatu1(j)) THEN
-          print *, ' Attention ! rlatv > rlatu1 ', rlatv(j), rlatu1(j), j
+          PRINT *, ' Attention ! rlatv > rlatu1 ', rlatv(j), rlatu1(j), j
           STOP 17
        ENDIF
 
        IF (rlatv(j) >= rlatu(j)) THEN
-          print *, ' Attention ! rlatv > rlatu ', rlatv(j), rlatu(j), j
+          PRINT *, ' Attention ! rlatv > rlatu ', rlatv(j), rlatu(j), j
           STOP 18
        ENDIF
     ENDDO
 
-    print *, 'Latitudes'
+    PRINT *, 'Latitudes'
     print 3, champmin, champmax
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90	(revision 5160)
@@ -411,5 +411,5 @@
 
     IF (ABS(abs(xo(1)) - 90) < 0.001 .OR. ABS(abs(xo(nmax)) - 90) < 0.001) THEN
-      print *, "ord_coord"
+      PRINT *, "ord_coord"
       PRINT *, '"xi" should contain the latitudes of the boundaries of ' &
               // 'grid cells, not the centers of grid cells.'
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/invert_zoom_x_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/invert_zoom_x_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/invert_zoom_x_m.F90	(revision 5160)
@@ -67,6 +67,6 @@
        IF (ABS(xvrai(i) - xo1) > my_eps) THEN
           ! iter == 300
-          print *, 'Pas de solution.'
-          print *, i, xfi
+          PRINT *, 'Pas de solution.'
+          PRINT *, i, xfi
           STOP 1
        end if
@@ -77,5 +77,5 @@
     DO i = 1, iim -1
        IF (xvrai(i + 1) < xvrai(i)) THEN
-          print *, 'xvrai(', i + 1, ') < xvrai(', i, ')'
+          PRINT *, 'xvrai(', i + 1, ') < xvrai(', i, ')'
           STOP 1
        END IF
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.f90	(revision 5160)
@@ -905,5 +905,5 @@
         ( wk2(i,k  )*(c1*(A1 - A2)+A2*flux(i,k-1)) - &
         wk2(i,k-1)*A1*flux(i,k)  )
-   ! print *,'AL1',i,k, AL(i,k)
+   ! PRINT *,'AL1',i,k, AL(i,k)
   END DO
   END DO
@@ -911,10 +911,10 @@
   DO i=1,IMR*NLAYM1
   AR(i,1) = AL(i,2)
-   ! print *,'AR1',i,AR(i,1)
+   ! PRINT *,'AR1',i,AR(i,1)
   END DO
 
   DO i=1,IMR*NLAY
   A6(i,1) = 3.*(wk1(i,1)+wk1(i,1) - (AL(i,1)+AR(i,1)))
-   ! print *,'A61',i,A6(i,1)
+   ! PRINT *,'A61',i,A6(i,1)
   END DO
 
@@ -937,9 +937,9 @@
     flux(i,2) = AR(i,1)+0.5*CM*(AL(i,1)-AR(i,1)+A6(i,1)*(1.-R23*CM))
   else
-     ! print *,'test2-0',i,j,wz2(i,1),wk2(i,2)
+     ! PRINT *,'test2-0',i,j,wz2(i,1),wk2(i,2)
     CP= wz2(i,1) / wk2(i,2)
-     ! print *,'testCP',CP
+     ! PRINT *,'testCP',CP
     flux(i,2) = AL(i,2)+0.5*CP*(AL(i,2)-AR(i,2)-A6(i,2)*(1.+R23*CP))
-     ! print *,'test2',i, AL(i,2),AR(i,2),A6(i,2),R23
+     ! PRINT *,'test2',i, AL(i,2),AR(i,2),A6(i,2),R23
   ENDIF
   END DO
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90	(revision 5160)
@@ -67,5 +67,5 @@
   end DO
 
-  print *, 301
+  PRINT *, 301
 
 END SUBROUTINE  ugeostr
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90	(revision 5160)
@@ -481,5 +481,5 @@
         CLOSE(unit_number)   
       else 
-        print *,'probleme lors de l ecriture des bandes'
+        PRINT *,'probleme lors de l ecriture des bandes'
       endif
        
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/call_dissip_mod.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/call_dissip_mod.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/call_dissip_mod.f90	(revision 5160)
@@ -111,5 +111,5 @@
     !       PRINT*,'Entree dans la dissipation : Iteration No ',true_itau
     !   calcul de l'energie cinetique avant dissipation
-    !       print *,'Passage dans la dissipation'
+    !       PRINT *,'Passage dans la dissipation'
 
     CALL VTb(VThallo)
@@ -316,5 +316,5 @@
     CALL VTe(VThallo)
     CALL resume_timer(timer_caldyn)
-    !        print *,'fin dissipation'
+    !        PRINT *,'fin dissipation'
     !$OMP END MASTER
     !$OMP BARRIER
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90	(revision 5160)
@@ -490,8 +490,8 @@
 
       IF (prt_level > 9) THEN
-        print *, '*********************************'
-        print *, '******    TIMER CALDYN     ******'
+        PRINT *, '*********************************'
+        PRINT *, '******    TIMER CALDYN     ******'
         DO i = 0, mpi_size - 1
-          print *, 'proc', i, ' :   Nb Bandes  :', jj_nb_caldyn(i), &
+          PRINT *, 'proc', i, ' :   Nb Bandes  :', jj_nb_caldyn(i), &
                   '  : temps moyen :', &
                   timer_average(jj_nb_caldyn(i), timer_caldyn, i), &
@@ -499,8 +499,8 @@
         enddo
 
-        print *, '*********************************'
-        print *, '******    TIMER VANLEER    ******'
+        PRINT *, '*********************************'
+        PRINT *, '******    TIMER VANLEER    ******'
         DO i = 0, mpi_size - 1
-          print *, 'proc', i, ' :   Nb Bandes  :', jj_nb_vanleer(i), &
+          PRINT *, 'proc', i, ' :   Nb Bandes  :', jj_nb_vanleer(i), &
                   '  : temps moyen :', &
                   timer_average(jj_nb_vanleer(i), timer_vanleer, i), &
@@ -508,8 +508,8 @@
         enddo
 
-        print *, '*********************************'
-        print *, '******    TIMER DISSIP    ******'
+        PRINT *, '*********************************'
+        PRINT *, '******    TIMER DISSIP    ******'
         DO i = 0, mpi_size - 1
-          print *, 'proc', i, ' :   Nb Bandes  :', jj_nb_dissip(i), &
+          PRINT *, 'proc', i, ' :   Nb Bandes  :', jj_nb_dissip(i), &
                   '  : temps moyen :', &
                   timer_average(jj_nb_dissip(i), timer_dissip, i), &
@@ -900,32 +900,32 @@
     CALL barrier
     IF (mpi_rank==0) THEN
-      print *, '*********************************'
-      print *, '******    TIMER CALDYN     ******'
+      PRINT *, '*********************************'
+      PRINT *, '******    TIMER CALDYN     ******'
       DO i = 0, mpi_size - 1
-        print *, 'proc', i, ' :   Nb Bandes  :', jj_nb_caldyn(i), &
+        PRINT *, 'proc', i, ' :   Nb Bandes  :', jj_nb_caldyn(i), &
                 '  : temps moyen :', &
                 timer_average(jj_nb_caldyn(i), timer_caldyn, i)
       enddo
 
-      print *, '*********************************'
-      print *, '******    TIMER VANLEER    ******'
+      PRINT *, '*********************************'
+      PRINT *, '******    TIMER VANLEER    ******'
       DO i = 0, mpi_size - 1
-        print *, 'proc', i, ' :   Nb Bandes  :', jj_nb_vanleer(i), &
+        PRINT *, 'proc', i, ' :   Nb Bandes  :', jj_nb_vanleer(i), &
                 '  : temps moyen :', &
                 timer_average(jj_nb_vanleer(i), timer_vanleer, i)
       enddo
 
-      print *, '*********************************'
-      print *, '******    TIMER DISSIP    ******'
+      PRINT *, '*********************************'
+      PRINT *, '******    TIMER DISSIP    ******'
       DO i = 0, mpi_size - 1
-        print *, 'proc', i, ' :   Nb Bandes  :', jj_nb_dissip(i), &
+        PRINT *, 'proc', i, ' :   Nb Bandes  :', jj_nb_dissip(i), &
                 '  : temps moyen :', &
                 timer_average(jj_nb_dissip(i), timer_dissip, i)
       enddo
 
-      print *, '*********************************'
-      print *, '******    TIMER PHYSIC    ******'
+      PRINT *, '*********************************'
+      PRINT *, '******    TIMER PHYSIC    ******'
       DO i = 0, mpi_size - 1
-        print *, 'proc', i, ' :   Nb Bandes  :', jj_nb_physic(i), &
+        PRINT *, 'proc', i, ' :   Nb Bandes  :', jj_nb_physic(i), &
                 '  : temps moyen :', &
                 timer_average(jj_nb_physic(i), timer_physic, i)
@@ -934,8 +934,8 @@
     endif
     CALL barrier
-    print *, 'Taille du Buffer MPI (REAL*8)', MaxBufferSize
-    print *, 'Taille du Buffer MPI utilise (REAL*8)', MaxBufferSize_Used
-    print *, 'Temps total ecoule sur la parallelisation :', DiffTime()
-    print *, 'Temps CPU ecoule sur la parallelisation :', DiffCpuTime()
+    PRINT *, 'Taille du Buffer MPI (REAL*8)', MaxBufferSize
+    PRINT *, 'Taille du Buffer MPI utilise (REAL*8)', MaxBufferSize_Used
+    PRINT *, 'Temps total ecoule sur la parallelisation :', DiffTime()
+    PRINT *, 'Temps CPU ecoule sur la parallelisation :', DiffCpuTime()
     CALL print_filtre_timer
     !$OMP END MASTER
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_hallo.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_hallo.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_hallo.F90	(revision 5160)
@@ -146,10 +146,10 @@
     IF (Buffer_pos(Index_pos) + Size>MaxBufferSize_Used) MaxBufferSize_Used = Buffer_pos(Index_pos) + Size
     IF (Buffer_pos(Index_pos) + Size>MaxBufferSize) THEN
-      print *, 'STOP :: La taille de MaxBufferSize dans mod_hallo.F90 est trop petite !!!!'
+      PRINT *, 'STOP :: La taille de MaxBufferSize dans mod_hallo.F90 est trop petite !!!!'
       CALL abort_gcm("mod_hallo", "stopped", 1)
     endif
 
     IF (Index_pos>=ListSize) THEN
-      print *, 'STOP :: La taille de ListSize dans mod_hallo.F90 est trop petite !!!!'
+      PRINT *, 'STOP :: La taille de ListSize dans mod_hallo.F90 est trop petite !!!!'
       CALL abort_gcm("mod_hallo", "stopped", 1)
     endif
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F90	(revision 5160)
@@ -435,6 +435,6 @@
     DO l = 1, llm
       DO ij = ijb, ije
-        ! print *,'zq-->',ij,l,iq,zq(ij,l,iq)
-        ! print *,'q-->',ij,l,iq,q(ij,l,iq)
+        ! PRINT *,'zq-->',ij,l,iq,zq(ij,l,iq)
+        ! PRINT *,'q-->',ij,l,iq,q(ij,l,iq)
         q(ij, l, iq) = zq(ij, l, iq)
       ENDDO
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90	(revision 5160)
@@ -302,5 +302,5 @@
    unskap   = 1./ kappa
 
-  !  print *,omp_rank,'klon--->',klon
+  !  PRINT *,omp_rank,'klon--->',klon
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
   DO l = 1, llmp1
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/test_disvert_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/test_disvert_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/test_disvert_m.F90	(revision 5160)
@@ -34,5 +34,5 @@
     !---------------------
 
-    print *, "Call sequence information: test_disvert"
+    PRINT *, "Call sequence information: test_disvert"
 
     delta_ps = 6e4 / (ngrid - 1)
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_wrapper.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_wrapper.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_fft_wrapper.f90	(revision 5160)
@@ -13,5 +13,5 @@
     INTEGER :: nb
     
-    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
+    PRINT *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
     stop 1
   END SUBROUTINE init_fft
@@ -24,5 +24,5 @@
     COMPLEX,INTENT(INOUT) :: TF_vect(vsize/2+1,nb_vect)
     
-    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
+    PRINT *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
     stop 1
     
@@ -35,5 +35,5 @@
     COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)
   
-    print *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
+    PRINT *, "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique"
     stop 1
     
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90	(revision 5160)
@@ -16,5 +16,5 @@
       write (*, *) 'nrerror: an assertion failed with this tag:', &
               string
-      print *, 'program terminated by assert1'
+      PRINT *, 'program terminated by assert1'
       stop 1
     end if
@@ -27,5 +27,5 @@
       write (*, *) 'nrerror: an assertion failed with this tag:', &
               string
-      print *, 'program terminated by assert2'
+      PRINT *, 'program terminated by assert2'
       stop 1
     end if
@@ -38,5 +38,5 @@
       write (*, *) 'nrerror: an assertion failed with this tag:', &
               string
-      print *, 'program terminated by assert3'
+      PRINT *, 'program terminated by assert3'
       stop 1
     end if
@@ -49,5 +49,5 @@
       write (*, *) 'nrerror: an assertion failed with this tag:', &
               string
-      print *, 'program terminated by assert4'
+      PRINT *, 'program terminated by assert4'
       stop 1
     end if
@@ -60,5 +60,5 @@
       write (*, *) 'nrerror: an assertion failed with this tag:', &
               string
-      print *, 'program terminated by assert_v'
+      PRINT *, 'program terminated by assert_v'
       stop 1
     end if
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath_pch.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath_pch.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath_pch.f90	(revision 5160)
@@ -639,9 +639,9 @@
     n = assert_eq(size(x), size(f), "pchsp_95 n")
     IF ((ibeg == 1 .OR. ibeg == 2) .AND. .NOT. present(vc_beg)) THEN
-      print *, "vc_beg required for IBEG = 1 or 2"
+      PRINT *, "vc_beg required for IBEG = 1 or 2"
       stop 1
     end if
     IF ((iend == 1 .OR. iend == 2) .AND. .NOT. present(vc_end)) THEN
-      print *, "vc_end required for IEND = 1 or 2"
+      PRINT *, "vc_end required for IEND = 1 or 2"
       stop 1
     end if
Index: LMDZ6/branches/Amaury_dev/libf/obsolete/calcul_REGDYN.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/obsolete/calcul_REGDYN.h	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/obsolete/calcul_REGDYN.h	(revision 5160)
@@ -0,0 +1,22 @@
+
+! $Header$
+
+! calculs statistiques distribution nuage ftion du regime dynamique
+
+! Ce calcul doit etre fait a partir de valeurs mensuelles ??
+      CALL histo_o500_pctau(nbregdyn,pct_ocean,o500,fq_isccp, &
+     histoW,nhistoW)
+
+! nhistoWt = somme de toutes les nhistoW
+      DO nreg=1, nbregdyn
+       DO k = 1, kmaxm1
+        DO l = 1, lmaxm1
+         DO iw = 1, iwmax
+          nhistoWt(k,l,iw,nreg)=nhistoWt(k,l,iw,nreg)+&
+         nhistoW(k,l,iw,nreg)
+         ENDDO
+        ENDDO
+       ENDDO
+      ENDDO
+
+!IM 190504 END
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_constants.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_constants.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_constants.f90	(revision 5160)
@@ -0,0 +1,9 @@
+! Amaury 08/24: I created this module to declare some constants that were previously duplicated in several places
+! Feel free to move this to another better-suited module.
+MODULE lmdz_phys_constants
+  IMPLICIT NONE; PRIVATE
+  PUBLIC dobson_u
+
+  REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
+END MODULE lmdz_phys_constants
+    
Index: LMDZ6/branches/Amaury_dev/libf/phydev/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/physiq_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/physiq_mod.F90	(revision 5160)
@@ -2,198 +2,197 @@
 MODULE physiq_mod
 
-IMPLICIT NONE
+  IMPLICIT NONE
 
 CONTAINS
 
-      SUBROUTINE physiq(nlon,nlev, &
-              debut,lafin,pdtphys, &
-              paprs,pplay,pphi,pphis,presnivs, &
-              u,v,t,qx, &
-              flxmass_w, &
-              d_u, d_v, d_t, d_qx, d_ps)
+  SUBROUTINE physiq(nlon, nlev, &
+          debut, lafin, pdtphys, &
+          paprs, pplay, pphi, pphis, presnivs, &
+          u, v, t, qx, &
+          flxmass_w, &
+          d_u, d_v, d_t, d_qx, d_ps)
 
-      USE dimphy, ONLY: klon,klev
-      USE infotrac_phy, ONLY: nqtot
-      USE lmdz_geometry, ONLY: latitude
-      USE comcstphy, ONLY: rg
-      USE iophy, ONLY: histbeg_phy,histwrite_phy
-      USE ioipsl, ONLY: getin,histvert,histdef,histend,ymds2ju
-      USE lmdz_phys_para, ONLY: jj_nb
-      USE phys_state_var_mod, ONLY: phys_state_var_init
-      USE lmdz_grid_phy, ONLY: nbp_lon,nbp_lat
+    USE dimphy, ONLY: klon, klev
+    USE infotrac_phy, ONLY: nqtot
+    USE lmdz_geometry, ONLY: latitude
+    USE comcstphy, ONLY: rg
+    USE iophy, ONLY: histbeg_phy, histwrite_phy
+    USE ioipsl, ONLY: getin, histvert, histdef, histend, ymds2ju
+    USE lmdz_phys_para, ONLY: jj_nb
+    USE phys_state_var_mod, ONLY: phys_state_var_init
+    USE lmdz_grid_phy, ONLY: nbp_lon, nbp_lat
 
-      USE lmdz_xios, ONLY: xios_update_calendar, using_xios
-      USE lmdz_wxios, ONLY: wxios_add_vaxis, wxios_set_cal, wxios_closedef
-      USE iophy, ONLY: histwrite_phy
+    USE lmdz_xios, ONLY: xios_update_calendar, using_xios
+    USE lmdz_wxios, ONLY: wxios_add_vaxis, wxios_set_cal, wxios_closedef
+    USE iophy, ONLY: histwrite_phy
 
-      IMPLICIT NONE
+    IMPLICIT NONE
 
-! Routine argument:
+    ! Routine argument:
 
-      INTEGER,INTENT(IN) :: nlon ! number of atmospheric colums
-      INTEGER,INTENT(IN) :: nlev ! number of vertical levels (should be =klev)
-      logical,INTENT(IN) :: debut ! signals first CALL to physics
-      logical,INTENT(IN) :: lafin ! signals last CALL to physics
-      REAL,INTENT(IN) :: pdtphys ! physics time step (s)
-      REAL,INTENT(IN) :: paprs(klon,klev+1) ! interlayer pressure (Pa)
-      REAL,INTENT(IN) :: pplay(klon,klev) ! mid-layer pressure (Pa)
-      REAL,INTENT(IN) :: pphi(klon,klev) ! geopotential at mid-layer
-      REAL,INTENT(IN) :: pphis(klon) ! surface geopotential
-      REAL,INTENT(IN) :: presnivs(klev) ! pseudo-pressure (Pa) of mid-layers
-      REAL,INTENT(IN) :: u(klon,klev) ! eastward zonal wind (m/s)
-      REAL,INTENT(IN) :: v(klon,klev) ! northward meridional wind (m/s)
-      REAL,INTENT(IN) :: t(klon,klev) ! temperature (K)
-      REAL,INTENT(IN) :: qx(klon,klev,nqtot) ! tracers (.../kg_air)
-      REAL,INTENT(IN) :: flxmass_w(klon,klev) ! vertical mass flux
-      REAL,INTENT(OUT) :: d_u(klon,klev) ! physics tendency on u (m/s/s)
-      REAL,INTENT(OUT) :: d_v(klon,klev) ! physics tendency on v (m/s/s)
-      REAL,INTENT(OUT) :: d_t(klon,klev) ! physics tendency on t (K/s)
-      REAL,INTENT(OUT) :: d_qx(klon,klev,nqtot) ! physics tendency on tracers
-      REAL,INTENT(OUT) :: d_ps(klon) ! physics tendency on surface pressure
+    INTEGER, INTENT(IN) :: nlon ! number of atmospheric colums
+    INTEGER, INTENT(IN) :: nlev ! number of vertical levels (should be =klev)
+    LOGICAL, INTENT(IN) :: debut ! signals first CALL to physics
+    LOGICAL, INTENT(IN) :: lafin ! signals last CALL to physics
+    REAL, INTENT(IN) :: pdtphys ! physics time step (s)
+    REAL, INTENT(IN) :: paprs(klon, klev + 1) ! interlayer pressure (Pa)
+    REAL, INTENT(IN) :: pplay(klon, klev) ! mid-layer pressure (Pa)
+    REAL, INTENT(IN) :: pphi(klon, klev) ! geopotential at mid-layer
+    REAL, INTENT(IN) :: pphis(klon) ! surface geopotential
+    REAL, INTENT(IN) :: presnivs(klev) ! pseudo-pressure (Pa) of mid-layers
+    REAL, INTENT(IN) :: u(klon, klev) ! eastward zonal wind (m/s)
+    REAL, INTENT(IN) :: v(klon, klev) ! northward meridional wind (m/s)
+    REAL, INTENT(IN) :: t(klon, klev) ! temperature (K)
+    REAL, INTENT(IN) :: qx(klon, klev, nqtot) ! tracers (.../kg_air)
+    REAL, INTENT(IN) :: flxmass_w(klon, klev) ! vertical mass flux
+    REAL, INTENT(OUT) :: d_u(klon, klev) ! physics tendency on u (m/s/s)
+    REAL, INTENT(OUT) :: d_v(klon, klev) ! physics tendency on v (m/s/s)
+    REAL, INTENT(OUT) :: d_t(klon, klev) ! physics tendency on t (K/s)
+    REAL, INTENT(OUT) :: d_qx(klon, klev, nqtot) ! physics tendency on tracers
+    REAL, INTENT(OUT) :: d_ps(klon) ! physics tendency on surface pressure
 
-INTEGER,save :: itau=0 ! counter to count number of calls to physics
-!$OMP THREADPRIVATE(itau)
-REAL :: temp_newton(klon,klev)
-INTEGER :: k
-logical, save :: first=.TRUE.
-!$OMP THREADPRIVATE(first)
+    INTEGER, save :: itau = 0 ! counter to count number of calls to physics
+    !$OMP THREADPRIVATE(itau)
+    REAL :: temp_newton(klon, klev)
+    INTEGER :: k
+    logical, save :: first = .TRUE.
+    !$OMP THREADPRIVATE(first)
 
-! For I/Os
-INTEGER :: itau0
-REAL :: zjulian
-REAL :: dtime
-INTEGER :: nhori ! horizontal coordinate ID
-INTEGER,save :: nid_hist ! output file ID
-!$OMP THREADPRIVATE(nid_hist)
-INTEGER :: zvertid ! vertical coordinate ID
-INTEGER,save :: iwrite_phys ! output every iwrite_phys physics step
-!$OMP THREADPRIVATE(iwrite_phys)
-INTEGER,save :: iwrite_phys_omp ! intermediate variable to read iwrite_phys
-                                ! (must be shared by all threads)
-REAL :: t_ops ! frequency of the IOIPSL operations (eg average over...)
-REAL :: t_wrt ! frequency of the IOIPSL outputs
+    ! For I/Os
+    INTEGER :: itau0
+    REAL :: zjulian
+    REAL :: dtime
+    INTEGER :: nhori ! horizontal coordinate ID
+    INTEGER, save :: nid_hist ! output file ID
+    !$OMP THREADPRIVATE(nid_hist)
+    INTEGER :: zvertid ! vertical coordinate ID
+    INTEGER, save :: iwrite_phys ! output every iwrite_phys physics step
+    !$OMP THREADPRIVATE(iwrite_phys)
+    INTEGER, save :: iwrite_phys_omp ! intermediate variable to read iwrite_phys
+    ! (must be shared by all threads)
+    REAL :: t_ops ! frequency of the IOIPSL operations (eg average over...)
+    REAL :: t_wrt ! frequency of the IOIPSL outputs
 
-! initializations
-IF (debut) then ! Things to do only for the first CALL to physics
-! load initial conditions for physics (including the grid)
-  CALL phys_state_var_init() ! some initializations, required before calling phyetat0
-  CALL phyetat0("startphy.nc")
+    ! initializations
+    IF (debut) then ! Things to do only for the first CALL to physics
+      ! load initial conditions for physics (including the grid)
+      CALL phys_state_var_init() ! some initializations, required before calling phyetat0
+      CALL phyetat0("startphy.nc")
 
-! Initialize outputs:
-  itau0=0
-!$OMP MASTER
-  iwrite_phys_omp=1 !default: output every physics timestep
-  ! NB: getin() is not threadsafe; only one thread should CALL it.
-  CALL getin("iwrite_phys",iwrite_phys_omp)
-!$OMP END MASTER
-!$OMP BARRIER
-  iwrite_phys=iwrite_phys_omp
-  t_ops=pdtphys*iwrite_phys ! frequency of the IOIPSL operation
-  t_wrt=pdtphys*iwrite_phys ! frequency of the outputs in the file
-  ! compute zjulian for annee0=1979 and month=1 dayref=1 and hour=0.0
-  !CALL ymds2ju(annee0, month, dayref, hour, zjulian)
-  CALL ymds2ju(1979, 1, 1, 0.0, zjulian)
-  dtime=pdtphys
+      ! Initialize outputs:
+      itau0 = 0
+      !$OMP MASTER
+      iwrite_phys_omp = 1 !default: output every physics timestep
+      ! NB: getin() is not threadsafe; only one thread should CALL it.
+      CALL getin("iwrite_phys", iwrite_phys_omp)
+      !$OMP END MASTER
+      !$OMP BARRIER
+      iwrite_phys = iwrite_phys_omp
+      t_ops = pdtphys * iwrite_phys ! frequency of the IOIPSL operation
+      t_wrt = pdtphys * iwrite_phys ! frequency of the outputs in the file
+      ! compute zjulian for annee0=1979 and month=1 dayref=1 and hour=0.0
+      !CALL ymds2ju(annee0, month, dayref, hour, zjulian)
+      CALL ymds2ju(1979, 1, 1, 0.0, zjulian)
+      dtime = pdtphys
 #ifndef CPP_IOIPSL_NO_OUTPUT
-  ! Initialize IOIPSL output file
-  CALL histbeg_phy("histins.nc",itau0,zjulian,dtime,nhori,nid_hist)
+      ! Initialize IOIPSL output file
+      CALL histbeg_phy("histins.nc", itau0, zjulian, dtime, nhori, nid_hist)
 #endif
 
-!$OMP MASTER
+      !$OMP MASTER
 
 #ifndef CPP_IOIPSL_NO_OUTPUT 
-! IOIPSL
-  ! define vertical coordinate
-  CALL histvert(nid_hist,"presnivs","Vertical levels","Pa",klev, &
-                presnivs,zvertid,'down')
-  ! define variables which will be written in "histins.nc" file
-  CALL histdef(nid_hist,'temperature','Atmospheric temperature','K', &
-               nbp_lon,jj_nb,nhori,klev,1,klev,zvertid,32, &
-               'inst(X)',t_ops,t_wrt)
-  CALL histdef(nid_hist,'u','Eastward Zonal Wind','m/s', &
-               nbp_lon,jj_nb,nhori,klev,1,klev,zvertid,32, &
-               'inst(X)',t_ops,t_wrt)
-  CALL histdef(nid_hist,'v','Northward Meridional Wind','m/s', &
-               nbp_lon,jj_nb,nhori,klev,1,klev,zvertid,32, &
-               'inst(X)',t_ops,t_wrt)
-  CALL histdef(nid_hist,'ps','Surface Pressure','Pa', &
-               nbp_lon,jj_nb,nhori,1,1,1,zvertid,32, &
-               'inst(X)',t_ops,t_wrt)
-  ! end definition sequence
-  CALL histend(nid_hist)
+      ! IOIPSL
+      ! define vertical coordinate
+      CALL histvert(nid_hist, "presnivs", "Vertical levels", "Pa", klev, &
+              presnivs, zvertid, 'down')
+      ! define variables which will be written in "histins.nc" file
+      CALL histdef(nid_hist, 'temperature', 'Atmospheric temperature', 'K', &
+              nbp_lon, jj_nb, nhori, klev, 1, klev, zvertid, 32, &
+              'inst(X)', t_ops, t_wrt)
+      CALL histdef(nid_hist, 'u', 'Eastward Zonal Wind', 'm/s', &
+              nbp_lon, jj_nb, nhori, klev, 1, klev, zvertid, 32, &
+              'inst(X)', t_ops, t_wrt)
+      CALL histdef(nid_hist, 'v', 'Northward Meridional Wind', 'm/s', &
+              nbp_lon, jj_nb, nhori, klev, 1, klev, zvertid, 32, &
+              'inst(X)', t_ops, t_wrt)
+      CALL histdef(nid_hist, 'ps', 'Surface Pressure', 'Pa', &
+              nbp_lon, jj_nb, nhori, 1, 1, 1, zvertid, 32, &
+              'inst(X)', t_ops, t_wrt)
+      ! end definition sequence
+      CALL histend(nid_hist)
 #endif
 
-    IF (using_xios) THEN
-!XIOS
-      ! Declare available vertical axes to be used in output files:    
-      CALL wxios_add_vaxis("presnivs", klev, presnivs)
+      IF (using_xios) THEN
+        !XIOS
+        ! Declare available vertical axes to be used in output files:
+        CALL wxios_add_vaxis("presnivs", klev, presnivs)
 
-      ! Declare calendar and time step
-      CALL wxios_set_cal(dtime,"earth_360d",1,1,1,0.0,1,1,1,0.0)
-    
-      !Finalize the context:
-      CALL wxios_closedef()
-    ENDIF
-!$OMP END MASTER
-!$OMP BARRIER
-END IF ! of if (debut)
+        ! Declare calendar and time step
+        CALL wxios_set_cal(dtime, "earth_360d", 1, 1, 1, 0.0, 1, 1, 1, 0.0)
 
-! increment local time counter itau
-itau=itau+1
+        !Finalize the context:
+        CALL wxios_closedef()
+      ENDIF
+      !$OMP END MASTER
+      !$OMP BARRIER
+    END IF ! of if (debut)
 
-! set all tendencies to zero
-d_u(1:klon,1:klev)=0.
-d_v(1:klon,1:klev)=0.
-d_t(1:klon,1:klev)=0.
-d_qx(1:klon,1:klev,1:nqtot)=0.
-d_ps(1:klon)=0.
+    ! increment local time counter itau
+    itau = itau + 1
 
-! compute tendencies to return to the dynamics:
-! "friction" on the first layer
-d_u(1:klon,1)=-u(1:klon,1)/86400.
-d_v(1:klon,1)=-v(1:klon,1)/86400.
-! newtonian relaxation towards temp_newton()
-DO k=1,klev
-  temp_newton(1:klon,k)=280.+cos(latitude(1:klon))*40.-pphi(1:klon,k)/rg*6.e-3
-  d_t(1:klon,k)=(temp_newton(1:klon,k)-t(1:klon,k))/1.e5
-END DO
+    ! set all tendencies to zero
+    d_u(1:klon, 1:klev) = 0.
+    d_v(1:klon, 1:klev) = 0.
+    d_t(1:klon, 1:klev) = 0.
+    d_qx(1:klon, 1:klev, 1:nqtot) = 0.
+    d_ps(1:klon) = 0.
 
+    ! compute tendencies to return to the dynamics:
+    ! "friction" on the first layer
+    d_u(1:klon, 1) = -u(1:klon, 1) / 86400.
+    d_v(1:klon, 1) = -v(1:klon, 1) / 86400.
+    ! newtonian relaxation towards temp_newton()
+    DO k = 1, klev
+      temp_newton(1:klon, k) = 280. + cos(latitude(1:klon)) * 40. - pphi(1:klon, k) / rg * 6.e-3
+      d_t(1:klon, k) = (temp_newton(1:klon, k) - t(1:klon, k)) / 1.e5
+    END DO
 
-PRINT*,'PHYDEV: itau=',itau
+    PRINT*, 'PHYDEV: itau=', itau
 
-! write some outputs:
-! IOIPSL
+    ! write some outputs:
+    ! IOIPSL
 #ifndef CPP_IOIPSL_NO_OUTPUT 
-IF (modulo(itau,iwrite_phys)==0) THEN
-  CALL histwrite_phy(nid_hist,.FALSE.,"temperature",itau,t)
-  CALL histwrite_phy(nid_hist,.FALSE.,"u",itau,u)
-  CALL histwrite_phy(nid_hist,.FALSE.,"v",itau,v)
-  CALL histwrite_phy(nid_hist,.FALSE.,"ps",itau,paprs(:,1))
-END IF
+    IF (modulo(itau, iwrite_phys)==0) THEN
+      CALL histwrite_phy(nid_hist, .FALSE., "temperature", itau, t)
+      CALL histwrite_phy(nid_hist, .FALSE., "u", itau, u)
+      CALL histwrite_phy(nid_hist, .FALSE., "v", itau, v)
+      CALL histwrite_phy(nid_hist, .FALSE., "ps", itau, paprs(:, 1))
+    END IF
 #endif
 
-!XIOS
-IF (using_xios) THEN
-  !$OMP MASTER
-    !Increment XIOS time
-    CALL xios_update_calendar(itau)
-  !$OMP END MASTER
-  !$OMP BARRIER
+    !XIOS
+    IF (using_xios) THEN
+      !$OMP MASTER
+      !Increment XIOS time
+      CALL xios_update_calendar(itau)
+      !$OMP END MASTER
+      !$OMP BARRIER
 
-    !Send fields to XIOS: (NB these fields must also be defined as
-    ! <field id="..." /> in iodef.xml to be correctly used
-    CALL histwrite_phy("temperature",t)
-    CALL histwrite_phy("temp_newton",temp_newton)
-    CALL histwrite_phy("u",u)
-    CALL histwrite_phy("v",v)
-    CALL histwrite_phy("ps",paprs(:,1))
-ENDIF
+      !Send fields to XIOS: (NB these fields must also be defined as
+      ! <field id="..." /> in iodef.xml to be correctly used
+      CALL histwrite_phy("temperature", t)
+      CALL histwrite_phy("temp_newton", temp_newton)
+      CALL histwrite_phy("u", u)
+      CALL histwrite_phy("v", v)
+      CALL histwrite_phy("ps", paprs(:, 1))
+    ENDIF
 
-! if lastcall, then it is time to write "restartphy.nc" file
-IF (lafin) THEN
-  CALL phyredem("restartphy.nc")
-END IF
+    ! if lastcall, then it is time to write "restartphy.nc" file
+    IF (lafin) THEN
+      CALL phyredem("restartphy.nc")
+    END IF
 
-END SUBROUTINE  physiq
+  END SUBROUTINE  physiq
 
 END MODULE physiq_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/aeropt_spl.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/aeropt_spl.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/aeropt_spl.f90	(revision 5160)
@@ -11,10 +11,9 @@
   USE infotrac
   USE lmdz_yomcst
-
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+
   IMPLICIT NONE
-
-  INCLUDE "chem.h"
-
 
   ! Arguments:
@@ -134,5 +133,5 @@
       ! IF (rh.gt.40.) THEN
       !     RH_num=5   ! Added by NHL temporarily
-      !     print *,'TEMPORARY CASE'
+      !     PRINT *,'TEMPORARY CASE'
       ! ENDIF
       DELTA = (rh - RH_tab(RH_num)) / (RH_tab(RH_num + 1) - RH_tab(RH_num))
@@ -174,5 +173,5 @@
               ss_dustsco(1) * tr_seri(i, k, id_scdu) * &
                       zdz(i, k) * 1.e6
-      ! print *,'taue550_ss = ',SUM(taue550_ss),MINVAL(taue550_ss),
+      ! PRINT *,'taue550_ss = ',SUM(taue550_ss),MINVAL(taue550_ss),
       ! .                                          MAXVAL(taue550_ss)
 
@@ -237,13 +236,11 @@
                       zdz(i, k) * 1.e6
 
-
-
       IF(id_coss>0)  burden_ss(i) = burden_ss(i) &
               + tr_seri(i, k, id_coss) * 1.e6 * 1.e3 * zdz(i, k)
     ENDDO            !-loop on klev
   ENDDO            !-loop on klon
-  ! print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
+  ! PRINT *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
   ! .                                          MAXVAL(tr_seri(:,:,3))
-  !  print *,'taue550_ss = ',SUM(taue550_ss),MINVAL(taue550_ss),
+  !  PRINT *,'taue550_ss = ',SUM(taue550_ss),MINVAL(taue550_ss),
   ! .                                        MAXVAL(taue550_ss)
   !
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bcscav_spl.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bcscav_spl.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bcscav_spl.f90	(revision 5160)
@@ -6,4 +6,7 @@
 
   USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+
   IMPLICIT NONE
   !=====================================================================
@@ -12,7 +15,4 @@
   ! Auteur: O. Boucher (LOA)
   !=====================================================================
-  !
-
-  INCLUDE "chem.h"
 
   REAL :: pdtime, alpha_r, alpha_s, R_r, R_s
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/blcloud_scav.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/blcloud_scav.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/blcloud_scav.f90	(revision 5160)
@@ -10,11 +10,10 @@
   USE lmdz_yomcst
 
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+
   IMPLICIT NONE
-
-
-  INCLUDE "chem.h"
-
   !============================= INPUT ===================================
   REAL :: qmin, qmax
@@ -89,6 +88,4 @@
             aux_var1, aux_var2)
 
-
-
     DO i = 1, klon
       DO j = 1, klev
@@ -121,5 +118,4 @@
     ENDIF
 
-
   ENDDO !--boucle sur it
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/blcloud_scav_lsc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/blcloud_scav_lsc.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/blcloud_scav_lsc.f90	(revision 5160)
@@ -10,11 +10,9 @@
   USE lmdz_yomcst
 
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
   IMPLICIT NONE
-
-
-  INCLUDE "chem.h"
-
 
   !============================= INPUT ===================================
@@ -91,6 +89,4 @@
     !JE     .                aux_var1,aux_var2)
 
-
-
     DO i = 1, klon
       DO j = 1, klev
@@ -123,5 +119,4 @@
     ENDIF
 
-
   ENDDO !--boucle sur it
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/chem_spla.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/chem_spla.h	(revision 5159)
+++ 	(revision )
@@ -1,13 +1,0 @@
-
-! $Header$
-
-      INTEGER ss_bins
-      PARAMETER (ss_bins=2)
-
-!      INTEGER nbreg_dust,nbreg_ind, nbreg_bb
-!      PARAMETER (nbreg_dust=11,nbreg_ind=13,nbreg_bb=15)
-
-      REAL masse_ammsulfate
-      PARAMETER (masse_ammsulfate=132.0)              !--g mol-1
-
-
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.f90	(revision 5160)
@@ -46,8 +46,8 @@
   !======================================================================
   ! CHECKING VALUES
-  ! print *,'CHECKING VALUES IN CLTRAC (INI)'
-  ! print *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
-  ! print *,'flux = ',sum(flux),MINVAL(flux),MAXVAL(flux)
-  ! print *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
+  ! PRINT *,'CHECKING VALUES IN CLTRAC (INI)'
+  ! PRINT *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
+  ! PRINT *,'flux = ',sum(flux),MINVAL(flux),MAXVAL(flux)
+  ! PRINT *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
   !======================================================================
   DO k = 1, klev
@@ -107,10 +107,10 @@
   ENDDO
   !======================================================================
-  ! print *,'CHECKING VALUES IN CLTRAC (FIN)'
-  ! print *,'local_tr = ',sum(local_tr),MINVAL(local_tr),
+  ! PRINT *,'CHECKING VALUES IN CLTRAC (FIN)'
+  ! PRINT *,'local_tr = ',sum(local_tr),MINVAL(local_tr),
   ! .                                    MAXVAL(local_tr)
-  !  print *,'zx_ctr = ',sum(zx_ctr),MINVAL(zx_ctr),MAXVAL(zx_ctr)
-  !  print *,'zx_dtr = ',sum(zx_dtr),MINVAL(zx_dtr),MAXVAL(zx_dtr)
-  !  print *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
+  !  PRINT *,'zx_ctr = ',sum(zx_ctr),MINVAL(zx_ctr),MAXVAL(zx_ctr)
+  !  PRINT *,'zx_dtr = ',sum(zx_dtr),MINVAL(zx_dtr),MAXVAL(zx_dtr)
+  !  PRINT *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
   !======================================================================
   !== flux_tr est le flux de traceur (positif vers bas)
@@ -130,6 +130,6 @@
     ENDDO
   ENDDO
-  ! print *,'CHECKING VALUES IN CLTRAC (END)'
-  ! print *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
+  ! PRINT *,'CHECKING VALUES IN CLTRAC (END)'
+  ! PRINT *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
 
 END SUBROUTINE cltrac_spl
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/coarsemission.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/coarsemission.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/coarsemission.f90	(revision 5160)
@@ -29,14 +29,14 @@
   USE infotrac
   USE dustemission_mod, ONLY: dustemission
-  ! USE phytracr_spl_mod, ONLY: nbreg_dust, nbreg_ind, nbreg_bb
+  ! USE lmdz_phytracr_spl, ONLY: nbreg_dust, nbreg_ind, nbreg_bb
   USE lmdz_yomcst
 
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+  USE lmdz_chem_spla, ONLY: ss_bins
   IMPLICIT NONE
 
-
-  INCLUDE "chem.h"
-  INCLUDE "chem_spla.h"
 
 
@@ -131,8 +131,7 @@
   ENDDO
   CALL minmaxsource(tmp_var2, qmin, qmax, 'src: before DD emiss')
-  ! print *,'Source = ',SUM(source_tr),MINVAL(source_tr),
+  ! PRINT *,'Source = ',SUM(source_tr),MINVAL(source_tr),
   ! .                                     MAXVAL(source_tr)
   !  ENDIF
-
 
   IF (.NOT. ok_chimeredust)  THEN
@@ -184,5 +183,5 @@
   ! je  20140522
   IF(ok_chimeredust) THEN
-    print *, 'MIX- NEW SAHARA DUST SOURCE SCHEME...'
+    PRINT *, 'MIX- NEW SAHARA DUST SOURCE SCHEME...'
 
     DO i = 1, klon
@@ -270,5 +269,5 @@
   CALL minmaxsource(tmp_var2, qmin, qmax, 'src: before SS emiss')
   IF(id_coss>0) THEN
-    print *, 'Source = ', SUM(source_tr(:, id_coss)), &
+    PRINT *, 'Source = ', SUM(source_tr(:, id_coss)), &
             MINVAL(source_tr(:, id_coss)), MAXVAL(source_tr(:, id_coss))
   ENDIF
@@ -303,5 +302,5 @@
   CALL minmaxsource(tmp_var2, qmin, qmax, 'src: after SS emiss')
   IF(id_coss>0) THEN
-    print *, 'Source = ', SUM(source_tr(:, id_coss)), &
+    PRINT *, 'Source = ', SUM(source_tr(:, id_coss)), &
             MINVAL(source_tr(:, id_coss)), MAXVAL(source_tr(:, id_coss))
   ENDIF
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.f90	(revision 5160)
@@ -28,5 +28,5 @@
     IF (jour>(360 - 1).AND.jour<=367) THEN
       jour = 360 - 1
-      print *, 'JE: jour changed to jour= ', jour
+      PRINT *, 'JE: jour changed to jour= ', jour
     ELSE
       PRINT*, 'Le jour demande n est pas correcte:', jour
@@ -51,8 +51,8 @@
   ierr = nf90_inq_varid (nid1, "BCFF", nvarid)
   ierr = nf90_get_var(nid1, nvarid, lmt_bcff, debut, epais)
-  ! print *,'IERR = ',ierr
-  ! print *,'nf90_noerr = ',nf90_noerr
-  ! print *,'debut = ',debut
-  ! print *,'epais = ',epais
+  ! PRINT *,'IERR = ',ierr
+  ! PRINT *,'nf90_noerr = ',nf90_noerr
+  ! PRINT *,'debut = ',debut
+  ! PRINT *,'epais = ',epais
   IF (ierr /= nf90_noerr) THEN
     PRINT*, 'Pb de lecture pour les sources BC'
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90	(revision 5160)
@@ -39,5 +39,5 @@
   IF (jour<0 .OR. jour>366) THEN
     PRINT*, 'Le jour demande n est pas correcte:', jour
-    print *, 'JE: FORCED TO CONTINUE (emissions have&
+    PRINT *, 'JE: FORCED TO CONTINUE (emissions have&
             & to be longer than 1 year!!!! )'
     !JE         CALL ABORT
@@ -73,5 +73,5 @@
       CALL exit(1)
     ENDIF
-    !print *,'lmt_bcff = ',lmt_bcff
+    !PRINT *,'lmt_bcff = ',lmt_bcff
     !stop
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.f90	(revision 5160)
@@ -29,5 +29,5 @@
     IF ((jour>(360 - 1)) .AND. (jour<=367)) THEN
       jour = 360 - 1
-      print *, 'JE: jour changed to jour= ', jour
+      PRINT *, 'JE: jour changed to jour= ', jour
     ELSE
       PRINT*, 'Le jour demande n est pas correcte:', jour
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.f90	(revision 5160)
@@ -43,5 +43,5 @@
   IF (jour<0 .OR. jour>(366 - 1)) THEN
     PRINT*, 'Le jour demande n est pas correcte:', jour
-    print *, 'JE: FORCED TO CONTINUE (emissions have&
+    PRINT *, 'JE: FORCED TO CONTINUE (emissions have&
             & to be longer than 1 year!!!! )'
     ! CALL ABORT
@@ -74,7 +74,7 @@
     IF (ierr /= nf90_noerr) THEN
       PRINT*, 'Pb de lecture pour les sources so2 low'
-      print *, 'JE klon, jour, debut ,epais ', klon_glo, jour, debut, epais
+      PRINT *, 'JE klon, jour, debut ,epais ', klon_glo, jour, debut, epais
       CALL HANDLE_ERR(ierr)
-      print *, 'error ierr= ', ierr
+      PRINT *, 'error ierr= ', ierr
       CALL exit(1)
     ENDIF
@@ -183,6 +183,6 @@
     !                  READING VOLCANIC EMISSIONS
     !=======================================================================
-    print *, '   ***      READING VOLCANIC EMISSIONS   ***   '
-    print *, ' Jour = ', jour
+    PRINT *, '   ***      READING VOLCANIC EMISSIONS   ***   '
+    PRINT *, ' Jour = ', jour
     ierr = nf90_open ("sulphur_emissions_volc.nc", nf90_nowrite, nid)
     IF (ierr/=nf90_noerr) THEN
@@ -201,5 +201,5 @@
       CALL exit(1)
     ENDIF
-    print *, 'SO2 volc cont (in read) = ', SUM(lmt_so2volc_cont_glo), &
+    PRINT *, 'SO2 volc cont (in read) = ', SUM(lmt_so2volc_cont_glo), &
             MINVAL(lmt_so2volc_cont_glo), MAXVAL(lmt_so2volc_cont_glo)
     ! lmt_so2volc(:)=0.0
@@ -224,5 +224,5 @@
     ENDIF
     ! lmt_so2volc_expl(:)=0.0
-    print *, 'SO2 volc expl (in read) = ', SUM(lmt_so2volc_expl_glo), &
+    PRINT *, 'SO2 volc expl (in read) = ', SUM(lmt_so2volc_expl_glo), &
             MINVAL(lmt_so2volc_expl_glo), MAXVAL(lmt_so2volc_expl_glo)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/deposition.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/deposition.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/deposition.f90	(revision 5160)
@@ -13,8 +13,10 @@
 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
   IMPLICIT NONE
 
 
-  INCLUDE "chem.h"
+
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90	(revision 5160)
@@ -350,8 +350,8 @@
    CALL abort_gcm('adaptdustemission', 'Dust range problem',1)
   ENDIF
-  print *,'FINE DUST BIN: tuning EMISSION factor= ',tuningfactorfine
-  print *,'COA DUST BIN: tuning EMISSION factor= ',tuningfactorcoa
-  print *,'SCO DUST BIN: tuning EMISSION factor= ',tuningfactorsco
-  print *,'ALL DUST BIN: SUM to the emissions (mg/m2/s) = ',basesumemission
+  PRINT *,'FINE DUST BIN: tuning EMISSION factor= ',tuningfactorfine
+  PRINT *,'COA DUST BIN: tuning EMISSION factor= ',tuningfactorcoa
+  PRINT *,'SCO DUST BIN: tuning EMISSION factor= ',tuningfactorsco
+  PRINT *,'ALL DUST BIN: SUM to the emissions (mg/m2/s) = ',basesumemission
   auxr1=9999.
   auxr2=9999.
@@ -418,6 +418,6 @@
 
 
-!print *,'JE'
-!print *,iminacclow,iminacchigh,imincoalow,imincoahigh
+!PRINT *,'JE'
+!PRINT *,iminacclow,iminacchigh,imincoalow,imincoahigh
 
 ! estimate and integrate bins into only accumulation and coarse
@@ -649,5 +649,5 @@
   varname='A'
   CALL read_surface(varname,Aini)
-print *,'beforewritephy',mpi_rank,omp_rank
+PRINT *,'beforewritephy',mpi_rank,omp_rank
   CALL writefield_phy("SOLinit",solini,5)
   CALL writefield_phy("Pinit",Pini,5)
@@ -657,5 +657,5 @@
   CALL writefield_phy("Dinit",Dini,5)
   CALL writefield_phy("Ainit",Aini,5)
-print *,'afterwritephy',mpi_rank,omp_rank
+PRINT *,'afterwritephy',mpi_rank,omp_rank
 
   DO i=1,klon
@@ -667,7 +667,7 @@
     ENDDO
   ENDDO
-!print *,'JEOK1',mpi_rank,omp_rank
+!PRINT *,'JEOK1',mpi_rank,omp_rank
   DO i=1,klon
-    !print *,Pini(i,1),Pini(i,2),Pini(i,3),Pini(i,4),Pini(i,5)
+    !PRINT *,Pini(i,1),Pini(i,2),Pini(i,3),Pini(i,4),Pini(i,5)
     DO nts=1,ntyp
       !IF(xlon(i).ge.longmin.AND.xlon(i).le.longmax.AND. &
@@ -698,7 +698,7 @@
   ENDDO
 
-! print *,'JEOK2',mpi_rank,omp_rank
+! PRINT *,'JEOK2',mpi_rank,omp_rank
 IF ( 1==1 ) THEN
-! print *,'JEOK4',mpi_rank,omp_rank
+! PRINT *,'JEOK4',mpi_rank,omp_rank
    CALL writefield_phy("SOL",sol,5)
    CALL writefield_phy("P"  ,P  ,5)
@@ -712,6 +712,6 @@
    CALL writefield_phy("xlon",xlon,1)
    CALL writefield_phy("xlat",xlat,1)
-!print *,'JEOK5',mpi_rank,omp_rank
-!print *,'JEOK6',mpi_rank,omp_rank
+!PRINT *,'JEOK5',mpi_rank,omp_rank
+!PRINT *,'JEOK6',mpi_rank,omp_rank
 
 END IF
@@ -724,8 +724,8 @@
 ! data format in columns
 ! mmd1  sigma1  p1  mmd2  sigma2  p2 mmd3 ... alpha
-!print *,'JEOK7',mpi_rank,omp_rank
+!PRINT *,'JEOK7',mpi_rank,omp_rank
 !$OMP MASTER
 IF (is_mpi_root .AND. is_omp_root) THEN
-!print *,'JEOK9',mpi_rank,omp_rank
+!PRINT *,'JEOK9',mpi_rank,omp_rank
  fnsolspe='SOILSPEC.data'
   PRINT*,'  o Reading ',fnsolspe(1:40)
@@ -744,5 +744,5 @@
 !$OMP END MASTER
 !$OMP BARRIER
-!print *,'JEOK10',mpi_rank,omp_rank
+!PRINT *,'JEOK10',mpi_rank,omp_rank
   CALL bcast(solspe)
 ! Calcul de la distribution en taille des particules de Dust
@@ -769,5 +769,5 @@
 !if (.TRUE.) THEN
 !c 0: Iversen and White 1982
-       print *,'Using  Iversen and White 1982 Uth'
+       PRINT *,'Using  Iversen and White 1982 Uth'
          DO i=1,ncl
             bb=adust*(sizeclass(i)**xdust)+bdust
@@ -786,5 +786,5 @@
 IF(.TRUE.) THEN
 ! 1: Shao and Lu 2000
-       print *,'Using  Shao and Lu 2000 Uth'
+       PRINT *,'Using  Shao and Lu 2000 Uth'
             an=0.0123
             gam=0.3
@@ -886,5 +886,5 @@
 ! JE20150120<<
   IF (flag_feff == 0) THEN
-    print *,'JE_dbg FORCED deactivated feff'
+    PRINT *,'JE_dbg FORCED deactivated feff'
     DO i=1,klon
       DO k=1,ntyp
@@ -1072,5 +1072,5 @@
             numax=log(d2max/diam(k))
             massfrac(k,nb)=0.5*(erf(numax/exden)-erf(numin/exden))
-            !print *,k,nb,massfrac(k,nb)
+            !PRINT *,k,nb,massfrac(k,nb)
          ENDDO
       ENDDO
@@ -1209,5 +1209,5 @@
                    pdfu=(kref/weilambda)*(wind10ms(kwb)/weilambda)**(kref-1) &
                       *exp(-(wind10ms(kwb)/weilambda)**kref)
-!                   !print *,'JEdbg  U10mMOD weilambda  ',U10mMOD,weilambda
+!                   !PRINT *,'JEdbg  U10mMOD weilambda  ',U10mMOD,weilambda
 !JE20141205>>
 
@@ -1228,8 +1228,8 @@
              IF(.FALSE.) THEN
 !                  nat=int(sol(i,n))
-!                    print *,i,n
+!                    PRINT *,i,n
                     IF(sol(i,n)>1..and.sol(i,n)<15.) nat=int(sol(i,n))
 !JE20140526<<
-!                    print *,'JE: WARNING: nat=0 forced to nat=99!! and doing nothing'
+!                    PRINT *,'JE: WARNING: nat=0 forced to nat=99!! and doing nothing'
                    IF(sol(i,n)<0.5) THEN
                       nat=99
@@ -1317,5 +1317,5 @@
         flux2=flux2+ft2*cpcent*cerod
         flux3=flux3+ft3*cpcent*cerod
-!       print *,'JEflux :',kwb,n,flux1,flux2,flux3
+!       PRINT *,'JEflux :',kwb,n,flux1,flux2,flux3
 80 CONTINUE
              ENDDO !n=1,ntyp
@@ -1348,14 +1348,14 @@
 
 
-!print *,' JE fluxdust in calcdust'
+!PRINT *,' JE fluxdust in calcdust'
 ! DO k=1,klon
 !   DO i=1,ndistb
-!!print *,k,i,fluxdust(k,i)
+!!PRINT *,k,i,fluxdust(k,i)
 !enddo
 !enddo
-!print *,' JE emisbin in calcdust'
+!PRINT *,' JE emisbin in calcdust'
 !do k=1,klon
 !do j=1,nbins
-!!print *,k,j,emisbin(k,j)
+!!PRINT *,k,j,emisbin(k,j)
 !enddo
 !enddo 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/finemission.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/finemission.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/finemission.f90	(revision 5160)
@@ -14,13 +14,15 @@
   USE indice_sol_mod
   USE infotrac
-  ! USE phytracr_spl_mod, ONLY: nbreg_dust, nbreg_ind, nbreg_bb
+  ! USE lmdz_phytracr_spl, ONLY: nbreg_dust, nbreg_ind, nbreg_bb
   USE lmdz_yomcst
 
 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
   IMPLICIT NONE
 
 
-  INCLUDE "chem.h"
+
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/gastoparticle.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/gastoparticle.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/gastoparticle.f90	(revision 5160)
@@ -1,19 +1,14 @@
 SUBROUTINE gastoparticle(pdtphys, zdz, zrho, xlat, pplay, t_seri, &
-        id_prec, id_fine, &
-        tr_seri, his_g2pgas, his_g2paer)
-  !nhl     .                         fluxso4chem, flux_sparam_sulf,
-
+        id_prec, id_fine, tr_seri, his_g2pgas, his_g2paer)
   USE dimphy
   USE infotrac
   USE lmdz_YOECUMF
-  ! USE indice_sol_mod
   USE lmdz_yomcst
+  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+  USE lmdz_chem_spla, ONLY: masse_ammsulfate
 
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   IMPLICIT NONE
-  !
-
-  INCLUDE "chem.h"
-  INCLUDE "chem_spla.h"
 
   REAL :: pdtphys
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/incloud_scav.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/incloud_scav.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/incloud_scav.f90	(revision 5160)
@@ -12,7 +12,9 @@
 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
   IMPLICIT NONE
 
-  INCLUDE "chem.h"
+
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/incloud_scav_lsc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/incloud_scav_lsc.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/incloud_scav_lsc.f90	(revision 5160)
@@ -12,8 +12,10 @@
 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
   IMPLICIT NONE
 
 
-  INCLUDE "chem.h"
+
 
 
@@ -79,9 +81,9 @@
     !nhl     .             his_dhcon1(1,it))
 
-    !  print *,'JE inscav0'
+    !  PRINT *,'JE inscav0'
     !  IF (iflag_con.LT.3) THEN
 
-    !  print *,'JE inscav1'
-    !  print *,'iflag_con',iflag_con
+    !  PRINT *,'JE inscav1'
+    !  PRINT *,'iflag_con',iflag_con
     !  CALL inscav_spl(pdtphys,it,masse(it),henry(it),kk(it),1.e-3,
     ! .             pmflxr,pmflxs,zrho,zdz,t_seri,aux_var1,aux_var3)
@@ -97,5 +99,5 @@
 
 
-    !  print *,'JE inscav2'
+    !  PRINT *,'JE inscav2'
     DO j = 1, klev
       DO i = 1, klon
@@ -111,4 +113,4 @@
   ENDDO !--boucle sur it
 
-  ! print *,'JE inscav3'
+  ! PRINT *,'JE inscav3'
 END SUBROUTINE incloud_scav_lsc
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.f90	(revision 5160)
@@ -4,6 +4,8 @@
   USE lmdz_YOECUMF
   USE lmdz_yomcst
+  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
 
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   IMPLICIT NONE
   !=====================================================================
@@ -13,6 +15,4 @@
   !=====================================================================
   !
-
-  INCLUDE "chem.h"
 
   INTEGER :: it
@@ -124,5 +124,5 @@
         beta = MIN(MAX(0.0, -beta), 1.0)
       ELSE                          !--reevaporation non totale pour aerosols
-        !print *,'FRAC USED IN INSCAV_SPL'
+        !PRINT *,'FRAC USED IN INSCAV_SPL'
         beta = MIN(MAX(0.0, -beta) * frac, 1.0)
       ENDIF
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_chem_spla.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_chem_spla.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_chem_spla.f90	(revision 5160)
@@ -0,0 +1,8 @@
+MODULE lmdz_chem_spla
+  IMPLICIT NONE; PRIVATE
+  PUBLIC ss_bins, masse_ammsulfate
+
+  INTEGER, PARAMETER :: ss_bins = 2
+  REAL, PARAMETER :: masse_ammsulfate = 132.0  !--g mol-1
+END MODULE lmdz_chem_spla
+
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_phytracr_spl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_phytracr_spl.F90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_phytracr_spl.F90	(revision 5160)
@@ -0,0 +1,4483 @@
+! $Id: physiq.F90 2298 2015-06-14 19:13:32Z fairhead $
+
+MODULE lmdz_phytracr_spl
+  USE lmdz_chem, ONLY: masse_s
+  USE lmdz_chem_spla, ONLY: ss_bins
+
+  IMPLICIT NONE
+
+  REAL, SAVE :: scale_param_ssacc  !Scaling parameter for Fine Sea Salt
+  REAL, SAVE :: scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_ind !Scaling parameter for industrial emissions of SO2
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_bb  !Scaling parameter for biomas burning (SO2,BC & OM)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_ff  !Scaling parameter for industrial emissions (fossil fuel)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustacc  !Scaling parameter for Fine Dust
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustcoa  !Scaling parameter for Coarse Dust
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustsco  !Scaling parameter for SCoarse Dust
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: param_wstarBLperregion  !parameter for ..
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: param_wstarWAKEperregion  !parameter for ..
+  !$OMP THREADPRIVATE(scale_param_ind,scale_param_bb,scale_param_ff)
+  !$OMP THREADPRIVATE(scale_param_dustacc,scale_param_dustcoa,scale_param_dustsco)
+  !$OMP THREADPRIVATE(scale_param_ssacc,scale_param_sscoa)
+  !$OMP THREADPRIVATE(param_wstarBLperregion,param_wstarWAKEperregion)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dust_ec, u10m_ec, v10m_ec
+  !$OMP THREADPRIVATE(dust_ec, u10m_ec, v10m_ec)
+
+  CHARACTER*800 fileregionsdimsind
+  CHARACTER*800 fileregionsdimsdust
+  CHARACTER*800 fileregionsdimsbb
+  CHARACTER*800 fileregionsdimswstar
+  CHARACTER*100 paramname_ind
+  CHARACTER*100 paramname_bb
+  CHARACTER*100 paramname_ff
+  CHARACTER*100 paramname_dustacc
+  CHARACTER*100 paramname_dustcoa
+  CHARACTER*100 paramname_dustsco
+  CHARACTER*100 paramname_ssacc
+  CHARACTER*100 paramname_sscoa
+  CHARACTER*100 paramname_wstarBL
+  CHARACTER*100 paramname_wstarWAKE
+
+  CHARACTER*800 filescaleparams
+  CHARACTER*800 paramsname
+
+
+  !!------------------------ SULFUR emissions ----------------------------
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2volc_cont  ! emissions so2 volcan continuous
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_altvolc_cont  ! altitude  so2 volcan continuous
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2volc_expl  ! emissions so2 volcan explosive
+  !$OMP THREADPRIVATE( lmt_so2volc_cont,lmt_altvolc_cont,lmt_so2volc_expl )
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_altvolc_expl  ! altitude  so2 volcan explosive
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ff_l       ! emissions so2 fossil fuel (low)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ff_h       ! emissions so2 fossil fuel (high)
+  !$OMP THREADPRIVATE( lmt_altvolc_expl,lmt_so2ff_l,lmt_so2ff_h )
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2nff        ! emissions so2 non-fossil fuel
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ba         ! emissions de so2 bateau
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2bb_l       ! emissions de so2 biomass burning (low)
+  !$OMP THREADPRIVATE( lmt_so2nff,lmt_so2ba,lmt_so2bb_l )
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2bb_h       ! emissions de so2 biomass burning (high)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_dmsconc       ! concentration de dms oceanique
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_dmsbio        ! emissions de dms bio
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_h2sbio        ! emissions de h2s bio
+  !$OMP THREADPRIVATE(lmt_so2bb_h,lmt_dmsconc,lmt_dmsbio,lmt_h2sbio )
+  !------------------------- BLACK CARBON emissions ----------------------
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcff       ! emissions de BC fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcnff      ! emissions de BC non-fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcbb_l     ! emissions de BC biomass basses
+  !$OMP THREADPRIVATE( lmt_bcff,lmt_bcnff,lmt_bcbb_l)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcbb_h     ! emissions de BC biomass hautes
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcba       ! emissions de BC bateau
+  !$OMP THREADPRIVATE(lmt_bcbb_h,lmt_bcba)
+  !------------------------ ORGANIC MATTER emissions ---------------------
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omff     ! emissions de OM fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omnff    ! emissions de OM non-fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_ombb_l   ! emissions de OM biomass basses
+  !$OMP THREADPRIVATE( lmt_omff,lmt_omnff,lmt_ombb_l)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_ombb_h   ! emissions de OM biomass hautes
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omnat    ! emissions de OM Natural
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omba     ! emissions de OM bateau
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: lmt_sea_salt    ! emissions de OM Natural
+  !$OMP THREADPRIVATE(lmt_ombb_h,lmt_omnat,lmt_omba,lmt_sea_salt)
+
+  !JE20141224 >>
+  ! others
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: tsol
+  !$OMP THREADPRIVATE(tsol)
+  INTEGER :: ijulday
+  LOGICAL, parameter :: edgar = .TRUE.
+  INTEGER, parameter :: flag_dms = 4
+  INTEGER(kind = 4)  nbjour
+
+  ! Tracer tendencies, for outputs
+  !-------------------------------
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl  ! Td couche
+  !. limite/traceur
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dec
+  !RomP
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv  ! Td
+  !onvection/traceur
+  ! RomP >>>
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_insc
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_bcscav
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_evapls
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_ls
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_trsp
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sscav
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sat
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_uscav
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPr, qDi ! concentration tra
+  !dans pluie,air descente insaturee
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPa, qMel
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qTrdi, dtrcvMA ! conc traceur
+  !descente air insaturee et td convective MA
+  !! RomP <<<
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th  ! Td thermique
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_impa ! Td du
+  !lessivage par impaction
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_nucl ! Td du
+  !lessivage par nucleation
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: qPrls      !jyg:
+  !oncentration tra dans pluie LS a la surf.
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dry ! Td depot
+  !sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: flux_tr_dry ! depot
+  !sec/traceur (surface),ALLOCATABLE,SAVE    jyg
+
+  ! Index of each traceur
+  INTEGER, SAVE :: id_prec, id_fine, id_coss, id_codu, id_scdu
+
+  !$OMP THREADPRIVATE(d_tr_cl,d_tr_dec,d_tr_cv,d_tr_insc,d_tr_bcscav,d_tr_evapls)
+  !$OMP THREADPRIVATE(d_tr_ls,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav)
+  !$OMP THREADPRIVATE(qPr,qDi,qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa)
+  !$OMP THREADPRIVATE(d_tr_lessi_nucl,qPrls,d_tr_dry,flux_tr_dry)
+  !$OMP THREADPRIVATE(id_prec,id_fine,id_coss,id_codu,id_scdu)
+
+  ! JE20141224 <<
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diff_aod550_tot  ! epaisseur optique total aerosol 550  nm
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_tot  ! epaisseur optique total aerosol 670 nm
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_tot  ! epaisseur optique total aerosol 865 nm
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diff_aod550_tr2  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_tr2  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_tr2  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_ss  ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_ss  ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_ss   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_dust ! epaisseur optique Dust aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_dust ! epaisseur optique Dust aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_dust ! epaisseur optique Dust aerosol 865 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_dustsco ! epaisseur optique Dust SCOarse aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_dustsco ! epaisseur optique Dust SCOarse aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_dustsco ! epaisseur optique Dust SCOarse aerosol 865 nm, diagnostic
+
+  !$OMP THREADPRIVATE(diff_aod550_tot,diag_aod670_tot,diag_aod865_tot)
+  !$OMP THREADPRIVATE(diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2)
+  !$OMP THREADPRIVATE(diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,diag_aod550_dust)
+  !$OMP THREADPRIVATE(diag_aod670_dust,diag_aod865_dust,diag_aod550_dustsco)
+  !$OMP THREADPRIVATE(diag_aod670_dustsco,diag_aod865_dustsco)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+
+  !$OMP THREADPRIVATE(aod550_aqua,aod550_tr2_aqua,aod550_ss_aqua,aod550_dust_aqua,aod550_dustsco_aqua)
+  !$OMP THREADPRIVATE(aod670_aqua,aod670_tr2_aqua,aod670_ss_aqua,aod670_dust_aqua,aod670_dustsco_aqua)
+  !$OMP THREADPRIVATE(aod865_aqua,aod865_tr2_aqua,aod865_ss_aqua,aod865_dust_aqua,aod865_dustsco_aqua)
+  !$OMP THREADPRIVATE(aod550_terra,aod550_tr2_terra,aod550_ss_terra,aod550_dust_terra,aod550_dustsco_terra)
+  !$OMP THREADPRIVATE(aod670_terra,aod670_tr2_terra,aod670_ss_terra,aod670_dust_terra,aod670_dustsco_terra)
+  !$OMP THREADPRIVATE(aod865_terra,aod865_tr2_terra,aod865_ss_terra,aod865_dust_terra,aod865_dustsco_terra)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc01 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm01   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc02 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm02   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc03 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm03   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc04 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm04   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc05 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm05   ! burden
+  !$OMP THREADPRIVATE(sconc01,sconc02,sconc03,sconc04,sconc05)
+  !$OMP THREADPRIVATE(trm01,trm02,trm03,trm04,trm05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux05
+  !$OMP THREADPRIVATE(flux01,flux02,flux03,flux04,flux05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds05
+  !$OMP THREADPRIVATE(ds01,ds02,ds03,ds04,ds05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh05
+  !$OMP THREADPRIVATE(dh01,dh02,dh03,dh04,dh05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv05
+  !$OMP THREADPRIVATE(dtrconv01,dtrconv02,dtrconv03,dtrconv04,dtrconv05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm05
+  !$OMP THREADPRIVATE(dtherm01,dtherm02,dtherm03,dtherm04,dtherm05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv05
+  !$OMP THREADPRIVATE(dhkecv01,dhkecv02,dhkecv03,dhkecv04,dhkecv05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds05
+  !$OMP THREADPRIVATE(d_tr_ds01,d_tr_ds02,d_tr_ds03,d_tr_ds04,d_tr_ds05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc05
+  !$OMP THREADPRIVATE(dhkelsc01,dhkelsc02,dhkelsc03,dhkelsc04,dhkelsc05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv05
+  !$OMP THREADPRIVATE(d_tr_cv01,d_tr_cv02,d_tr_cv03,d_tr_cv04,d_tr_cv05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp05
+  !$OMP THREADPRIVATE(d_tr_trsp01,d_tr_trsp02,d_tr_trsp03,d_tr_trsp04,d_tr_trsp05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav05
+  !$OMP THREADPRIVATE(d_tr_sscav01,d_tr_sscav02,d_tr_sscav03,d_tr_sscav04,d_tr_sscav05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat05
+  !$OMP THREADPRIVATE(d_tr_sat01,d_tr_sat02,d_tr_sat03,d_tr_sat04,d_tr_sat05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav05
+  !$OMP THREADPRIVATE(d_tr_uscav01,d_tr_uscav02,d_tr_uscav03,d_tr_uscav04,d_tr_uscav05)
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc05
+  !$OMP THREADPRIVATE(d_tr_insc01,d_tr_insc02,d_tr_insc03,d_tr_insc04,d_tr_insc05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav05
+  !$OMP THREADPRIVATE(d_tr_bcscav01,d_tr_bcscav02,d_tr_bcscav03,d_tr_bcscav04,d_tr_bcscav05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls05
+  !$OMP THREADPRIVATE(d_tr_evapls01,d_tr_evapls02,d_tr_evapls03,d_tr_evapls04,d_tr_evapls05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls05
+  !$OMP THREADPRIVATE(d_tr_ls01,d_tr_ls02,d_tr_ls03,d_tr_ls04,d_tr_ls05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn05
+  !$OMP THREADPRIVATE(d_tr_dyn01,d_tr_dyn02,d_tr_dyn03,d_tr_dyn04,d_tr_dyn05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl05
+  !$OMP THREADPRIVATE(d_tr_cl01,d_tr_cl02,d_tr_cl03,d_tr_cl04,d_tr_cl05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th05
+  !$OMP THREADPRIVATE(d_tr_th01,d_tr_th02,d_tr_th03,d_tr_th04,d_tr_th05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_ss3D    ! corresponds to tracer 3
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_dust3D  ! corresponds to tracer 4
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_dustsco3D  ! corresponds to tracer 4
+  !$OMP THREADPRIVATE(sed_ss3D,sed_dust3D,sed_dustsco3D)
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_ss    ! corresponds to tracer 3
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dust  ! corresponds to tracer 4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dustsco  ! corresponds to tracer 4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2pgas  ! corresponds to tracer 4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2paer  ! corresponds to tracer 4
+  !$OMP THREADPRIVATE(sed_ss,sed_dust,sed_dustsco,his_g2pgas,his_g2paer)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcbb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcnff
+  !$OMP THREADPRIVATE(fluxbb,fluxff,fluxbcbb,fluxbcff,fluxbcnff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcba
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbc
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxombb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnff
+  !$OMP THREADPRIVATE(fluxbcba,fluxbc,fluxombb,fluxomff,fluxomnff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomba
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnat
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxom
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2snff
+  !$OMP THREADPRIVATE(fluxomba,fluxomnat,fluxom,fluxh2sff,fluxh2snff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2nff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2bb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2vol
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ba
+  !$OMP THREADPRIVATE(fluxso2ff,fluxso2nff,fluxso2bb,fluxso2vol,fluxso2ba)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4nff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4bb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ba
+  !$OMP THREADPRIVATE(fluxso2,fluxso4ff,fluxso4nff,fluxso4ba,fluxso4bb)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdms
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sbio
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdustec
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddfine
+  !$OMP THREADPRIVATE(fluxso4,fluxdms,fluxh2sbio,fluxdustec,fluxddfine)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddcoa
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddsco
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdd
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxssfine
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxsscoa
+  !$OMP THREADPRIVATE(fluxddcoa,fluxddsco,fluxdd,fluxssfine,fluxsscoa)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxss
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ind
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_bb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ff
+  !$OMP THREADPRIVATE(fluxss,flux_sparam_ind,flux_sparam_bb,flux_sparam_ff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddfine
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddcoa
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddsco
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ssfine
+  !$OMP THREADPRIVATE(flux_sparam_ddfine,flux_sparam_ddcoa)
+  !$OMP THREADPRIVATE(flux_sparam_ddsco,flux_sparam_ssfine)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_sscoa
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: u10m_ss
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: v10m_ss
+  !$OMP THREADPRIVATE(flux_sparam_sscoa,u10m_ss,v10m_ss)
+
+  ! Select dust emission scheme for the Sahara:
+  !      LOGICAL,PARAMETER,SAVE ::  ok_chimeredust=.FALSE.
+  LOGICAL, PARAMETER :: ok_chimeredust = .TRUE.
+  !!!!!! !$OMP THREADPRIVATE(ok_chimeredust)
+
+
+CONTAINS
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE phytracr_spl_out_init()
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !AS : This SUBROUTINE centralises the ALLOCATE needed for the 1st CALL of
+    !     phys_output_write_spl in physiq
+
+    USE dimphy
+    USE infotrac_phy, ONLY: nbtr
+    USE dustemission_mod, ONLY: dustemis_out_init
+
+    ! pour les variables m[1-3]dflux
+    CALL dustemis_out_init()
+
+    !traceur
+    ALLOCATE(diff_aod550_tot(klon))
+    ALLOCATE(diag_aod670_tot(klon))
+    ALLOCATE(diag_aod865_tot(klon))
+    ALLOCATE(diff_aod550_tr2(klon))
+    ALLOCATE(diag_aod670_tr2(klon))
+    ALLOCATE(diag_aod865_tr2(klon))
+    ALLOCATE(diag_aod550_ss(klon))
+    ALLOCATE(diag_aod670_ss(klon))
+    ALLOCATE(diag_aod865_ss(klon))
+    ALLOCATE(diag_aod550_dust(klon))
+    ALLOCATE(diag_aod670_dust(klon))
+    ALLOCATE(diag_aod865_dust(klon))
+    ALLOCATE(diag_aod550_dustsco(klon))
+    ALLOCATE(diag_aod670_dustsco(klon))
+    ALLOCATE(diag_aod865_dustsco(klon))
+    !AS: les 15 vars _terra et 15 _aqua suivantes sont groupees differemment dans spla_output_write.h
+    ALLOCATE(aod550_terra(klon))
+    ALLOCATE(aod550_tr2_terra(klon))
+    ALLOCATE(aod550_ss_terra(klon))
+    ALLOCATE(aod550_dust_terra(klon))
+    ALLOCATE(aod550_dustsco_terra(klon))
+    ALLOCATE(aod670_terra(klon))
+    ALLOCATE(aod670_tr2_terra(klon))
+    ALLOCATE(aod670_ss_terra(klon))
+    ALLOCATE(aod670_dust_terra(klon))
+    ALLOCATE(aod670_dustsco_terra(klon))
+    ALLOCATE(aod865_terra(klon))
+    ALLOCATE(aod865_tr2_terra(klon))
+    ALLOCATE(aod865_ss_terra(klon))
+    ALLOCATE(aod865_dust_terra(klon))
+    ALLOCATE(aod865_dustsco_terra(klon))
+
+    ALLOCATE(aod550_aqua(klon))
+    ALLOCATE(aod550_tr2_aqua(klon))
+    ALLOCATE(aod550_ss_aqua(klon))
+    ALLOCATE(aod550_dust_aqua(klon))
+    ALLOCATE(aod550_dustsco_aqua(klon))
+    ALLOCATE(aod670_aqua(klon))
+    ALLOCATE(aod670_tr2_aqua(klon))
+    ALLOCATE(aod670_ss_aqua(klon))
+    ALLOCATE(aod670_dust_aqua(klon))
+    ALLOCATE(aod670_dustsco_aqua(klon))
+    ALLOCATE(aod865_aqua(klon))
+    ALLOCATE(aod865_tr2_aqua(klon))
+    ALLOCATE(aod865_ss_aqua(klon))
+    ALLOCATE(aod865_dust_aqua(klon))
+    ALLOCATE(aod865_dustsco_aqua(klon))
+
+    ALLOCATE(sconc01(klon))
+    ALLOCATE(trm01(klon))
+    ALLOCATE(sconc02(klon))
+    ALLOCATE(trm02(klon))
+    ALLOCATE(sconc03(klon))
+    ALLOCATE(trm03(klon))
+    ALLOCATE(sconc04(klon))
+    ALLOCATE(trm04(klon))
+    ALLOCATE(sconc05(klon))
+    ALLOCATE(trm05(klon))
+
+    ! Lessivage
+    ALLOCATE(flux01(klon))
+    ALLOCATE(flux02(klon))
+    ALLOCATE(flux03(klon))
+    ALLOCATE(flux04(klon))
+    ALLOCATE(flux05(klon))
+    ALLOCATE(ds01(klon))
+    ALLOCATE(ds02(klon))
+    ALLOCATE(ds03(klon))
+    ALLOCATE(ds04(klon))
+    ALLOCATE(ds05(klon))
+    ALLOCATE(dh01(klon))
+    ALLOCATE(dh02(klon))
+    ALLOCATE(dh03(klon))
+    ALLOCATE(dh04(klon))
+    ALLOCATE(dh05(klon))
+    ALLOCATE(dtrconv01(klon))
+    ALLOCATE(dtrconv02(klon))
+    ALLOCATE(dtrconv03(klon))
+    ALLOCATE(dtrconv04(klon))
+    ALLOCATE(dtrconv05(klon))
+    ALLOCATE(dtherm01(klon))
+    ALLOCATE(dtherm02(klon))
+    ALLOCATE(dtherm03(klon))
+    ALLOCATE(dtherm04(klon))
+    ALLOCATE(dtherm05(klon))
+    ALLOCATE(dhkecv01(klon))
+    ALLOCATE(dhkecv02(klon))
+    ALLOCATE(dhkecv03(klon))
+    ALLOCATE(dhkecv04(klon))
+    ALLOCATE(dhkecv05(klon))
+    ALLOCATE(d_tr_ds01(klon))
+    ALLOCATE(d_tr_ds02(klon))
+    ALLOCATE(d_tr_ds03(klon))
+    ALLOCATE(d_tr_ds04(klon))
+    ALLOCATE(d_tr_ds05(klon))
+    ALLOCATE(dhkelsc01(klon))
+    ALLOCATE(dhkelsc02(klon))
+    ALLOCATE(dhkelsc03(klon))
+    ALLOCATE(dhkelsc04(klon))
+    ALLOCATE(dhkelsc05(klon))
+    ALLOCATE(d_tr_cv01(klon, klev))
+    ALLOCATE(d_tr_cv02(klon, klev))
+    ALLOCATE(d_tr_cv03(klon, klev))
+    ALLOCATE(d_tr_cv04(klon, klev))
+    ALLOCATE(d_tr_cv05(klon, klev))
+    ALLOCATE(d_tr_trsp01(klon, klev))
+    ALLOCATE(d_tr_trsp02(klon, klev))
+    ALLOCATE(d_tr_trsp03(klon, klev))
+    ALLOCATE(d_tr_trsp04(klon, klev))
+    ALLOCATE(d_tr_trsp05(klon, klev))
+    ALLOCATE(d_tr_sscav01(klon, klev))
+    ALLOCATE(d_tr_sscav02(klon, klev))
+    ALLOCATE(d_tr_sscav03(klon, klev))
+    ALLOCATE(d_tr_sscav04(klon, klev))
+    ALLOCATE(d_tr_sscav05(klon, klev))
+    ALLOCATE(d_tr_sat01(klon, klev))
+    ALLOCATE(d_tr_sat02(klon, klev))
+    ALLOCATE(d_tr_sat03(klon, klev))
+    ALLOCATE(d_tr_sat04(klon, klev))
+    ALLOCATE(d_tr_sat05(klon, klev))
+    ALLOCATE(d_tr_uscav01(klon, klev))
+    ALLOCATE(d_tr_uscav02(klon, klev))
+    ALLOCATE(d_tr_uscav03(klon, klev))
+    ALLOCATE(d_tr_uscav04(klon, klev))
+    ALLOCATE(d_tr_uscav05(klon, klev))
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    ALLOCATE(d_tr_insc01(klon, klev))
+    ALLOCATE(d_tr_insc02(klon, klev))
+    ALLOCATE(d_tr_insc03(klon, klev))
+    ALLOCATE(d_tr_insc04(klon, klev))
+    ALLOCATE(d_tr_insc05(klon, klev))
+    ALLOCATE(d_tr_bcscav01(klon, klev))
+    ALLOCATE(d_tr_bcscav02(klon, klev))
+    ALLOCATE(d_tr_bcscav03(klon, klev))
+    ALLOCATE(d_tr_bcscav04(klon, klev))
+    ALLOCATE(d_tr_bcscav05(klon, klev))
+    ALLOCATE(d_tr_evapls01(klon, klev))
+    ALLOCATE(d_tr_evapls02(klon, klev))
+    ALLOCATE(d_tr_evapls03(klon, klev))
+    ALLOCATE(d_tr_evapls04(klon, klev))
+    ALLOCATE(d_tr_evapls05(klon, klev))
+    ALLOCATE(d_tr_ls01(klon, klev))
+    ALLOCATE(d_tr_ls02(klon, klev))
+    ALLOCATE(d_tr_ls03(klon, klev))
+    ALLOCATE(d_tr_ls04(klon, klev))
+    ALLOCATE(d_tr_ls05(klon, klev))
+
+    ALLOCATE(d_tr_dyn01(klon, klev))
+    ALLOCATE(d_tr_dyn02(klon, klev))
+    ALLOCATE(d_tr_dyn03(klon, klev))
+    ALLOCATE(d_tr_dyn04(klon, klev))
+    ALLOCATE(d_tr_dyn05(klon, klev))
+
+    ALLOCATE(d_tr_cl01(klon, klev))
+    ALLOCATE(d_tr_cl02(klon, klev))
+    ALLOCATE(d_tr_cl03(klon, klev))
+    ALLOCATE(d_tr_cl04(klon, klev))
+    ALLOCATE(d_tr_cl05(klon, klev))
+    ALLOCATE(d_tr_th01(klon, klev))
+    ALLOCATE(d_tr_th02(klon, klev))
+    ALLOCATE(d_tr_th03(klon, klev))
+    ALLOCATE(d_tr_th04(klon, klev))
+    ALLOCATE(d_tr_th05(klon, klev))
+
+    ALLOCATE(sed_ss(klon))
+    ALLOCATE(sed_dust(klon))
+    ALLOCATE(sed_dustsco(klon))
+    ALLOCATE(his_g2pgas(klon))
+    ALLOCATE(his_g2paer(klon))
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    ALLOCATE(sed_ss3D(klon, klev))
+    ALLOCATE(sed_dust3D(klon, klev))
+    ALLOCATE(sed_dustsco3D(klon, klev))
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    ! histrac_spl
+
+    ALLOCATE(fluxbb(klon))
+    ALLOCATE(fluxff(klon))
+    ALLOCATE(fluxbcbb(klon))
+    ALLOCATE(fluxbcff(klon))
+    ALLOCATE(fluxbcnff(klon))
+    ALLOCATE(fluxbcba(klon))
+    ALLOCATE(fluxbc(klon))
+    ALLOCATE(fluxombb(klon))
+    ALLOCATE(fluxomff(klon))
+    ALLOCATE(fluxomnff(klon))
+    ALLOCATE(fluxomba(klon))
+    ALLOCATE(fluxomnat(klon))
+    ALLOCATE(fluxom(klon))
+    ALLOCATE(fluxh2sff(klon))
+    ALLOCATE(fluxh2snff(klon))
+    ALLOCATE(fluxso2ff(klon))
+    ALLOCATE(fluxso2nff(klon))
+    ALLOCATE(fluxso2bb(klon))
+    ALLOCATE(fluxso2vol(klon))
+    ALLOCATE(fluxso2ba(klon))
+    ALLOCATE(fluxso2(klon))
+    ALLOCATE(fluxso4ff(klon))
+    ALLOCATE(fluxso4nff(klon))
+    ALLOCATE(fluxso4bb(klon))
+    ALLOCATE(fluxso4ba(klon))
+    ALLOCATE(fluxso4(klon))
+    ALLOCATE(fluxdms(klon))
+    ALLOCATE(fluxh2sbio(klon))
+    ALLOCATE(fluxdustec(klon))
+    ALLOCATE(fluxddfine(klon))
+    ALLOCATE(fluxddcoa(klon))
+    ALLOCATE(fluxddsco(klon))
+    ALLOCATE(fluxdd(klon))
+    ALLOCATE(fluxssfine(klon))
+    ALLOCATE(fluxsscoa(klon))
+    ALLOCATE(fluxss(klon))
+    ALLOCATE(flux_sparam_ind(klon))
+    ALLOCATE(flux_sparam_bb(klon))
+    ALLOCATE(flux_sparam_ff(klon))
+    ALLOCATE(flux_sparam_ddfine(klon))
+    ALLOCATE(flux_sparam_ddcoa(klon))
+    ALLOCATE(flux_sparam_ddsco(klon))
+    ALLOCATE(flux_sparam_ssfine(klon))
+    ALLOCATE(flux_sparam_sscoa(klon))
+    ALLOCATE(u10m_ss(klon))
+    ALLOCATE(v10m_ss(klon))
+
+    !AS: in phys_output_write_spl, but not in spla_output_write.h
+    !------------------------------------------------------
+    ALLOCATE(d_tr_cl(klon, klev, nbtr))
+    ALLOCATE(d_tr_th(klon, klev, nbtr))
+    ALLOCATE(d_tr_cv(klon, klev, nbtr))
+    ALLOCATE(d_tr_lessi_impa(klon, klev, nbtr))
+    ALLOCATE(d_tr_lessi_nucl(klon, klev, nbtr))
+    ALLOCATE(d_tr_insc(klon, klev, nbtr))
+    ALLOCATE(d_tr_bcscav(klon, klev, nbtr))
+    ALLOCATE(d_tr_evapls(klon, klev, nbtr))
+    ALLOCATE(d_tr_ls(klon, klev, nbtr))
+    ALLOCATE(d_tr_trsp(klon, klev, nbtr))
+    ALLOCATE(d_tr_sscav(klon, klev, nbtr))
+    ALLOCATE(d_tr_sat(klon, klev, nbtr))
+    ALLOCATE(d_tr_uscav(klon, klev, nbtr))
+
+  END SUBROUTINE phytracr_spl_out_init
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE phytracr_spl_ini(klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust)
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    IMPLICIT NONE
+    INTEGER klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust
+
+    ALLOCATE(tsol(klon))
+
+    !AS: IF permettant le debranchage des coefs de Jeronimo Escribano: fichiers *_meta
+    ! nbreg_* sont initialisés à 1 dans phytracr_spl, if debutphy,
+    ! avant d'appeler la SUBROUTINE presente, phytracr_spl_ini
+    ! (phytracr_spl_ini appele readregionsdims2_spl,
+    ! qui lit et fait "bcast" de nbreg_ind,_bb,_dust,_wstardust dans fichiers regions_*_meta)
+    IF("ASSIM"=="YES") THEN
+      fileregionsdimsind = 'regions_ind_meta'
+      fileregionsdimsdust = 'regions_dustacc_meta'
+      !  fileregionsdimsdust='regions_dust_meta'
+      fileregionsdimsbb = 'regions_bb_meta'
+      fileregionsdimswstar = 'regions_pwstarwake_meta'
+      CALL  readregionsdims2_spl(nbreg_ind, fileregionsdimsind)
+      CALL  readregionsdims2_spl(nbreg_dust, fileregionsdimsdust)
+      CALL  readregionsdims2_spl(nbreg_bb, fileregionsdimsbb)
+      CALL  readregionsdims2_spl(nbreg_wstardust, fileregionsdimswstar)
+    ENDIF ! ASSIM
+    ! fin debranchage
+
+    !readregions_spl()
+
+    ALLOCATE(scale_param_ind(nbreg_ind))
+    ALLOCATE(scale_param_bb(nbreg_bb))
+    ALLOCATE(scale_param_ff(nbreg_ind))
+    ALLOCATE(scale_param_dustacc(nbreg_dust))
+    ALLOCATE(scale_param_dustcoa(nbreg_dust))
+    ALLOCATE(scale_param_dustsco(nbreg_dust))
+    ALLOCATE(param_wstarBLperregion(nbreg_wstardust))
+    ALLOCATE(param_wstarWAKEperregion(nbreg_wstardust))
+    ALLOCATE(dust_ec(klon))
+    ALLOCATE(u10m_ec(klon))
+    ALLOCATE(v10m_ec(klon))
+    ALLOCATE(lmt_so2volc_cont(klon))
+    ALLOCATE(lmt_altvolc_cont(klon))
+    ALLOCATE(lmt_so2volc_expl(klon))
+    ALLOCATE(lmt_altvolc_expl(klon))
+    ALLOCATE(lmt_so2ff_l(klon))
+    ALLOCATE(lmt_so2ff_h(klon))
+    ALLOCATE(lmt_so2nff(klon))
+    ALLOCATE(lmt_so2ba(klon))
+    ALLOCATE(lmt_so2bb_l(klon))
+    ALLOCATE(lmt_so2bb_h(klon))
+    ALLOCATE(lmt_dmsconc(klon))
+    ALLOCATE(lmt_dmsbio(klon))
+    ALLOCATE(lmt_h2sbio(klon))
+    ALLOCATE(lmt_bcff(klon))
+    ALLOCATE(lmt_bcnff(klon))
+    ALLOCATE(lmt_bcbb_l(klon))
+    ALLOCATE(lmt_bcbb_h(klon))
+    ALLOCATE(lmt_bcba(klon))
+    ALLOCATE(lmt_omff(klon))
+    ALLOCATE(lmt_omnff(klon))
+    ALLOCATE(lmt_ombb_l(klon))
+    ALLOCATE(lmt_ombb_h(klon))
+    ALLOCATE(lmt_omnat(klon))
+    ALLOCATE(lmt_omba(klon))
+    ALLOCATE(lmt_sea_salt(klon, ss_bins))
+
+
+
+
+    !temporal hardcoded null inicialization of assimilation emmision factors
+    !AS: scale_param sont ensuite lus dans modvalues.nc
+    ! par la SUBROUTINE read_scalenc, appelee par readscaleparamsnc_spl
+    scale_param_ssacc = 1.
+    scale_param_sscoa = 1.
+    scale_param_ind(:) = 1.
+    scale_param_bb(:) = 1.
+    scale_param_ff(:) = 1.
+    scale_param_dustacc(:) = 1.
+    scale_param_dustcoa(:) = 1.
+    scale_param_dustsco(:) = 1.
+    param_wstarBLperregion(:) = 0.
+    param_wstarWAKEperregion(:) = 0.
+
+  END SUBROUTINE phytracr_spl_ini
+
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE phytracr_spl(debutphy, lafin, jD_cur, jH_cur, iflag_conv, &  ! I
+          pdtphys, ftsol, &  ! I
+          t_seri, q_seri, paprs, pplay, RHcl, &  ! I
+          pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &  ! I
+          coefh, cdragh, cdragm, yu1, yv1, &  ! I
+          u_seri, v_seri, rlat, rlon, &  ! I
+          pphis, pctsrf, pmflxr, pmflxs, prfl, psfl, &  ! I
+          da, phi, phi2, d1a, dam, mp, ep, sigd, sij, clw, elij, &  ! I
+          epmlmMm, eplaMm, upwd, dnwd, itop_con, ibas_con, &  ! I
+          evapls, wdtrainA, wdtrainM, wght_cvfd, &  ! I
+          fm_therm, entr_therm, rneb, &  ! I
+          beta_fisrt, beta_v1, &  ! I
+          zu10m, zv10m, wstar, ale_bl, ale_wake, &  ! I
+          d_tr_dyn, tr_seri)                                            ! O
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+    USE IOIPSL
+    USE dimphy
+    USE infotrac
+    USE indice_sol_mod
+    USE lmdz_writefield_phy
+
+    USE lmdz_phys_transfert_para
+    USE lmdz_thermcell_dq, ONLY: thermcell_dq
+    USE phys_cal_mod, ONLY: jD_1jan, year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
+            mth_cur, phys_cal_update
+
+    USE lmdz_yomcst
+    USE lmdz_alpale
+    USE lmdz_yoethf
+    USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+    USE lmdz_paramet
+    USE lmdz_chem, ONLY: masse_s
+    USE lmdz_chem_spla, ONLY: ss_bins
+    USE lmdz_read_newemissions, ONLY: read_newemissions
+    USE lmdz_precureemission, ONLY: precuremission
+
+    IMPLICIT NONE
+
+    !======================================================================
+    ! Auteur(s) FH
+    ! Objet: Moniteur general des tendances traceurs
+
+    ! Remarques en vrac:
+    ! ------------------
+    ! 1/ le CALL phytrac se fait avec nqmax-2 donc nous avons bien
+    ! les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
+    !! AS : nqmax-2 devrait etre nqmax-3 apres introducton de H2Oi ;
+    !!   et c'est encore different avec le parser de DC ?
+    !======================================================================
+
+    ! Arguments:
+
+    !  EN ENTREE:
+    !  ==========
+
+    !  divers:
+    !  -------
+
+    REAL, INTENT(IN) :: pdtphys  ! pas d'integration pour la physique (seconde)
+    REAL, INTENT(IN) :: jD_cur, jH_cur
+    REAL, INTENT(IN) :: ftsol(klon, nbsrf)  ! temperature du sol par type
+    REAL, INTENT(IN) :: t_seri(klon, klev)  ! temperature
+    REAL, INTENT(IN) :: u_seri(klon, klev)  ! vent
+    REAL, INTENT(IN) :: v_seri(klon, klev)  ! vent
+    REAL, INTENT(IN) :: q_seri(klon, klev)  ! vapeur d eau kg/kg
+
+    LOGICAL, INTENT(IN) :: lafin
+
+    REAL tr_seri(klon, klev, nbtr) ! traceur
+    REAL tmp_var(klon, klev) ! auxiliary variable to replace traceur
+    REAL tmp_var2(klon, nbtr) ! auxiliary variable to replace source
+    REAL tmp_var3(klon, klev, nbtr) ! auxiliary variable 3D
+    REAL dummy1d ! JE auxiliary variable
+    REAL aux_var2(klon) ! auxiliary variable to replace traceur
+    REAL aux_var3(klon, klev) ! auxiliary variable to replace traceur
+    REAL d_tr(klon, klev, nbtr)    ! traceur  tendance
+    REAL sconc_seri(klon, nbtr) ! surface concentration of traceur
+
+    INTEGER nbjour
+    save nbjour
+    !$OMP THREADPRIVATE(nbjour)
+
+    INTEGER  masque_aqua_cur(klon)
+    INTEGER  masque_terra_cur(klon)
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_aqua  !mask for 1 day
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_terra !
+    !$OMP THREADPRIVATE(masque_aqua,masque_terra)
+
+    INTEGER, SAVE :: nbreg_dust, nbreg_ind, nbreg_bb, nbreg_ss, nbreg_wstardust
+    !$OMP THREADPRIVATE(nbreg_dust, nbreg_ind, nbreg_bb,nbreg_ss,nbreg_wstardust)
+
+    REAL lmt_dms(klon)           ! emissions de dms
+
+    !JE20150518<<
+    REAL, DIMENSION(klon_glo) :: aod550_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+
+    REAL, DIMENSION(klon_glo) :: aod550_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    !!!!!!!!!!!!!
+    !JE20150518>>
+
+    REAL, INTENT(IN) :: paprs(klon, klev + 1)  ! pression pour chaque inter-couche (en Pa)
+    REAL, INTENT(IN) :: pplay(klon, klev)  ! pression pour le mileu de chaque couche (en Pa)
+    REAL, INTENT(IN) :: RHcl(klon, klev)  ! humidite relativen ciel clair
+    REAL znivsig(klev)  ! indice des couches
+    REAL paire(klon)
+    REAL, INTENT(IN) :: pphis(klon)
+    REAL, INTENT(IN) :: pctsrf(klon, nbsrf)
+    logical, INTENT(IN) :: debutphy   ! le flag de l'initialisation de la physique
+
+    !  Scaling Parameters:
+    !  ----------------------
+
+    CHARACTER*50 c_Directory
+    CHARACTER*80 c_FileName1
+    CHARACTER*80 c_FileName2
+    CHARACTER*130 c_FullName1
+    CHARACTER*130 c_FullName2
+    INTEGER :: xidx, yidx
+    INTEGER, DIMENSION(klon) :: mask_bbreg
+    INTEGER, DIMENSION(klon) :: mask_ffso2reg
+    INTEGER :: aux_mask1
+    INTEGER :: aux_mask2
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_so4 !Defines regions for SO4 ; AS: PAS UTILISE!
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_ind  !Defines regions for SO2, BC & OM
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_bb   !Defines regions for SO2, BC & OM
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_dust !Defines  dust regions
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_wstardust !Defines  dust regions
+    !$OMP THREADPRIVATE(iregion_so4,iregion_ind,iregion_bb,iregion_dust,iregion_wstardust)
+
+    !  Emissions:
+
+    !---------------------------- SEA SALT & DUST emissions ------------------------
+    REAL lmt_sea_salt(klon, ss_bins) !Sea salt 0.03-8.0 um
+    REAL u10m_ec1(klon), v10m_ec1(klon)
+    REAL u10m_ec2(klon), v10m_ec2(klon), dust_ec2(klon)
+    REAL dust_ec(klon)
+    !     new dust emission chimere je20140522
+    REAL, DIMENSION(klon), INTENT(IN) :: zu10m
+    REAL, DIMENSION(klon), INTENT(IN) :: zv10m
+    REAL, DIMENSION(klon), INTENT(IN) :: wstar, ale_bl, ale_wake
+
+    !  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !Dynamique
+    !--------
+    REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: d_tr_dyn
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !  convection:
+    !  -----------
+
+    REAL, INTENT(IN) :: pmfu(klon, klev)  ! flux de masse dans le panache montant
+    REAL, INTENT(IN) :: pmfd(klon, klev)  ! flux de masse dans le panache descendant
+    REAL, INTENT(IN) :: pen_u(klon, klev) ! flux entraine dans le panache montant
+    REAL, INTENT(IN) :: pde_u(klon, klev) ! flux detraine dans le panache montant
+    REAL, INTENT(IN) :: pen_d(klon, klev) ! flux entraine dans le panache descendant
+    REAL, INTENT(IN) :: pde_d(klon, klev) ! flux detraine dans le panache descendant
+
+    !  Convection KE scheme:
+    !  ---------------------
+
+    !! Variables pour le lessivage convectif
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: da
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi2
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: d1a, dam
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: mp
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: upwd      ! saturated
+    !            updraft mass flux
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: dnwd      ! saturated
+    !            downdraft mass flux
+    INTEGER, DIMENSION(klon), INTENT(IN) :: itop_con
+    INTEGER, DIMENSION(klon), INTENT(IN) :: ibas_con
+    REAL, DIMENSION(klon, klev) :: evapls
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainA
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainM
+
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: ep
+    REAL, DIMENSION(klon), INTENT(IN) :: sigd
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: sij
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: clw
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: elij
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: epmlmMm
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: eplaMm
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wght_cvfd          !RL
+
+
+    !     KE: Tendances de traceurs (Td) et flux de traceurs:
+    !     ------------------------
+    REAL, DIMENSION(klon, klev) :: Mint
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfd1a
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfdam
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfphi2
+
+    !                                                        !tra dans pluie LS a la surf.
+    !      outputs for cvltr_spl
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_trsp_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sscav_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sat_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_uscav_o
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_insc_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_bcscav_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_evapls_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_ls_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dyn_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th_o
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+
+    !$OMP THREADPRIVATE(d_tr_cv_o,d_tr_trsp_o,d_tr_sscav_o,d_tr_sat_o,d_tr_uscav_o)
+    !$OMP THREADPRIVATE(d_tr_insc_o,d_tr_bcscav_o,d_tr_evapls_o,d_tr_ls_o)
+    !$OMP THREADPRIVATE(d_tr_dyn_o,d_tr_cl_o,d_tr_th_o)
+
+    INTEGER :: nsplit
+
+    !  Lessivage
+    !  ---------
+
+    REAL, INTENT(IN) :: pmflxr(klon, klev + 1), pmflxs(klon, klev + 1)   !--convection
+    REAL, INTENT(IN) :: prfl(klon, klev + 1), psfl(klon, klev + 1)     !--large-scale
+    REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
+    REAL :: ql_incloud_ref    ! ref value of in-cloud condensed water content
+
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb    ! fraction nuageuse (grande echelle)
+
+    REAL, DIMENSION(klon, klev) :: beta_fisrt ! taux de conversion
+    !                                                          ! de l'eau cond (de fisrtilp)
+    REAL, DIMENSION(klon, klev) :: beta_v1    ! -- (originale version)
+    INTEGER, SAVE :: iflag_lscav_omp, iflag_lscav
+    !$OMP THREADPRIVATE(iflag_lscav_omp,iflag_lscav)
+
+
+
+
+    !Thermiques:
+    !----------
+    REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: fm_therm
+    REAL, DIMENSION(klon, klev), INTENT(INOUT) :: entr_therm
+
+    !  Couche limite:
+    !  --------------
+
+    REAL, INTENT(IN) :: coefh(klon, klev) ! coeff melange CL
+    REAL, INTENT(IN) :: cdragh(klon), cdragm(klon)
+    REAL, INTENT(IN) :: yu1(klon)        ! vent dans la 1iere couche
+    REAL, INTENT(IN) :: yv1(klon)        ! vent dans la 1iere couche
+
+
+    !----------------------------------------------------------------------
+    REAL his_ds(klon, nbtr)
+    REAL his_dh(klon, nbtr)
+    REAL his_dhlsc(klon, nbtr)        ! in-cloud scavenging lsc
+    REAL his_dhcon(klon, nbtr)       ! in-cloud scavenging con
+    REAL his_dhbclsc(klon, nbtr)      ! below-cloud scavenging lsc
+    REAL his_dhbccon(klon, nbtr)      ! below-cloud scavenging con
+    REAL trm(klon, nbtr)
+
+    REAL u10m_ec(klon), v10m_ec(klon)
+
+    REAL his_th(klon, nbtr)
+    REAL his_dhkecv(klon, nbtr)
+    REAL his_dhkelsc(klon, nbtr)
+
+    !  Coordonnees
+    !  -----------
+
+    REAL, INTENT(IN) :: rlat(klon)       ! latitudes pour chaque point
+    REAL, INTENT(IN) :: rlon(klon)       ! longitudes pour chaque point
+
+    INTEGER i, k, iq, itr, j, ig
+
+    ! DEFINITION OF DIAGNOSTIC VARIABLES
+
+    REAL diag_trm(nbtr), diag_drydep(nbtr)
+    REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
+    REAL diag_emissn(nbtr), diag_g2part
+    REAL diag_sedimt
+    REAL trm_aux(nbtr), src_aux(nbtr)
+
+    ! Variables locales pour effectuer les appels en serie
+    !----------------------------------------------------
+    REAL source_tr(klon, nbtr)
+    REAL flux_tr(klon, nbtr)
+    REAL m_conc(klon, klev)
+    REAL henry(nbtr)  !--cste de Henry  mol/l/atm
+    REAL kk(nbtr)     !--coefficient de var avec T (K)
+    REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
+    REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
+    REAL vdep_oce(nbtr), vdep_sic(nbtr)
+    REAL vdep_ter(nbtr), vdep_lic(nbtr)
+    REAL ccntrAA_spla(nbtr)
+    REAL ccntrENV_spla(nbtr)
+    REAL coefcoli_spla(nbtr)
+    REAL dtrconv(klon, nbtr)
+    REAL zrho(klon, klev), zdz(klon, klev)
+    REAL zalt(klon, klev)
+    REAL, DIMENSION(klon, klev) :: zmasse    ! densité atmosphérique
+    !     .                                              Kg/m2
+    REAL, DIMENSION(klon, klev) :: ztra_th
+    REAL qmin, qmax, aux
+    !      PARAMETER (qmin=0.0, qmax=1.e33)
+    PARAMETER (qmin = 1.e33, qmax = -1.e33)
+
+    ! Variables to save data into file
+    !----------------------------------
+
+    CHARACTER*2 str2
+    !!AS:      LOGICAL ok_histrac
+    !!!JE2014124      PARAMETER (ok_histrac=.TRUE.)
+    !!      PARAMETER (ok_histrac=.FALSE.)
+    INTEGER ndex2d(iim * (jjm + 1)), ndex3d(iim * (jjm + 1) * klev)
+    INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
+    INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
+    SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
+    !$OMP THREADPRIVATE(nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5)
+    INTEGER itra
+    SAVE itra                    ! compteur pour la physique
+    !$OMP THREADPRIVATE(itra)
+    INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
+    SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
+    !$OMP THREADPRIVATE(ecrit_tra, ecrit_tra_h, ecrit_tra_m)
+    REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
+    REAL zx_tmp_2d(iim, jjm + 1), zx_tmp_3d(iim, jjm + 1, klev)
+    REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
+    REAL zx_lon_glo(nbp_lon, nbp_lat), zx_lat_glo(nbp_lon, nbp_lat)
+    REAL zsto, zout, zout_h, zout_m, zjulian
+
+    !------Molar Masses
+    REAL masse(nbtr)
+
+    REAL fracso2emis                              !--fraction so2 emis en so2
+    PARAMETER (fracso2emis = 0.95)
+    REAL frach2sofso2                             !--fraction h2s from so2
+    PARAMETER (frach2sofso2 = 0.0426)
+
+    !  Controles
+    !-------------
+    LOGICAL convection, lessivage, lminmax, lcheckmass
+    DATA convection, lessivage, lminmax, lcheckmass &
+            /.TRUE., .TRUE., .TRUE., .FALSE./
+
+    REAL xconv(nbtr)
+
+    LOGICAL anthropo, bateau, edgar
+    DATA anthropo, bateau, edgar/.TRUE., .TRUE., .TRUE./
+
+    !c bc_source
+    INTEGER kminbc, kmaxbc
+    !JE20150715      PARAMETER (kminbc=3, kmaxbc=5)
+    PARAMETER (kminbc = 4, kmaxbc = 7)
+
+    REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
+
+    ! JE for updating in  cltrac
+    REAL, DIMENSION(klon, klev) :: delp     ! epaisseur de couche (Pa)
+    !! JE for INCLUDE gas to particle conversion in output
+    !      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
+    !      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
+
+    INTEGER, INTENT(IN) :: iflag_conv
+    LOGICAL iscm3  ! debug variable. for checkmass ! JE
+
+    !------------------------------------------------------------------------
+    !  only to compute time consumption of each process
+    !----
+    INTEGER clock_start, clock_end, clock_rate, clock_start_spla
+    INTEGER clock_end_outphytracr, clock_start_outphytracr
+    INTEGER ti_init, dife, ti_inittype, ti_inittwrite
+    INTEGER ti_spla, ti_emis, ti_depo, ti_cltr, ti_ther
+    INTEGER ti_sedi, ti_gasp, ti_wetap, ti_cvltr, ti_lscs, ti_brop, ti_outs
+    INTEGER ti_nophytracr, clock_per_max
+    REAL tia_init, tia_inittype, tia_inittwrite
+    REAL tia_spla, tia_emis, tia_depo, tia_cltr, tia_ther
+    REAL tia_sedi, tia_gasp, tia_wetap, tia_cvltr, tia_lscs
+    REAL tia_brop, tia_outs
+    REAL tia_nophytracr
+
+    SAVE tia_init, tia_inittype, tia_inittwrite
+    SAVE tia_spla, tia_emis, tia_depo, tia_cltr, tia_ther
+    SAVE tia_sedi, tia_gasp, tia_wetap, tia_cvltr, tia_lscs
+    SAVE tia_brop, tia_outs
+    SAVE ti_nophytracr
+    SAVE tia_nophytracr
+    SAVE clock_end_outphytracr, clock_start_outphytracr
+    SAVE clock_per_max
+    LOGICAL logitime
+    !$OMP THREADPRIVATE(tia_init,tia_inittype,tia_inittwrite)
+    !$OMP THREADPRIVATE(tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther)
+    !$OMP THREADPRIVATE(tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs)
+    !$OMP THREADPRIVATE(tia_brop,tia_outs)
+    !$OMP THREADPRIVATE(ti_nophytracr)
+    !$OMP THREADPRIVATE(tia_nophytracr)
+    !$OMP THREADPRIVATE(clock_end_outphytracr,clock_start_outphytracr)
+    !$OMP THREADPRIVATE(clock_per_max)
+
+    !     utils parallelization
+    REAL :: auxklon_glo(klon_glo)
+    INTEGER :: iauxklon_glo(klon_glo)
+    REAL, DIMENSION(klon_glo, nbp_lev) :: auxklonnbp_lev
+    REAL, DIMENSION(klon_glo, nbp_lev, nbtr) :: auxklonklevnbtr_glo
+    REAL, DIMENSION(nbp_lon, nbp_lat) :: zx_tmp_2d_glo
+    REAL, DIMENSION(nbp_lon, nbp_lat, nbp_lev) :: zx_tmp_3d_glo
+    REAL, DIMENSION(klon_glo) :: zx_tmp_fi2d_glo
+    REAL, DIMENSION(klon_glo, nbp_lev) :: zx_tmp_fi3d_glo
+    REAL, DIMENSION(klon_glo, nbtr) :: auxklonnbtr_glo
+
+    source_tr = 0.
+
+    IF (debutphy) THEN
+#ifdef IOPHYS_DUST
+         CALL iophys_ini(pdtphys)
+#endif
+      nbreg_ind = 1
+      nbreg_bb = 1
+      nbreg_dust = 1
+      nbreg_wstardust = 1
+      CALL phytracr_spl_ini(klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust)
+    endif
+
+
+#ifdef IOPHYS_DUST
+      itr = 0
+      DO iq = 1, nqtot
+         IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+         itr = itr+1
+         WRITE(str2,'(i2.2)') itrr
+         CALL iophys_ecrit('TRA'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+
+
+
+    ijulday = jD_cur - jD_1jan + 1
+    nbjour = 1
+
+    paramname_ind = 'ind'
+    paramname_bb = 'bb'
+    paramname_ff = 'ind'
+    paramname_dustacc = 'dustacc'
+    paramname_dustcoa = 'dustcoasco'
+    paramname_dustsco = 'dustcoasco'
+    !  paramname_dustacc='dust'
+    !  paramname_dustcoa='dust'
+    !  paramname_dustsco='dust'
+    paramname_wstarBL = 'pwstarbl'
+    paramname_wstarWAKE = 'pwstarwake'
+    paramname_ssacc = 'ssacc'
+    paramname_sscoa = 'sscoa'
+
+    filescaleparams = 'modvalues.nc'
+    !AS: debranchage de lecture des coefs d'assmilation de Jeronimo Escribano
+    IF("ASSIM"=="YES") THEN
+      CALL readscaleparamsnc_spl(scale_param_ind, &
+              nbreg_ind, paramname_ind, &
+              scale_param_ff, nbreg_ind, paramname_ff, &
+              scale_param_bb, nbreg_bb, paramname_bb, &
+              scale_param_dustacc, nbreg_dust, paramname_dustacc, &
+              scale_param_dustcoa, nbreg_dust, paramname_dustcoa, &
+              scale_param_dustsco, nbreg_dust, paramname_dustsco, &
+              param_wstarBLperregion, nbreg_wstardust, paramname_wstarBL, &
+              param_wstarWAKEperregion, nbreg_wstardust, paramname_wstarWAKE, &
+              scale_param_ssacc, paramname_ssacc, &
+              scale_param_sscoa, paramname_sscoa, &
+              filescaleparams, ijulday, jH_cur, pdtphys, debutphy)
+    ENDIF ! ASSIM
+    !AS: le commentaire suivant "add seasalt" ne semble pas avoir ete mis en pratique.
+    ! Des fichiers regions_ssacc et _sscoa existent mais ne semblent pas lus.
+    ! Ca reste donc aux valeurs initialisées: nbreg_ss=1, scale_param_ss*=1, cf fichiers ss et modvalues
+    !! add seasalt
+
+    PRINT *, 'JE : check scale_params'
+
+    PRINT *, 'nbreg_ind', nbreg_ind
+    PRINT *, 'nbreg_dust', nbreg_dust
+    PRINT *, 'nbreg_bb', nbreg_bb
+    PRINT *, 'ind', scale_param_ind
+    PRINT *, 'dustacc', scale_param_dustacc
+    PRINT *, 'dustcoa', scale_param_dustcoa
+    PRINT *, 'dustsco', scale_param_dustsco
+    PRINT *, 'wstardustBL', param_wstarBLperregion
+    PRINT *, 'wstardustWAKE', param_wstarWAKEperregion
+    PRINT *, 'ff', scale_param_ff
+    PRINT *, 'bb', scale_param_bb
+    PRINT *, 'ssacc', scale_param_ssacc
+    PRINT *, 'sscoa', scale_param_sscoa
+
+    PRINT *, 'JE: before read_newemissions '
+    PRINT *, 'JE: jD_cur:', jD_cur, ' ijulday:', ijulday, ' jH_cur:', jH_cur, ' pdtphys:', pdtphys
+    PRINT *, 'JE: now read_newemissions:'
+    !AS: La ligne suivante fait planter a l'execution : lmt_so2ff_l pas initialise
+    !  PRINT *,'lmt_so2ff_l AVANT' , MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
+    CALL read_newemissions(ijulday, jH_cur, edgar, flag_dms, debutphy, & !I
+            pdtphys, lafin, nbjour, pctsrf, &       !I
+            t_seri, rlat, rlon, &                         !I
+            pmflxr, pmflxs, prfl, psfl, &            !I
+            u10m_ec, v10m_ec, dust_ec, &     !O
+            lmt_sea_salt, lmt_so2ff_l, &     !O
+            lmt_so2ff_h, lmt_so2nff, &       !O
+            lmt_so2ba, lmt_so2bb_l, lmt_so2bb_h, &  !O
+            lmt_so2volc_cont, lmt_altvolc_cont, &   !O
+            lmt_so2volc_expl, lmt_altvolc_expl, &   !O
+            lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &  !O
+            lmt_bcff, lmt_bcnff, lmt_bcbb_l, &      !O
+            lmt_bcbb_h, lmt_bcba, lmt_omff, &       !O
+            lmt_omnff, lmt_ombb_l, lmt_ombb_h, &    !O
+            lmt_omnat, lmt_omba)                    !O
+
+    PRINT *, 'Check emissions'
+    PRINT *, 'lmt_so2ff_l', MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
+    PRINT *, 'lmt_so2ff_h', MINVAL(lmt_so2ff_h), MAXVAL(lmt_so2ff_h)
+    PRINT *, 'lmt_so2nff', MINVAL(lmt_so2nff), MAXVAL(lmt_so2nff)
+    PRINT *, 'lmt_so2ba', MINVAL(lmt_so2ba), MAXVAL(lmt_so2ba)
+    PRINT *, 'lmt_so2bb_l', MINVAL(lmt_so2bb_l), MAXVAL(lmt_so2bb_l)
+    PRINT *, 'lmt_so2bb_h', MINVAL(lmt_so2bb_h), MAXVAL(lmt_so2bb_h)
+    PRINT *, 'lmt_so2volc_cont', MINVAL(lmt_so2volc_cont), MAXVAL(lmt_so2volc_cont)
+    PRINT *, 'lmt_altvolc_cont', MINVAL(lmt_altvolc_cont), MAXVAL(lmt_altvolc_cont)
+    PRINT *, 'lmt_so2volc_expl', MINVAL(lmt_so2volc_expl), MAXVAL(lmt_so2volc_expl)
+    PRINT *, 'lmt_altvolc_expl', MINVAL(lmt_altvolc_expl), MAXVAL(lmt_altvolc_expl)
+    PRINT *, 'lmt_dmsbio', MINVAL(lmt_dmsbio), MAXVAL(lmt_dmsbio)
+    PRINT *, 'lmt_h2sbio', MINVAL(lmt_h2sbio), MAXVAL(lmt_h2sbio)
+    PRINT *, 'lmt_dmsconc', MINVAL(lmt_dmsconc), MAXVAL(lmt_dmsconc)
+    PRINT *, 'lmt_bcff', MINVAL(lmt_bcff), MAXVAL(lmt_bcff)
+    PRINT *, 'lmt_bcnff', MINVAL(lmt_bcnff), MAXVAL(lmt_bcnff)
+    PRINT *, 'lmt_bcbb_l', MINVAL(lmt_bcbb_l), MAXVAL(lmt_bcbb_l)
+    PRINT *, 'lmt_bcbb_h', MINVAL(lmt_bcbb_h), MAXVAL(lmt_bcbb_h)
+    PRINT *, 'lmt_bcba', MINVAL(lmt_bcba), MAXVAL(lmt_bcba)
+    PRINT *, 'lmt_omff', MINVAL(lmt_omff), MAXVAL(lmt_omff)
+    PRINT *, 'lmt_omnff', MINVAL(lmt_omnff), MAXVAL(lmt_omnff)
+    PRINT *, 'lmt_ombb_l', MINVAL(lmt_ombb_l), MAXVAL(lmt_ombb_l)
+    PRINT *, 'lmt_ombb_h', MINVAL(lmt_ombb_h), MAXVAL(lmt_ombb_h)
+    PRINT *, 'lmt_omnat', MINVAL(lmt_omnat), MAXVAL(lmt_omnat)
+    PRINT *, 'lmt_omba', MINVAL(lmt_omba), MAXVAL(lmt_omba)
+    PRINT *, 'JE iflag_con', iflag_conv
+
+
+    !JE_dbg
+    DO i = 1, klon
+      tsol(i) = 0.0
+      DO j = 1, nbsrf
+        tsol(i) = tsol(i) + ftsol(i, j) * pctsrf(i, j)
+      enddo
+    enddo
+
+
+    !======================================================================
+    !  INITIALISATIONS
+    !======================================================================
+    !             CALL checknanqfi(da(:,:),1.,-1.,' da_ before
+    !     . phytracr_inphytracr')
+
+    ! computing time
+    !        logitime=.TRUE.
+    logitime = .FALSE.
+    IF (logitime) THEN
+      clock_start = 0
+      clock_end = 0
+      clock_rate = 0
+      CALL SYSTEM_CLOCK(COUNT_RATE = clock_rate, COUNT_MAX = clock_per_max)
+      CALL SYSTEM_CLOCK(COUNT = clock_start_spla)
+      clock_start = clock_start_spla
+      clock_end_outphytracr = clock_start_spla
+    ENDIF
+
+
+    ! Definition of tracers index.
+    PRINT*, 'OK ON PASSSE BIEN LA'
+    CALL minmaxsource(source_tr, qmin, qmax, 'A1 maxsource init phytracr')
+
+    IF (debutphy) THEN
+      id_prec = -1
+      id_fine = -1
+      id_coss = -1
+      id_codu = -1
+      id_scdu = -1
+      itr = 0
+      DO iq = 1, nqtot
+        IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+        itr = itr + 1
+        PRINT *, itr, TRIM(tracers(iq)%name)
+        SELECT CASE(tracers(iq)%name)
+        CASE('PREC'); id_prec = itr
+        CASE('FINE'); id_fine = itr
+        CASE('COSS'); id_coss = itr
+        CASE('CODU'); id_codu = itr
+        CASE('SCDU'); id_scdu = itr
+        END SELECT
+      enddo
+      ! check consistency with dust emission scheme:
+      IF (ok_chimeredust) THEN
+        IF (.NOT.(id_scdu>0 .AND. id_codu>0 .AND. id_fine>0)) THEN
+          CALL abort_gcm('phytracr_mod', 'pb in ok_chimdust 0', 1)
+        endif
+      else
+        IF (id_scdu>0) THEN
+          CALL abort_gcm('phytracr_mod', 'pb in ok_chimdust 1 SCDU', 1)
+        endif
+        IF ((id_codu <= 0) .OR. (id_fine<=0)) THEN
+          CALL abort_gcm('phytracr_mod', 'pb in ok_chimdust 1', 1)
+        endif
+      endif
+
+
+      !PRINT *,id_prec,id_fine,id_coss,id_codu,id_scdu
+    ENDIF
+
+
+
+
+
+
+    !---fraction of tracer that is convected (Tiedke)
+    xconv(:) = 0.
+    IF(id_prec>0)  xconv(id_prec) = 0.8
+    IF(id_fine>0)  xconv(id_fine) = 0.5
+    IF(id_coss>0)  xconv(id_coss) = 0.5
+    IF(id_codu>0)  xconv(id_codu) = 0.6
+    IF(id_scdu>0)  xconv(id_scdu) = 0.6  !!JE fix
+
+    masse(:) = 1.
+    IF(id_prec>0)  masse(id_prec) = 32.
+    IF(id_fine>0)  masse(id_fine) = 6.02e23
+    IF(id_coss>0)  masse(id_coss) = 6.02e23
+    IF(id_codu>0)  masse(id_codu) = 6.02e23
+    IF(id_scdu>0)  masse(id_scdu) = 6.02e23
+
+    henry(:) = 0.
+    IF(id_prec>0)  henry(id_prec) = 1.4
+    IF(id_fine>0)  henry(id_fine) = 0.0
+    IF(id_coss>0)  henry(id_coss) = 0.0
+    IF(id_codu>0)  henry(id_codu) = 0.0
+    IF(id_scdu>0)  henry(id_scdu) = 0.0
+    !henry= (/1.4, 0.0, 0.0, 0.0/)
+    kk(:) = 0.
+    IF(id_prec>0)  kk(id_prec) = 2900.
+    IF(id_fine>0)  kk(id_fine) = 0.0
+    IF(id_coss>0)  kk(id_coss) = 0.0
+    IF(id_codu>0)  kk(id_codu) = 0.0
+    IF(id_scdu>0)  kk(id_scdu) = 0.0
+    !kk = (/2900., 0., 0., 0./)
+    alpha_r(:) = 0.
+    IF(id_prec>0)  alpha_r(id_prec) = 0.0
+    IF(id_fine>0)  alpha_r(id_fine) = 0.001
+    IF(id_coss>0)  alpha_r(id_coss) = 0.001
+    IF(id_codu>0)  alpha_r(id_codu) = 0.001
+    IF(id_scdu>0)  alpha_r(id_scdu) = 0.001  !JE fix
+    alpha_s(:) = 0.
+    IF(id_prec>0)  alpha_s(id_prec) = 0.0
+    IF(id_fine>0)  alpha_s(id_fine) = 0.01
+    IF(id_coss>0)  alpha_s(id_coss) = 0.01
+    IF(id_codu>0)  alpha_s(id_codu) = 0.01
+    IF(id_scdu>0)  alpha_s(id_scdu) = 0.01  !JE fix
+
+    !      alpha_r =  (/0., 0.001, 0.001, 0.001/)
+    !      alpha_s = (/0., 0.01, 0.01, 0.01/)
+
+    ! nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
+    ! nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
+    !vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
+    vdep_oce(:) = 0.
+    IF(id_prec>0)  vdep_oce(id_prec) = 0.28
+    IF(id_fine>0)  vdep_oce(id_fine) = 0.28
+    IF(id_coss>0)  vdep_oce(id_coss) = 1.2
+    IF(id_codu>0)  vdep_oce(id_codu) = 1.2
+    IF(id_scdu>0)  vdep_oce(id_scdu) = 1.2
+    vdep_sic(:) = 0.
+    IF(id_prec>0)  vdep_sic(id_prec) = 0.2
+    IF(id_fine>0)  vdep_sic(id_fine) = 0.17
+    IF(id_coss>0)  vdep_sic(id_coss) = 1.2
+    IF(id_codu>0)  vdep_sic(id_codu) = 1.2
+    IF(id_scdu>0)  vdep_sic(id_scdu) = 1.2
+
+    !vdep_sic = (/0.2, 0.17, 1.2, 1.2/)
+    !vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
+    vdep_ter(:) = 0.
+    IF(id_prec>0)  vdep_ter(id_prec) = 0.3
+    IF(id_fine>0)  vdep_ter(id_fine) = 0.14
+    IF(id_coss>0)  vdep_ter(id_coss) = 1.2
+    IF(id_codu>0)  vdep_ter(id_codu) = 1.2
+    IF(id_scdu>0)  vdep_ter(id_scdu) = 1.2
+
+    vdep_lic(:) = 0.
+    IF(id_prec>0)  vdep_lic(id_prec) = 0.2
+    IF(id_fine>0)  vdep_lic(id_fine) = 0.17
+    IF(id_coss>0)  vdep_lic(id_coss) = 1.2
+    IF(id_codu>0)  vdep_lic(id_codu) = 1.2
+    IF(id_scdu>0)  vdep_lic(id_scdu) = 1.2
+
+
+    ! convective KE lessivage aer params:
+    ! AS: #DFB (Binta) a aussi teste ccntrAA_spla=ccntrENV_spla=0.9/1.0/0.9/0.9
+    !     mais effet negligeable sur l'AOD
+    ccntrAA_spla(:) = 0.
+    IF(id_prec>0)  ccntrAA_spla(id_prec) = -9999.
+    IF(id_fine>0)  ccntrAA_spla(id_fine) = 0.7
+    IF(id_coss>0)  ccntrAA_spla(id_coss) = 1.0
+    IF(id_codu>0)  ccntrAA_spla(id_codu) = 0.7
+    IF(id_scdu>0)  ccntrAA_spla(id_scdu) = 0.7
+
+    ccntrENV_spla(:) = 0.
+    IF(id_prec>0)  ccntrENV_spla(id_prec) = -9999.
+    IF(id_fine>0)  ccntrENV_spla(id_fine) = 0.7
+    IF(id_coss>0)  ccntrENV_spla(id_coss) = 1.0
+    IF(id_codu>0)  ccntrENV_spla(id_codu) = 0.7
+    IF(id_scdu>0)  ccntrENV_spla(id_scdu) = 0.7
+    ! #DFB
+    coefcoli_spla(:) = 0.
+    IF(id_prec>0)  coefcoli_spla(id_prec) = -9999.
+    IF(id_fine>0)  coefcoli_spla(id_fine) = 0.001
+    IF(id_coss>0)  coefcoli_spla(id_coss) = 0.001
+    IF(id_codu>0)  coefcoli_spla(id_codu) = 0.001
+    IF(id_scdu>0)  coefcoli_spla(id_scdu) = 0.001
+
+    !vdep_lic = (/0.2, 0.17, 1.2, 1.2/)
+
+    iscm3 = .FALSE.
+    IF (debutphy) THEN
+      !$OMP MASTER
+      CALL suphel
+      PRINT *, 'let s check nbtr=', nbtr
+      ! JE before put in zero
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan init phytracr')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'minmax init phytracr')
+        ENDDO
+        CALL minmaxsource(source_tr, qmin, qmax, 'maxsource init phytracr')
+      ENDIF
+      ! JE   initializon to cero the tracers
+      !         DO itr=1,nbtr
+      !            tr_seri(:,:,itr)=0.0
+      !         ENDDO
+      ! JE end
+      ! Initializing to zero tr_seri for comparison purposes
+      !        tr_seri(:,:,:)=0.0
+
+      !        DO itr=1,nbtr
+      !           trm_aux(itr)=0.0
+      !           src_aux(itr)=0.0
+      !           diag_trm(itr)=0.0
+      !           diag_drydep(itr)=0.0
+      !           diag_wetdep(itr)=0.0
+      !           diag_cvtdep(itr)=0.0
+      !           diag_emissn(itr)=0.0
+      !        ENDDO
+      !        diag_g2part=0.0
+      PRINT *, 'PREPARE FILES TO SAVE VARIABLES'
+
+      nbjour = 30
+      ecrit_tra = NINT(86400. / pdtphys)                    !--1-day  average
+      ecrit_tra_h = NINT(86400. / pdtphys * 0.25)               !--6-hour average
+      ecrit_tra_m = NINT(86400. / pdtphys * FLOAT(nbjour))      !--1-mth  average
+      PRINT *, 'ecrit_tra=', pdtphys, ecrit_tra
+
+      !!AS deleting lines
+      !!         IF (ok_histrac) THEN
+      !!           IF (is_mpi_root .AND. is_omp_root) THEN
+      !!-----many deleted lines----
+      !!!       nbjour=1
+      !!         ENDIF ! mpi root
+      !!         ENDIF !--ok_histrac
+
+      !$OMP END MASTER
+      !$OMP BARRIER
+    endif ! debutphy
+
+    !======================================================================
+    ! Initialisations
+    !======================================================================
+
+
+    ! je  KE init
+    IF (debutphy) THEN
+      !$OMP MASTER
+
+      ALLOCATE(d_tr_dry(klon, nbtr))
+      ALLOCATE(flux_tr_dry(klon, nbtr), d_tr_dec(klon, klev, nbtr))
+      ALLOCATE(qPrls(klon, nbtr), qPr(klon, klev, nbtr))
+      ALLOCATE(qDi(klon, klev, nbtr))
+      ALLOCATE(qPa(klon, klev, nbtr), qMel(klon, klev, nbtr))
+      ALLOCATE(qTrdi(klon, klev, nbtr), dtrcvMA(klon, klev, nbtr))
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ALLOCATE(d_tr_cv_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_trsp_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_sscav_o(klon, klev, nbtr), &
+              d_tr_sat_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_uscav_o(klon, klev, nbtr))
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ALLOCATE(d_tr_insc_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_bcscav_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_evapls_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_ls_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_dyn_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_cl_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_th_o(klon, klev, nbtr))
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ALLOCATE(iregion_so4(klon))
+      ALLOCATE(iregion_bb(klon))
+      ALLOCATE(iregion_ind(klon))
+      ALLOCATE(iregion_dust(klon))
+      ALLOCATE(iregion_wstardust(klon))
+
+      !JE20150518<<
+      ALLOCATE(masque_aqua(klon))
+      ALLOCATE(masque_terra(klon))
+
+      masque_aqua(:) = 0
+      masque_terra(:) = 0
+
+      aod550_terra(:) = 0.
+      aod550_tr2_terra(:) = 0.
+      aod550_ss_terra(:) = 0.
+      aod550_dust_terra(:) = 0.
+      aod550_dustsco_terra(:) = 0.
+      aod670_terra(:) = 0.
+      aod670_tr2_terra(:) = 0.
+      aod670_ss_terra(:) = 0.
+      aod670_dust_terra(:) = 0.
+      aod670_dustsco_terra(:) = 0.
+      aod865_terra(:) = 0.
+      aod865_tr2_terra(:) = 0.
+      aod865_ss_terra(:) = 0.
+      aod865_dust_terra(:) = 0.
+      aod865_dustsco_terra(:) = 0.
+      aod550_aqua(:) = 0.
+      aod550_tr2_aqua(:) = 0.
+      aod550_ss_aqua(:) = 0.
+      aod550_dust_aqua(:) = 0.
+      aod550_dustsco_aqua(:) = 0.
+      aod670_aqua(:) = 0.
+      aod670_tr2_aqua(:) = 0.
+      aod670_ss_aqua(:) = 0.
+      aod670_dust_aqua(:) = 0.
+      aod670_dustsco_aqua(:) = 0.
+      aod865_aqua(:) = 0.
+      aod865_tr2_aqua(:) = 0.
+      aod865_ss_aqua(:) = 0.
+      aod865_dust_aqua(:) = 0.
+      aod865_dustsco_aqua(:) = 0.
+      !JE20150518>>
+
+      !Config Key  = iflag_lscav
+      !Config Desc = Large scale scavenging parametrization: 0=none,
+      !1=old(Genthon92),
+      !              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
+      !Config Def  = 4
+      !Config
+      iflag_lscav_omp = 4
+      CALL getin('iflag_lscav', iflag_lscav_omp)
+      iflag_lscav = iflag_lscav_omp
+      ! initialiation for time computation
+
+      tia_spla = 0.
+      tia_emis = 0.
+      tia_depo = 0.
+      tia_cltr = 0.
+      tia_ther = 0.
+      tia_sedi = 0.
+      tia_gasp = 0.
+      tia_wetap = 0.
+      tia_cvltr = 0.
+      tia_lscs = 0.
+      tia_brop = 0.
+      tia_outs = 0.
+      tia_nophytracr = 0.
+      clock_start_outphytracr = clock_end_outphytracr + 1
+      !$OMP END MASTER
+      !$OMP BARRIER
+    ENDIF ! debutphy
+
+    lmt_dms(:) = 0.0
+    aux_var2(:) = 0.0
+    aux_var3(:, :) = 0.0
+    source_tr(:, :) = 0.0
+    flux_tr(:, :) = 0.0
+    flux_sparam_bb(:) = 0.0
+    flux_sparam_ff(:) = 0.0
+    flux_sparam_ind(:) = 0.0
+    flux_sparam_ddfine(:) = 0.0
+    flux_sparam_ddcoa(:) = 0.0
+    flux_sparam_ddsco(:) = 0.0
+    flux_sparam_ssfine(:) = 0.0
+    flux_sparam_sscoa(:) = 0.0
+
+    ! initialiation for time computation
+
+    ti_spla = 0
+    ti_emis = 0
+    ti_depo = 0
+    ti_cltr = 0
+    ti_ther = 0
+    ti_sedi = 0
+    ti_gasp = 0
+    ti_wetap = 0
+    ti_cvltr = 0
+    ti_lscs = 0
+    ti_brop = 0
+    ti_outs = 0
+
+    DO k = 1, klev
+      DO i = 1, klon
+        Mint(i, k) = 0.
+      END DO
+    END DO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_cv(i, k, itr) = 0.
+          d_tr_trsp(i, k, itr) = 0.
+          d_tr_sscav(i, k, itr) = 0.
+          d_tr_sat(i, k, itr) = 0.
+          d_tr_uscav(i, k, itr) = 0.
+          d_tr(i, k, itr) = 0.
+          d_tr_insc(i, k, itr) = 0.
+          d_tr_bcscav(i, k, itr) = 0.
+          d_tr_evapls(i, k, itr) = 0.
+          d_tr_ls(i, k, itr) = 0.
+          d_tr_cl(i, k, itr) = 0.
+          d_tr_th(i, k, itr) = 0.
+
+          d_tr_cv_o(i, k, itr) = 0.
+          d_tr_trsp_o(i, k, itr) = 0.
+          d_tr_sscav_o(i, k, itr) = 0.
+          d_tr_sat_o(i, k, itr) = 0.
+          d_tr_uscav_o(i, k, itr) = 0.
+
+          qDi(i, k, itr) = 0.
+          qPr(i, k, itr) = 0.
+          qPa(i, k, itr) = 0.
+          qMel(i, k, itr) = 0.
+          qTrdi(i, k, itr) = 0.
+          dtrcvMA(i, k, itr) = 0.
+          zmfd1a(i, k, itr) = 0.
+          zmfdam(i, k, itr) = 0.
+          zmfphi2(i, k, itr) = 0.
+        END DO
+      END DO
+    END DO
+
+    DO itr = 1, nbtr
+      DO i = 1, klon
+        qPrls(i, itr) = 0.0
+        dtrconv(i, itr) = 0.0
+        !JE20140507<<
+        d_tr_dry(i, itr) = 0.0
+        flux_tr_dry(i, itr) = 0.0
+        !JE20140507>>
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO i = 1, klon
+        his_dh(i, itr) = 0.0
+        his_dhlsc(i, itr) = 0.0
+        his_dhcon(i, itr) = 0.0
+        his_dhbclsc(i, itr) = 0.0
+        his_dhbccon(i, itr) = 0.0
+        trm(i, itr) = 0.0
+        his_th(i, itr) = 0.0
+        his_dhkecv(i, itr) = 0.0
+        his_ds(i, itr) = 0.0
+        his_dhkelsc(i, itr) = 0.0
+
+      ENDDO
+    ENDDO
+    !JE:
+    DO i = 1, klon
+      his_g2pgas(i) = 0.0
+      his_g2paer(i) = 0.0
+    ENDDO
+    ! endJE
+
+    DO k = 1, klev
+      DO i = 1, klon
+        zrho(i, k) = pplay(i, k) / t_seri(i, k) / RD
+        zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG
+        zmasse(i, k) = (paprs(i, k) - paprs(i, k + 1)) / RG
+      ENDDO
+    ENDDO
+
+    DO i = 1, klon
+      zalt(i, 1) = pphis(i) / RG
+    ENDDO
+    DO k = 1, klev - 1
+      DO i = 1, klon
+        zalt(i, k + 1) = zalt(i, k) + zdz(i, k)
+      ENDDO
+    ENDDO
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_init = dife * MAX(0, SIGN(1, dife)) &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_init = tia_init + REAL(ti_init) / REAL(clock_rate)
+    ENDIF
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    IF (debutphy) THEN
+      ! AS: initialisation des indices par point de grille physique iregion_*
+      ! (variables tenant de l'assimilation, a eliminer dans un 2eme temps)
+      iregion_dust(:) = 1
+      iregion_ind(:) = 1
+      iregion_bb(:) = 1
+      iregion_wstardust(:) = 1
+
+      !AS: lecture des indices dans fichiers "regions_*" eliminee par IF("ASSIM"="YES") (faux donc)
+      IF("ASSIM"=="YES") THEN
+        c_FullName1 = 'regions_dustacc'
+        !c_FullName1='regions_dust'
+        CALL readregions_spl(iregion_dust, c_FullName1)
+        c_FullName1 = 'regions_ind'
+        CALL readregions_spl(iregion_ind, c_FullName1)
+        c_FullName1 = 'regions_bb'
+        CALL readregions_spl(iregion_bb, c_FullName1)
+        c_FullName1 = 'regions_pwstarwake'
+        CALL readregions_spl(iregion_wstardust, c_FullName1)
+
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+
+          OPEN(25, FILE = 'dustregions_pyvar_je.data')
+          OPEN(55, FILE = 'indregions_pyvar_je.data')
+          OPEN(75, FILE = 'bbregions_pyvar_je.data')
+          OPEN(95, FILE = 'wstardustregions_pyvar_je.data')
+          OPEN(76, FILE = 'xlat.data')
+          OPEN(77, FILE = 'xlon.data')
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+
+        CALL gather(iregion_dust, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(25, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(iregion_ind, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(55, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(iregion_bb, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(75, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(iregion_wstardust, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(95, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+
+        CALL gather(rlat, auxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(76, *) auxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(rlon, auxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(77, *) auxklon_glo(k)
+          ENDDO
+
+          CLOSE(25)
+          CLOSE(55)
+          CLOSE(75)
+          CLOSE(76)
+          CLOSE(77)
+          CLOSE(95)
+
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+
+      ENDIF  ! ASSIM
+
+    ENDIF  ! debutphy
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_inittype = dife * MAX(0, SIGN(1, dife)) &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_inittype = tia_inittype + REAL(ti_inittype) / REAL(clock_rate)
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    !=======================================================================
+    ! SAVING SURFACE TYPE
+    !=======================================================================
+    IF (debutphy) THEN
+      !$OMP MASTER
+      IF (is_mpi_root .AND. is_omp_root) THEN
+
+        OPEN(35, FILE = 'surface_ocean.data')
+        OPEN(45, FILE = 'surface_seaice.data')
+        OPEN(65, FILE = 'surface_land.data')
+        OPEN(85, FILE = 'surface_landice.data')
+      ENDIF ! mpi root
+      !$OMP END MASTER
+      !$OMP BARRIER
+      DO i = 1, klon
+        aux_var2(i) = pctsrf(i, is_oce)
+      enddo
+      CALL gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
+      IF (is_mpi_root .AND. is_omp_root) THEN
+        DO i = 1, klon_glo
+          WRITE (35, 103)  auxklon_glo(i)
+        ENDDO
+      ENDIF ! mpi root
+      !$OMP END MASTER
+      !$OMP BARRIER
+
+      DO i = 1, klon
+        aux_var2(i) = pctsrf(i, is_sic)
+      enddo
+      CALL gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
+      IF (is_mpi_root .AND. is_omp_root) THEN
+        DO i = 1, klon_glo
+          WRITE (45, 103)  auxklon_glo(i)
+        ENDDO
+      ENDIF ! mpi root
+      !$OMP END MASTER
+      !$OMP BARRIER
+
+      DO i = 1, klon
+        aux_var2(i) = pctsrf(i, is_ter)
+      enddo
+      CALL gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
+      IF (is_mpi_root .AND. is_omp_root) THEN
+        DO i = 1, klon_glo
+          WRITE (65, 103)  auxklon_glo(i)
+        ENDDO
+      ENDIF ! mpi root
+      !$OMP END MASTER
+      !$OMP BARRIER
+
+      DO i = 1, klon
+        aux_var2(i) = pctsrf(i, is_lic)
+      enddo
+      CALL gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
+      IF (is_mpi_root .AND. is_omp_root) THEN
+        DO i = 1, klon_glo
+          WRITE (85, 103)  auxklon_glo(i)
+        ENDDO
+
+        !      DO i = 1, klon
+        !         WRITE (35,103) pctsrf(i,is_oce)
+        !         WRITE (45,103) pctsrf(i,is_sic)
+        !         WRITE (65,103) pctsrf(i,is_ter)
+        !         WRITE (85,103) pctsrf(i,is_lic)
+        !      ENDDO
+        CLOSE(35)
+        CLOSE(45)
+        CLOSE(65)
+        CLOSE(85)
+        103   FORMAT (f6.2)
+      ENDIF ! mpi root
+      !$OMP END MASTER
+      !$OMP BARRIER
+    ENDIF ! debutphy
+
+    !      stop
+
+    !=======================================================================
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .TRUE.
+
+    !=======================================================================
+
+    DO k = 1, klev
+      DO i = 1, klon
+        m_conc(i, k) = pplay(i, k) / t_seri(i, k) / RKBOL * 1.e-6
+      ENDDO
+    ENDDO
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_avt_coarem')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'avt coarem')
+      ENDDO
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: avt coarem')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_inittwrite = dife * MAX(0, SIGN(1, dife))  &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_inittwrite = tia_inittwrite + REAL(ti_inittwrite) / REAL(clock_rate)
+    ENDIF
+
+
+    !=======================================================================
+    !                     EMISSIONS OF COARSE AEROSOLS
+    !=======================================================================
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    PRINT *, 'Number of tracers = ', nbtr
+
+    PRINT *, 'AT BEGINNING OF PHYTRACR_SPL'
+    !      PRINT *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
+    !     .                                         MAXVAL(tr_seri(:,:,3))
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('sav'//str2,1,'SOURCE','',source_tr(:,itr))
+         CALL iophys_ecrit('fav'//str2,1,'SOURCE','',source_tr(:,itr))
+      enddo
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRB'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+
+    CALL coarsemission(pctsrf, pdtphys, t_seri, &
+            pmflxr, pmflxs, prfl, psfl, &
+            rlat, rlon, debutphy, &
+            zu10m, zv10m, wstar, ale_bl, ale_wake, &
+            scale_param_ssacc, scale_param_sscoa, &
+            scale_param_dustacc, scale_param_dustcoa, &
+            scale_param_dustsco, &
+            nbreg_dust, &
+            iregion_dust, dust_ec, &
+            param_wstarBLperregion, param_wstarWAKEperregion, &
+            nbreg_wstardust, &
+            iregion_wstardust, &
+            lmt_sea_salt, qmin, qmax, &
+            flux_sparam_ddfine, flux_sparam_ddcoa, &
+            flux_sparam_ddsco, &
+            flux_sparam_ssfine, flux_sparam_sscoa, &
+            id_prec, id_fine, id_coss, id_codu, id_scdu, &
+            ok_chimeredust, &
+            source_tr, flux_tr)
+
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('sap'//str2,1,'SOURCE','',source_tr(:,itr))
+         CALL iophys_ecrit('fap'//str2,1,'SOURCE','',source_tr(:,itr))
+      enddo
+#endif
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_coarem')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after coarem')
+      ENDDO
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after coarem')
+    ENDIF
+
+
+
+    !======================================================================
+    !                   EMISSIONS OF AEROSOL PRECURSORS
+    !======================================================================
+
+#ifdef IOPHYS_DUST
+      PRINT *,'INPUT TO PRECUREMISSION'
+         CALL iophys_ecrit('ftsol',4,'ftsol','',ftsol)
+         CALL iophys_ecrit('u10m_ec',1,'u10m_ec','',u10m_ec)
+         CALL iophys_ecrit('v10m_ec',1,'v10m_ec','',v10m_ec)
+         CALL iophys_ecrit('pctsrf',4,'pctsrf','',pctsrf)
+         CALL iophys_ecrit('u_seri',klev,'u_seri','',u_seri)
+         CALL iophys_ecrit('v_seri',klev,'v_seri','',v_seri)
+         CALL iophys_ecrit('paprs',klev,'paprs','',paprs)
+         CALL iophys_ecrit('pplay',klev,'pplay','',pplay)
+         CALL iophys_ecrit('cdragh',1,'cdragh','',cdragh)
+         CALL iophys_ecrit('cdragm',1,'cdragm','',cdragm)
+         CALL iophys_ecrit('t_seri',klev,'t_seri','',t_seri)
+         CALL iophys_ecrit('q_seri',klev,'q_seri','',q_seri)
+         CALL iophys_ecrit('tsol',1,'tsol','',tsol)
+         PRINT*,'fracso2emis,frach2sofso2,bateau',fracso2emis,frach2sofso2,bateau
+         PRINT*,'kminbc,kmaxbc,pdtphys',kminbc,kmaxbc,pdtphys
+         PRINT*,'scale_param_bb,scale_param_ind',scale_param_bb,scale_param_ind
+         PRINT*,'iregion_ind,iregion_bb,nbreg_ind, nbreg_bb',iregion_ind,iregion_bb,nbreg_ind, nbreg_bb
+         PRINT*,'id_prec,id_fine',id_prec,id_fine
+         CALL iophys_ecrit('zdz',klev,'zdz','',zdz)
+         CALL iophys_ecrit('zalt',klev,'zalt','',zalt)
+         CALL iophys_ecrit('lmt_so2ff_l',1,'lmt_so2ff_l','',lmt_so2ff_l)
+         CALL iophys_ecrit('lmt_so2ff_h',1,'lmt_so2ff_h','',lmt_so2ff_h)
+         CALL iophys_ecrit('lmt_so2nff',1,'lmt_so2nff','',lmt_so2nff)
+         CALL iophys_ecrit('lmt_so2ba',1,'lmt_so2ba','',lmt_so2ba)
+         CALL iophys_ecrit('lmt_so2bb_l',1,'lmt_so2bb_l','',lmt_so2bb_l)
+         CALL iophys_ecrit('lmt_so2bb_h',1,'lmt_so2bb_h','',lmt_so2bb_h)
+         CALL iophys_ecrit('lmt_so2volc_cont',1,'lmt_so2volc_cont','',lmt_so2volc_cont)
+         CALL iophys_ecrit('lmt_altvolc_cont',1,'lmt_altvolc_cont','',lmt_altvolc_cont)
+         CALL iophys_ecrit('lmt_so2volc_expl',1,'lmt_so2volc_expl','',lmt_so2volc_expl)
+         CALL iophys_ecrit('lmt_altvolc_expl',1,'lmt_altvolc_expl','',lmt_altvolc_expl)
+         CALL iophys_ecrit('lmt_dmsbio',1,'lmt_dmsbio','',lmt_dmsbio)
+         CALL iophys_ecrit('lmt_h2sbio',1,'lmt_h2sbio','',lmt_h2sbio)
+         CALL iophys_ecrit('lmt_dmsconc',1,'lmt_dmsconc','',lmt_dmsconc)
+         CALL iophys_ecrit('lmt_dms',1,'lmt_dms','',lmt_dms)
+         CALL iophys_ecrit('flux_sparam_ind',1,'flux_sparam_ind','',flux_sparam_ind)
+         CALL iophys_ecrit('flux_sparam_bb',1,'flux_sparam_bb','',flux_sparam_bb)
+#endif
+
+
+
+    PRINT*, 'ON PASSE DANS precuremission'
+    CALL precuremission(ftsol, u10m_ec, v10m_ec, pctsrf, &
+            u_seri, v_seri, paprs, pplay, cdragh, cdragm, &
+            t_seri, q_seri, tsol, fracso2emis, frach2sofso2, &
+            bateau, zdz, zalt, kminbc, kmaxbc, pdtphys, &
+            scale_param_bb, scale_param_ind, &
+            iregion_ind, iregion_bb, &
+            nbreg_ind, nbreg_bb, &
+            lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, lmt_so2ba, &
+            lmt_so2bb_l, lmt_so2bb_h, &
+            lmt_so2volc_cont, lmt_altvolc_cont, &
+            lmt_so2volc_expl, lmt_altvolc_expl, &
+            lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, lmt_dms, &
+            id_prec, id_fine, &
+            flux_sparam_ind, flux_sparam_bb, &
+            source_tr, flux_tr, tr_seri)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after precur')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after precur')
+      ENDDO
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after precur')
+    ENDIF
+
+    !=======================================================================
+    !                      EMISSIONS OF FINE AEROSOLS
+    !=======================================================================
+#ifdef IOPHYS_DUST
+
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('tpr'//str2,1,'SOURCE','',source_tr(:,itr))
+         CALL iophys_ecrit('fpr'//str2,1,'SOURCE','',flux_tr(:,itr))
+      enddo
+#endif
+
+    CALL finemission(zdz, pdtphys, zalt, kminbc, kmaxbc, &
+            scale_param_bb, scale_param_ff, &
+            iregion_ind, iregion_bb, &
+            nbreg_ind, nbreg_bb, &
+            lmt_bcff, lmt_bcnff, lmt_bcbb_l, lmt_bcbb_h, &
+            lmt_bcba, lmt_omff, lmt_omnff, &
+            lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba, &
+            id_fine, &
+            flux_sparam_bb, flux_sparam_ff, &
+            source_tr, flux_tr, tr_seri)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_fineem')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after fineem')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after fineem')
+        ENDDO
+      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after fineem')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_emis = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_emis = tia_emis + REAL(ti_emis) / REAL(clock_rate)
+    ENDIF
+
+
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('t'//str2,1,'SOURCE','',source_tr(:,itr))
+         CALL iophys_ecrit('f'//str2,1,'SOURCE','',flux_tr(:,itr))
+      enddo
+#endif
+
+
+    !=======================================================================
+    !                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
+    !=======================================================================
+
+    !        DO itr=1,nbtr
+    !         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,
+    !     .      pplay,t_seri,iscm3,'')
+    !        ENDDO
+
+    !======================================================================
+    !    -- Dry deposition --
+    !======================================================================
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL cm3_to_kg(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .FALSE.
+    !----------------------------
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_depo')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before depo')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'before depo')
+        ENDDO
+      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: before depo')
+    ENDIF
+
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRC'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+    CALL deposition(vdep_oce, vdep_sic, vdep_ter, vdep_lic, pctsrf, &
+            zrho, zdz, pdtphys, RHcl, masse, t_seri, pplay, paprs, &
+            lminmax, qmin, qmax, &
+            his_ds, source_tr, tr_seri)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_depo')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after depo')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after depo')
+        ENDDO
+      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after depo')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_depo = dife * MAX(0, SIGN(1, dife))                      &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_depo = tia_depo + REAL(ti_depo) / REAL(clock_rate)
+    ENDIF
+
+    !======================================================================
+    !    -- Boundary layer mixing --
+    !======================================================================
+
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRD'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO k = 1, klev
+      DO i = 1, klon
+        delp(i, k) = paprs(i, k) - paprs(i, k + 1)
+      END DO
+    END DO
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+          aux_var2(i) = source_tr(i, itr)
+        ENDDO
+      ENDDO
+      IF (iflag_conv==2) THEN
+        ! Tiedke
+        CALL cltrac_spl(pdtphys, coefh, yu1, yv1, t_seri, tmp_var, &
+                aux_var2, paprs, pplay, aux_var3)
+
+      ELSE IF (iflag_conv>=3) THEN
+        !KE
+        CALL cltrac(pdtphys, coefh, t_seri, tmp_var, aux_var2, paprs, pplay, &
+                delp, aux_var3, d_tr_dry, flux_tr_dry(:, itr))
+      ENDIF
+
+      DO i = 1, klon
+        DO j = 1, klev
+          tr_seri(i, j, itr) = tmp_var(i, j)
+          d_tr(i, j, itr) = aux_var3(i, j)
+          d_tr_cl(i, j, itr) = d_tr(i, j, itr)
+        ENDDO
+      ENDDO
+      DO k = 1, klev
+        DO i = 1, klon
+          tr_seri(i, k, itr) = tr_seri(i, k, itr) + d_tr(i, k, itr)
+        ENDDO
+      ENDDO
+      PRINT *, ' AFTER Cltrac'
+      IF (lminmax) THEN
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after cltrac')
+      ENDIF
+    ENDDO !--end itr loop
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_cltr = dife * MAX(0, SIGN(1, dife))     &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_cltr = tia_cltr + REAL(ti_cltr) / REAL(clock_rate)
+    ENDIF
+
+
+
+    !======================================================================
+    !    -- Calcul de l'effet des thermiques for KE--
+    !======================================================================
+
+#ifdef IOPHYS_DUST
+      PRINT*,'iflag_conv=',iflag_conv
+      CALL iophys_ecrit('coefh',klev,'coefh','',coefh)
+      CALL iophys_ecrit('yu1',1,'yu1','',yu1)
+      CALL iophys_ecrit('yv1',1,'yv1','',yv1)
+      CALL iophys_ecrit('delp',klev,'delp','',delp)
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRE'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+
+
+    IF (iflag_conv>=3) THEN
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_start)
+      ENDIF
+
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before therm')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before therm')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'before therm')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'before therm')
+      ENDIF
+
+      DO itr = 1, nbtr
+        DO k = 1, klev
+          DO i = 1, klon
+            tmp_var3(i, k, itr) = tr_seri(i, k, itr)
+            d_tr_th(i, k, itr) = 0.
+            tr_seri(i, k, itr) = MAX(tr_seri(i, k, itr), 0.)
+            !JE: precursor >>1e10         tr_seri(i,k,itr)=MIN(tr_seri(i,k,itr),1.e10)
+          END DO
+        END DO
+      END DO
+
+      !JE  new implicit scheme 20140323
+      DO itr = 1, nbtr
+        CALL thermcell_dq(klon, klev, 1, pdtphys, fm_therm, entr_therm, &
+                zmasse, tr_seri(1:klon, 1:klev, itr), &
+                d_tr(1:klon, 1:klev, itr), ztra_th, 0)
+
+        DO k = 1, klev
+          DO i = 1, klon
+            d_tr(i, k, itr) = pdtphys * d_tr(i, k, itr)
+            d_tr_th(i, k, itr) = d_tr_th(i, k, itr) + d_tr(i, k, itr)
+            tr_seri(i, k, itr) = MAX(tr_seri(i, k, itr) + d_tr(i, k, itr), 0.)
+          END DO
+        END DO
+
+      ENDDO
+
+      ! old scheme explicit
+      !       nsplit=10
+      !       DO itr=1,nbtr
+      !          DO isplit=1,nsplit
+      !              CALL dqthermcell(klon,klev,pdtphys/nsplit,
+      !     .            fm_therm,entr_therm,zmasse,
+      !     .            tr_seri(1:klon,1:klev,itr),
+      !     .            d_tr(1:klon,1:klev,itr),ztra_th)
+      !            DO k=1,klev
+      !               DO i=1,klon
+      !                  d_tr(i,k,itr)=pdtphys*d_tr(i,k,itr)/nsplit
+      !                  d_tr_th(i,k,itr)=d_tr_th(i,k,itr)+d_tr(i,k,itr)
+      !                  tr_seri(i,k,itr)=MAX(tr_seri(i,k,itr)+d_tr(i,k,itr),0.)
+      !               END DO
+      !            END DO
+      !         END DO ! nsplit1
+      !      END DO ! it
+      !JE end modif 20140323
+
+      DO itr = 1, nbtr
+        DO k = 1, klev
+          DO i = 1, klon
+            tmp_var(i, k) = tr_seri(i, k, itr) - tmp_var3(i, k, itr)
+          ENDDO
+        ENDDO
+        IF (lminmax) THEN
+          IF (lcheckmass) THEN
+            CALL checkmass(tmp_var(:, :), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'dtr therm ')
+          ENDIF
+        ENDIF
+        CALL kg_to_cm3(pplay, t_seri, tmp_var)
+
+        DO k = 1, klev
+          DO i = 1, klon
+            his_th(i, itr) = his_th(i, itr) + &
+                    (tmp_var(i, k)) / RNAVO * &
+                            masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+          END DO !klon
+        END DO !klev
+
+      END DO !it
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after therm')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after therm')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'after therm')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'after therm')
+      ENDIF
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_end)
+        dife = clock_end - clock_start
+        ti_ther = dife * MAX(0, SIGN(1, dife))   &
+                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+        tia_ther = tia_ther + REAL(ti_ther) / REAL(clock_rate)
+      ENDIF
+
+    ENDIF ! iflag_conv KE
+    !------------------------------------
+    !      Sedimentation
+    !-----------------------------------
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO !--end itr loop
+    iscm3 = .TRUE.
+    !--------------------------------------
+    PRINT *, ' BEFORE Sediment'
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_sedi')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before sedi')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'before sedi')
+        ENDDO
+      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: before sedi')
+    ENDIF
+
+    PRINT *, 'SPLA VERSION OF SEDIMENTATION IS USED'
+    CALL sediment_mod(t_seri, pplay, zrho, paprs, pdtphys, RHcl, &
+            id_coss, id_codu, id_scdu, &
+            ok_chimeredust, &
+            sed_ss, sed_dust, sed_dustsco, &
+            sed_ss3D, sed_dust3D, sed_dustsco3D, tr_seri)
+    CALL cm3_to_kg(pplay, t_seri, sed_ss3D)
+    CALL cm3_to_kg(pplay, t_seri, sed_dust3D)
+    CALL cm3_to_kg(pplay, t_seri, sed_dustsco3D)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_sedi')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after sedi')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after sedi')
+        ENDDO
+      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after sedi')
+    ENDIF
+
+    !=======================================================================
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRF'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_sedi = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_sedi = tia_sedi + REAL(ti_sedi) / REAL(clock_rate)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL cm3_to_kg(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .FALSE.
+
+
+    !======================================================================
+    !                      GAS TO PARTICLE CONVERSION
+    !======================================================================
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_beforegastopar')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before gastopar')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'before gastopar')
+        ENDDO
+      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: before gastopar')
+    ENDIF
+
+    CALL gastoparticle(pdtphys, zdz, zrho, rlat, &
+            pplay, t_seri, id_prec, id_fine, &
+            tr_seri, his_g2pgas, his_g2paer)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_gastopar')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after gastopar')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after gastopar')
+        ENDDO
+      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after gastopar')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_gasp = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_gasp = tia_gasp + REAL(ti_gasp) / REAL(clock_rate)
+    ENDIF
+
+    !======================================================================
+    !          EFFECT OF PRECIPITATION: iflag_conv=2
+    !======================================================================
+
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRG'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+
+    IF (iflag_conv==2) THEN
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_start)
+      ENDIF
+
+      DO itr = 1, nbtr
+        DO j = 1, klev
+          DO i = 1, klon
+            tmp_var(i, j) = tr_seri(i, j, itr)
+          ENDDO
+        ENDDO
+        CALL kg_to_cm3(pplay, t_seri, tmp_var)
+        DO j = 1, klev
+          DO i = 1, klon
+            tr_seri(i, j, itr) = tmp_var(i, j)
+          ENDDO
+        ENDDO
+      ENDDO
+      iscm3 = .TRUE.
+      !------------------------------
+
+      PRINT *, 'iflag_conv bef lessiv', iflag_conv
+      IF (lessivage) THEN
+
+        PRINT *, ' BEFORE Incloud'
+
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_incloud')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before incloud')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'before incloud')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: before incloud')
+        ENDIF
+
+
+        !      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
+        !     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
+
+        !     .                                     his_dhlsc,his_dhcon,tr_seri)
+        PRINT *, 'iflag_conv bef incloud', iflag_conv
+
+        IF (iflag_conv==2) THEN
+          ! Tiedke
+          CALL incloud_scav(.FALSE., qmin, qmax, masse, henry, kk, prfl, &
+                  psfl, pmflxr, pmflxs, zrho, zdz, t_seri, pdtphys, &
+                  his_dhlsc, his_dhcon, tr_seri)
+
+          !---------- to use this option please comment lsc_scav at the end
+          !        ELSE IF (iflag_conv.GE.3) THEN
+
+          !      CALL incloud_scav_lsc(.FALSE.,qmin,qmax,masse,henry,kk,prfl,
+          !     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
+          !     .                                     his_dhlsc,his_dhcon,tr_seri)
+          !--------------------------------------------------------------
+
+        ENDIF
+
+        PRINT *, ' BEFORE blcloud (after incloud)'
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_blcloud')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before blcloud')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'before blcloud')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: before blcloud')
+        ENDIF
+
+        !      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
+        !     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
+        !     .                                  his_dhbclsc,his_dhbccon,tr_seri)
+
+        IF (iflag_conv==2) THEN
+          ! Tiedke
+
+          CALL blcloud_scav(.FALSE., qmin, qmax, pdtphys, prfl, psfl, &
+                  pmflxr, pmflxs, zdz, alpha_r, alpha_s, masse, &
+                  his_dhbclsc, his_dhbccon, tr_seri)
+
+          !---------- to use this option please comment lsc_scav at the end
+          !           and comment IF iflag=2 after "EFFECT OF PRECIPITATION:"
+
+
+          !        ELSE IF (iflag_conv.GE.3) THEN
+
+          !      CALL blcloud_scav_lsc(.FALSE.,qmin,qmax,pdtphys,prfl,psfl,
+          !     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
+          !     .                                  his_dhbclsc,his_dhbccon,tr_seri)
+
+          !----------------------------------------------------------------------
+        ENDIF
+
+        PRINT *, ' AFTER blcloud '
+
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_blcloud')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after blcloud')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'after blcloud')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: after blcloud')
+        ENDIF
+
+      ENDIF !--lessivage
+
+      DO itr = 1, nbtr
+        DO j = 1, klev
+          DO i = 1, klon
+            tmp_var(i, j) = tr_seri(i, j, itr)
+          ENDDO
+        ENDDO
+        CALL cm3_to_kg(pplay, t_seri, tmp_var)
+        DO j = 1, klev
+          DO i = 1, klon
+            tr_seri(i, j, itr) = tmp_var(i, j)
+          ENDDO
+        ENDDO
+      ENDDO
+      iscm3 = .FALSE.
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_end)
+        dife = clock_end - clock_start
+        ti_wetap = dife * MAX(0, SIGN(1, dife))    &
+                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+        tia_wetap = tia_wetap + REAL(ti_wetap) / REAL(clock_rate)
+      ENDIF
+
+    ENDIF ! iflag_conv=2
+
+
+    !======================================================================
+    !                         EFFECT OF CONVECTION
+    !======================================================================
+
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRH'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    IF (convection) THEN
+
+      PRINT *, ' BEFORE trconvect'
+
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_trconve')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before trconve')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'before trconve')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'src: before trconve')
+      ENDIF
+
+
+      ! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
+      !     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
+      !     .                                                 dtrconv,tr_seri)
+      ! -------------------------------------------------------------
+      IF (iflag_conv==2) THEN
+        ! Tiedke
+        CALL trconvect(pplay, t_seri, pdtphys, pmfu, pmfd, pen_u, pde_u, &
+                pen_d, pde_d, paprs, zdz, xconv, qmin, qmax, .FALSE., masse, &
+                dtrconv, tr_seri)
+        DO itr = 1, nbtr
+          d_tr_cv(:, :, itr) = 0.
+        ENDDO
+
+      ELSE IF (iflag_conv>=3) THEN
+        ! KE
+        PRINT *, 'JE: KE in phytracr_spl'
+        DO itr = 1, nbtr
+          DO k = 1, klev
+            DO i = 1, klon
+              tmp_var3(i, k, itr) = tr_seri(i, k, itr)
+            END DO
+          END DO
+        ENDDO
+
+        DO itr = 1, nbtr
+          !          routine for aerosols . otherwise, check cvltrorig
+          PRINT *, 'Check sum before cvltr itr)', itr, SUM(tr_seri(:, :, itr))
+          !           IF (.FALSE.) THEN
+          CALL cvltr_spl(pdtphys, da, phi, phi2, d1a, dam, mp, ep, &
+                  sigd, sij, wght_cvfd, clw, elij, epmlmMm, eplaMm, &
+                  pmflxr, pmflxs, evapls, t_seri, wdtrainA, wdtrainM, &
+                  !            paprs,itr,tr_seri,upwd,dnwd,itop_con,ibas_con,        &
+                  paprs, itr, tmp_var3, upwd, dnwd, itop_con, ibas_con, &
+                  henry, kk, zrho, ccntrAA_spla, ccntrENV_spla, coefcoli_spla, &
+                  id_prec, id_fine, id_coss, id_codu, id_scdu, &
+                  d_tr_cv, d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav, qDi, qPr, &
+                  qPa, qMel, qTrdi, dtrcvMA, Mint, &
+                  zmfd1a, zmfphi2, zmfdam)
+          !           ENDIF
+
+          !           IF (.FALSE.) THEN
+          !           CALL cvltr(pdtphys, da, phi,phi2,d1a,dam, mp,ep,
+          !     .       sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,
+          !     .       pmflxr,pmflxs,evapls,t_seri,wdtrainA,wdtrainM,
+          !     .       paprs,itr,tmp_var3,upwd,dnwd,itop_con,ibas_con,
+          !     .       d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr,
+          !     .       qPa,qMel,qTrdi,dtrcvMA,Mint,
+          !     .       zmfd1a,zmfphi2,zmfdam)
+          !!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
+          !           ENDIF
+
+
+
+          !!!!!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
+          !!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
+          !!!     .               upwd,dnwd,d_tr_cv)
+          !             PRINT *,'justbefore cvltrnoscav it= ',it
+          !             CALL checknanqfi(da(:,:),1.,-1.,' da')
+          !             CALL checknanqfi(wght_cvfd(:,:),1.,-1.,'weigth ')
+          !             CALL checknanqfi(mp(:,:),1.,-1.,'mp ')
+          !             CALL checknanqfi(paprs(:,:),1.,-1.,'paprs ')
+          !             CALL checknanqfi(pplay(:,:),1.,-1.,'pplay ')
+          !             CALL checknanqfi(tmp_var3(:,:,itr),1.,-1.,'tmp_var3 ')
+          !             CALL checknanqfi(upwd(:,:),1.,-1.,'upwd ')
+          !             CALL checknanqfi(dnwd(:,:),1.,-1.,'dnwd ')
+          !             CALL checknanqfi(d_tr_cv(:,:,itr),1.,-1.,'d_tr_cv ')
+          !             IF (.TRUE.) THEN
+          !             CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,
+          !     .            pplay,tmp_var3,upwd,dnwd,d_tr_cv)
+          !             ENDIF
+          DO k = 1, klev
+            DO i = 1, klon
+              !               tr_seri(i,k,itr) = tr_seri(i,k,itr) + d_tr_cv(i,k,itr)
+              tr_seri(i, k, itr) = (tmp_var3(i, k, itr) + d_tr_cv(i, k, itr))
+              tmp_var(i, k) = d_tr_cv(i, k, itr)
+
+            END DO
+          END DO
+
+          CALL kg_to_cm3(pplay, t_seri, tmp_var) !just for his_* computation
+
+          DO k = 1, klev
+            DO i = 1, klon
+              dtrconv(i, itr) = 0.0
+              his_dhkecv(i, itr) = his_dhkecv(i, itr) - tmp_var(i, k)  &
+                      / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+            END DO
+          END DO
+
+          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+          CALL kg_to_cm3(pplay, t_seri, tmp_var) !just for his_* computation
+
+          DO k = 1, klev
+            DO i = 1, klon
+              dtrconv(i, itr) = 0.0
+              his_ds(i, itr) = his_ds(i, itr) - tmp_var(i, k)  &
+                      / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+            END DO
+          END DO
+          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+          IF (lminmax) THEN
+
+            PRINT *, 'Check sum after cvltr itr)', itr, SUM(tr_seri(:, :, itr))
+            CALL minmaxqfi2(d_tr_cv(:, :, itr), qmin, qmax, 'd_tr_cv:')
+            CALL minmaxqfi2(d_tr_trsp(:, :, itr), qmin, qmax, 'd_tr_trsp:')
+            CALL minmaxqfi2(d_tr_sscav(:, :, itr), qmin, qmax, 'd_tr_sscav:')
+            CALL minmaxqfi2(d_tr_sat(:, :, itr), qmin, qmax, 'd_tr_sat:')
+            CALL minmaxqfi2(d_tr_uscav(:, :, itr), qmin, qmax, 'd_tr_uscav:')
+            IF (lcheckmass) THEN
+              CALL checkmass(d_tr_cv(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, .FALSE., 'd_tr_cv:')
+            ENDIF
+          ENDIF
+        ENDDO ! it=1,nbtr
+
+      ENDIF ! iflag_conv
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_trcon')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after trconv')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'after trconv')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'src: after trconv')
+      ENDIF
+    ENDIF ! convection
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_cvltr = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_cvltr = tia_cvltr + REAL(ti_cvltr) / REAL(clock_rate)
+    ENDIF
+
+
+    !=======================================================================
+    !      LARGE SCALE SCAVENGING KE
+    !=======================================================================
+
+#ifdef IOPHYS_DUST
+      CALL iophys_ecrit('da',klev,'da','',da)
+      CALL iophys_ecrit('phi',klev,'phi','',phi)
+      CALL iophys_ecrit('phi2',klev,'phi2','',phi2)
+      CALL iophys_ecrit('d1a',klev,'d1a','',d1a)
+      CALL iophys_ecrit('dam',klev,'dam','',dam)
+      CALL iophys_ecrit('mp',klev,'mp','',mp)
+      CALL iophys_ecrit('ep',klev,'ep','',ep)
+      CALL iophys_ecrit('sigd',klev,'sigd','',sigd)
+      CALL iophys_ecrit('sij',klev,'sij','',sij)
+      CALL iophys_ecrit('wght_cvfd',klev,'wght_cvfd','',wght_cvfd)
+      CALL iophys_ecrit('clw',klev,'clw','',clw)
+      CALL iophys_ecrit('elij',klev,'elij','',elij)
+      CALL iophys_ecrit('epmlmMm',klev,'epmlmMm','',epmlmMm)
+      CALL iophys_ecrit('eplaMm',klev,'eplaMm','',eplaMm)
+      CALL iophys_ecrit('pmflxr',klev,'pmflxr','',pmflxr)
+      CALL iophys_ecrit('pmflxs',klev,'pmflxs','',pmflxs)
+      CALL iophys_ecrit('evapls',klev,'evapls','',evapls)
+      CALL iophys_ecrit('wdtrainA',klev,'wdtrainA','',wdtrainA)
+      CALL iophys_ecrit('wdtrainM',klev,'wdtrainM','',wdtrainM)
+
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRI'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+
+    IF (iflag_conv>=3) THEN
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_start)
+      ENDIF
+
+      IF (lessivage)  THEN
+        PRINT *, ' BEFORE lsc_scav '
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_lsc_scav')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before lsc_scav')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'before lsc_scav')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: before lsc_scav')
+        ENDIF
+
+        ql_incloud_ref = 10.e-4
+        ql_incloud_ref = 5.e-4
+        ! calcul du contenu en eau liquide au sein du nuage
+        ql_incl = ql_incloud_ref
+        ! choix du lessivage
+        IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN
+          !IF (.FALSE.) THEN  ! test #DFB (Binta) sans lsc_scav_spl
+          PRINT *, 'JE iflag_lscav', iflag_lscav
+          DO itr = 1, nbtr
+
+            !       incloud scavenging and removal by large scale rain ! orig : ql_incl
+            !         was replaced by 0.5e-3 kg/kg
+            !          the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR
+            !         Liu (2001) proposed to use 1.5e-3 kg/kg
+
+            !       CALL lsc_scav_orig(pdtphys,itr,iflag_lscav,ql_incl,prfl,psfl,
+            !     .               rneb,beta_fisrt, beta_v1,pplay,paprs,
+            !     .               t_seri,tr_seri,d_tr_insc,
+            !     .               d_tr_bcscav,d_tr_evapls,qPrls)
+            CALL lsc_scav_spl(pdtphys, itr, iflag_lscav, ql_incl, prfl, psfl, &
+                    rneb, beta_fisrt, beta_v1, pplay, paprs, &
+                    t_seri, tr_seri, d_tr_insc, &
+                    alpha_r, alpha_s, kk, henry, &
+                    id_prec, id_fine, id_coss, id_codu, id_scdu, &
+                    d_tr_bcscav, d_tr_evapls, qPrls)
+
+            !large scale scavenging tendency
+            DO k = 1, klev
+              DO i = 1, klon
+                d_tr_ls(i, k, itr) = d_tr_insc(i, k, itr) + d_tr_bcscav(i, k, itr) &
+                        + d_tr_evapls(i, k, itr)
+                tr_seri(i, k, itr) = tr_seri(i, k, itr) + d_tr_ls(i, k, itr)
+                tmp_var(i, k) = d_tr_ls(i, k, itr)
+              ENDDO
+            ENDDO
+
+            CALL kg_to_cm3(pplay, t_seri, tmp_var)
+
+            DO k = 1, klev
+              DO i = 1, klon
+                his_dhkelsc(i, itr) = his_dhkelsc(i, itr) - tmp_var(i, k)    &
+                        / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+
+              END DO
+            END DO
+
+          END DO  !it=1,nbtr
+
+        ELSE
+          PRINT *, 'WARNING: NO lsc_scav, Please choose iflag_lscav=3 or 4'
+          DO itr = 1, nbtr
+            DO i = 1, klon
+              his_dhkelsc(i, itr) = 0.0
+            END DO  ! klon
+          END DO  !it=1,nbtr
+        ENDIF !iflag_lscav
+
+        PRINT *, ' AFTER lsc_scav '
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_lsc_scav')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after lsc_scav')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'after lsc_scav')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: after lsc_scav')
+        ENDIF
+
+      ENDIF ! lessivage
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_end)
+        dife = clock_end - clock_start
+        ti_lscs = dife * MAX(0, SIGN(1, dife))   &
+                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+        tia_lscs = tia_lscs + REAL(ti_lscs) / REAL(clock_rate)
+      ENDIF
+
+    ENDIF !iflag_conv
+
+
+    !=======================================================================
+    !                         COMPUTING THE BURDEN
+    !=======================================================================
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRJ'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .TRUE.
+
+    ! Computing burden in mg/m2
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          trm(i, itr) = trm(i, itr) + tr_seri(i, k, itr) * 1.e6 * zdz(i, k) * &
+                  masse(itr) * 1.e3 / RNAVO     !--mg S/m2
+        ENDDO
+      ENDDO
+    ENDDO
+
+    ! Computing Surface concentration in ug/m3
+
+    DO itr = 1, nbtr
+      DO i = 1, klon
+        sconc_seri(i, itr) = tr_seri(i, 1, itr) * 1.e6 * &
+                masse(itr) * 1.e3 / RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
+      ENDDO
+    ENDDO
+
+    !=======================================================================
+    !                  CALCULATION OF OPTICAL PROPERTIES
+    !=======================================================================
+
+    CALL aeropt_spl(zdz, tr_seri, RHcl, &
+            id_prec, id_fine, id_coss, id_codu, id_scdu, &
+            ok_chimeredust, &
+            diff_aod550_tot, diag_aod670_tot, diag_aod865_tot, &
+            diff_aod550_tr2, diag_aod670_tr2, diag_aod865_tr2, &
+            diag_aod550_ss, diag_aod670_ss, diag_aod865_ss, &
+            diag_aod550_dust, diag_aod670_dust, diag_aod865_dust, &
+            diag_aod550_dustsco, diag_aod670_dustsco, diag_aod865_dustsco)
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_brop = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_brop = tia_brop + REAL(ti_brop) / REAL(clock_rate)
+    ENDIF
+
+
+    !=======================================================================
+    !   MODIS terra/aqua simulation output
+    !=======================================================================
+    masque_aqua_cur(:) = 0
+    masque_terra_cur(:) = 0
+
+    CALL satellite_out_spla(jD_cur, jH_cur, pdtphys, rlat, rlon, &
+            masque_aqua_cur, masque_terra_cur)
+    IF (jH_cur - pdtphys / 86400. < 0.) THEN
+      !new utc day: put in 0 everything
+      !JE20150518<<
+      masque_aqua(:) = 0
+      masque_terra(:) = 0
+      aod550_terra(:) = 0.
+      aod550_tr2_terra(:) = 0.
+      aod550_ss_terra(:) = 0.
+      aod550_dust_terra(:) = 0.
+      aod550_dustsco_terra(:) = 0.
+      aod670_terra(:) = 0.
+      aod670_tr2_terra(:) = 0.
+      aod670_ss_terra(:) = 0.
+      aod670_dust_terra(:) = 0.
+      aod670_dustsco_terra(:) = 0.
+      aod865_terra(:) = 0.
+      aod865_tr2_terra(:) = 0.
+      aod865_ss_terra(:) = 0.
+      aod865_dust_terra(:) = 0.
+      aod865_dustsco_terra(:) = 0.
+      aod550_aqua(:) = 0.
+      aod550_tr2_aqua(:) = 0.
+      aod550_ss_aqua(:) = 0.
+      aod550_dust_aqua(:) = 0.
+      aod550_dustsco_aqua(:) = 0.
+      aod670_aqua(:) = 0.
+      aod670_tr2_aqua(:) = 0.
+      aod670_ss_aqua(:) = 0.
+      aod670_dust_aqua(:) = 0.
+      aod670_dustsco_aqua(:) = 0.
+      aod865_aqua(:) = 0.
+      aod865_tr2_aqua(:) = 0.
+      aod865_ss_aqua(:) = 0.
+      aod865_dust_aqua(:) = 0.
+      aod865_dustsco_aqua(:) = 0.
+      !JE20150518>>
+    ENDIF
+
+    DO i = 1, klon
+
+      aod550_terra(i) = aod550_terra(i) + &
+              masque_terra_cur(i) * diff_aod550_tot(i)
+      aod550_tr2_terra(i) = aod550_tr2_terra(i) + &
+              masque_terra_cur(i) * diff_aod550_tr2(i)
+      aod550_ss_terra(i) = aod550_ss_terra(i) + &
+              masque_terra_cur(i) * diag_aod550_ss(i)
+      aod550_dust_terra(i) = aod550_dust_terra(i) + &
+              masque_terra_cur(i) * diag_aod550_dust(i)
+      aod550_dustsco_terra(i) = aod550_dustsco_terra(i) + &
+              masque_terra_cur(i) * diag_aod550_dustsco(i)
+      aod670_terra(i) = aod670_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_tot(i)
+      aod670_tr2_terra(i) = aod670_tr2_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_tr2(i)
+      aod670_ss_terra(i) = aod670_ss_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_ss(i)
+      aod670_dust_terra(i) = aod670_dust_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_dust(i)
+      aod670_dustsco_terra(i) = aod670_dustsco_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_dustsco(i)
+      aod865_terra(i) = aod865_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_tot(i)
+      aod865_tr2_terra(i) = aod865_tr2_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_tr2(i)
+      aod865_ss_terra(i) = aod865_ss_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_ss(i)
+      aod865_dust_terra(i) = aod865_dust_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_dust(i)
+      aod865_dustsco_terra(i) = aod865_dustsco_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_dustsco(i)
+
+      aod550_aqua(i) = aod550_aqua(i) + &
+              masque_aqua_cur(i) * diff_aod550_tot(i)
+      aod550_tr2_aqua(i) = aod550_tr2_aqua(i) + &
+              masque_aqua_cur(i) * diff_aod550_tr2(i)
+      aod550_ss_aqua(i) = aod550_ss_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod550_ss(i)
+      aod550_dust_aqua(i) = aod550_dust_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod550_dust(i)
+      aod550_dustsco_aqua(i) = aod550_dustsco_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod550_dustsco(i)
+      aod670_aqua(i) = aod670_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_tot(i)
+      aod670_tr2_aqua(i) = aod670_tr2_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_tr2(i)
+      aod670_ss_aqua(i) = aod670_ss_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_ss(i)
+      aod670_dust_aqua(i) = aod670_dust_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_dust(i)
+      aod670_dustsco_aqua(i) = aod670_dustsco_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_dustsco(i)
+      aod865_aqua(i) = aod865_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_tot(i)
+      aod865_tr2_aqua(i) = aod865_tr2_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_tr2(i)
+      aod865_ss_aqua(i) = aod865_ss_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_ss(i)
+      aod865_dust_aqua(i) = aod865_dust_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_dust(i)
+      aod865_dustsco_aqua(i) = aod865_dustsco_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_dustsco(i)
+
+      masque_aqua(i) = masque_aqua(i) + masque_aqua_cur(i)
+      masque_terra(i) = masque_terra(i) + masque_terra_cur(i)
+    ENDDO
+
+    IF (jH_cur + pdtphys / 86400. >= 1.) THEN
+      !          PRINT *,'last step of the day'
+      DO i = 1, klon
+        IF (masque_aqua(i)> 0) THEN
+          aod550_aqua(i) = aod550_aqua(i) / masque_aqua(i)
+          aod670_aqua(i) = aod670_aqua(i) / masque_aqua(i)
+          aod865_aqua(i) = aod865_aqua(i) / masque_aqua(i)
+          aod550_tr2_aqua(i) = aod550_tr2_aqua(i) / masque_aqua(i)
+          aod670_tr2_aqua(i) = aod670_tr2_aqua(i) / masque_aqua(i)
+          aod865_tr2_aqua(i) = aod865_tr2_aqua(i) / masque_aqua(i)
+          aod550_ss_aqua(i) = aod550_ss_aqua(i) / masque_aqua(i)
+          aod670_ss_aqua(i) = aod670_ss_aqua(i) / masque_aqua(i)
+          aod865_ss_aqua(i) = aod865_ss_aqua(i) / masque_aqua(i)
+          aod550_dust_aqua(i) = aod550_dust_aqua(i) / masque_aqua(i)
+          aod670_dust_aqua(i) = aod670_dust_aqua(i) / masque_aqua(i)
+          aod865_dust_aqua(i) = aod865_dust_aqua(i) / masque_aqua(i)
+          aod550_dustsco_aqua(i) = aod550_dustsco_aqua(i) / masque_aqua(i)
+          aod670_dustsco_aqua(i) = aod670_dustsco_aqua(i) / masque_aqua(i)
+          aod865_dustsco_aqua(i) = aod865_dustsco_aqua(i) / masque_aqua(i)
+        ELSE
+          aod550_aqua(i) = -999.
+          aod670_aqua(i) = -999.
+          aod865_aqua(i) = -999.
+          aod550_tr2_aqua(i) = -999.
+          aod670_tr2_aqua(i) = -999.
+          aod865_tr2_aqua(i) = -999.
+          aod550_ss_aqua(i) = -999.
+          aod670_ss_aqua(i) = -999.
+          aod865_ss_aqua(i) = -999.
+          aod550_dust_aqua(i) = -999.
+          aod670_dust_aqua(i) = -999.
+          aod865_dust_aqua(i) = -999.
+          aod550_dustsco_aqua(i) = -999.
+          aod670_dustsco_aqua(i) = -999.
+          aod865_dustsco_aqua(i) = -999.
+        ENDIF
+        IF (masque_terra(i)> 0) THEN
+          aod550_terra(i) = aod550_terra(i) / masque_terra(i)
+          aod670_terra(i) = aod670_terra(i) / masque_terra(i)
+          aod865_terra(i) = aod865_terra(i) / masque_terra(i)
+          aod550_tr2_terra(i) = aod550_tr2_terra(i) / masque_terra(i)
+          aod670_tr2_terra(i) = aod670_tr2_terra(i) / masque_terra(i)
+          aod865_tr2_terra(i) = aod865_tr2_terra(i) / masque_terra(i)
+          aod550_ss_terra(i) = aod550_ss_terra(i) / masque_terra(i)
+          aod670_ss_terra(i) = aod670_ss_terra(i) / masque_terra(i)
+          aod865_ss_terra(i) = aod865_ss_terra(i) / masque_terra(i)
+          aod550_dust_terra(i) = aod550_dust_terra(i) / masque_terra(i)
+          aod670_dust_terra(i) = aod670_dust_terra(i) / masque_terra(i)
+          aod865_dust_terra(i) = aod865_dust_terra(i) / masque_terra(i)
+          aod550_dustsco_terra(i) = aod550_dustsco_terra(i) / masque_terra(i)
+          aod670_dustsco_terra(i) = aod670_dustsco_terra(i) / masque_terra(i)
+          aod865_dustsco_terra(i) = aod865_dustsco_terra(i) / masque_terra(i)
+        ELSE
+          aod550_terra(i) = -999.
+          aod670_terra(i) = -999.
+          aod865_terra(i) = -999.
+          aod550_tr2_terra(i) = -999.
+          aod670_tr2_terra(i) = -999.
+          aod865_tr2_terra(i) = -999.
+          aod550_ss_terra(i) = -999.
+          aod670_ss_terra(i) = -999.
+          aod865_ss_terra(i) = -999.
+          aod550_dust_terra(i) = -999.
+          aod670_dust_terra(i) = -999.
+          aod865_dust_terra(i) = -999.
+          aod550_dustsco_terra(i) = -999.
+          aod670_dustsco_terra(i) = -999.
+          aod865_dustsco_terra(i) = -999.
+        ENDIF
+      ENDDO
+
+      !!AS deleting lines
+      !!      IF (ok_histrac) THEN
+      !!!!      write in output file
+      !!----many deleted lines
+      !!      ENDIF  !mpi_root
+      !!!$OMP END MASTER
+      !!!$OMP BARRIER
+      !!      ENDIF  !--ok_histrac
+
+    ENDIF ! jH_cur...
+
+    !======================================================================
+    !  Stockage sur bande histoire
+    !======================================================================
+#ifdef IOPHYS_DUST
+      DO itr=1,nbtr
+         WRITE(str2,'(i2.2)') itr
+         CALL iophys_ecrit('TRK'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
+      enddo
+#endif
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL cm3_to_kg(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .FALSE.
+
+
+    !======================================================================
+    !  SAVING AEROSOL RELATED VARIABLES INTO FILE
+    !======================================================================
+
+    ndex2d = 0
+    ndex3d = 0
+
+    itra = itra + 1
+
+    PRINT *, 'SAVING VARIABLES FOR DAY ', itra
+
+    fluxbb(:) = 0.0
+    fluxff(:) = 0.0
+    fluxbcbb(:) = 0.0
+    fluxbcff(:) = 0.0
+    fluxbcnff(:) = 0.0
+    fluxbcba(:) = 0.0
+    fluxbc(:) = 0.0
+    fluxombb(:) = 0.0
+    fluxomff(:) = 0.0
+    fluxomnat(:) = 0.0
+    fluxomba(:) = 0.0
+    fluxomnff(:) = 0.0
+    fluxom(:) = 0.0
+    fluxh2sff(:) = 0.0
+    fluxh2snff(:) = 0.0
+    fluxh2sbio(:) = 0.0
+    fluxso2ff(:) = 0.0
+    fluxso2nff(:) = 0.0
+    fluxso2bb(:) = 0.0
+    fluxso2vol(:) = 0.0
+    fluxso2ba(:) = 0.0
+    fluxso2(:) = 0.0
+    fluxso4ff(:) = 0.0
+    fluxso4nff(:) = 0.0
+    fluxso4bb(:) = 0.0
+    fluxso4ba(:) = 0.0
+    fluxso4(:) = 0.0
+    fluxdms(:) = 0.0
+    fluxdustec(:) = 0.0
+    fluxddfine(:) = 0.0
+    fluxddcoa(:) = 0.0
+    fluxddsco(:) = 0.0
+    fluxdd(:) = 0.0
+    fluxssfine(:) = 0.0
+    fluxsscoa(:) = 0.0
+    fluxss(:) = 0.0
+    DO i = 1, klon
+      IF (iregion_ind(i)>0) THEN           ! LAND
+        ! SULFUR EMISSIONS
+        fluxh2sff(i) = (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * frach2sofso2 * &
+                scale_param_ind(iregion_ind(i)) * &
+                1.e4 / RNAVO * masse_s * 1.e3         ! mgS/m2/s
+        fluxso2ff(i) = scale_param_ind(iregion_ind(i)) * fracso2emis * &
+                (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * 1.e4 / RNAVO * &
+                masse_s * 1.e3  ! mgS/m2/s
+        ! SULPHATE EMISSIONS
+        fluxso4ff(i) = scale_param_ind(iregion_ind(i)) * (1 - fracso2emis) * &
+                (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * 1.e4 / RNAVO * &
+                masse_s * 1.e3  ! mgS/m2/s
+        ! BLACK CARBON EMISSIONS
+        fluxbcff(i) = scale_param_ff(iregion_ind(i)) * &
+                lmt_bcff(i) * 1.e4 * 1.e3  !/g/m2/s
+        ! ORGANIC MATTER EMISSIONS
+        fluxomff(i) = scale_param_ff(iregion_ind(i)) * &
+                (lmt_omff(i)) * 1.e4 * 1.e3  !/g/m2/s
+        ! FOSSIL FUEL EMISSIONS
+        fluxff(i) = fluxbcff(i) + fluxomff(i)
+      ENDIF
+      IF (iregion_bb(i)>0) THEN           ! LAND
+        ! SULFUR EMISSIONS
+        fluxso2bb(i) = scale_param_bb(iregion_bb(i)) * fracso2emis * &
+                (lmt_so2bb_l(i) + lmt_so2bb_h(i)) * &
+                (1. - pctsrf(i, is_oce)) * 1.e4 / RNAVO * masse_s * 1.e3       ! mgS/m2/s
+        ! SULPHATE EMISSIONS
+        fluxso4bb(i) = scale_param_bb(iregion_bb(i)) * (1 - fracso2emis) * &
+                (lmt_so2bb_l(i) + lmt_so2bb_h(i)) * &
+                (1. - pctsrf(i, is_oce)) * 1.e4 / RNAVO * masse_s * 1.e3       ! mgS/m2/s
+        ! BLACK CARBON EMISSIONS
+        fluxbcbb(i) = scale_param_bb(iregion_bb(i)) * &
+                (lmt_bcbb_l(i) + lmt_bcbb_h(i)) * 1.e4 * 1.e3  !mg/m2/s
+        ! ORGANIC MATTER EMISSIONS
+        fluxombb(i) = scale_param_bb(iregion_bb(i)) * &
+                (lmt_ombb_l(i) + lmt_ombb_h(i)) * 1.e4 * 1.e3  !mg/m2/s
+        ! BIOMASS BURNING EMISSIONS
+        fluxbb(i) = fluxbcbb(i) + fluxombb(i)
+      ENDIF
+      ! H2S EMISSIONS
+      fluxh2sbio(i) = lmt_h2sbio(i) * 1.e4 / RNAVO * masse_s * 1.e3      ! mgS/m2/s
+      fluxh2snff(i) = lmt_so2nff(i) * frach2sofso2 * &
+              1.e4 / RNAVO * masse_s * 1.e3         ! mgS/m2/s
+      ! SULFUR DIOXIDE EMISSIONS
+      fluxso2nff(i) = fracso2emis * lmt_so2nff(i) * 1.e4 / RNAVO * &
+              masse_s * 1.e3  ! mgS/m2/s
+      fluxso2vol(i) = (lmt_so2volc_cont(i) + lmt_so2volc_expl(i))  &
+              * 1.e4 / RNAVO * masse_s * 1.e3        ! mgS/m2/s
+      fluxso2ba(i) = lmt_so2ba(i) * 1.e4 / RNAVO * masse_s * 1.e3 * &
+              fracso2emis ! mgS/m2/s
+      fluxso2(i) = fluxso2ff(i) + fluxso2bb(i) + fluxso2nff(i) + &
+              fluxso2vol(i) + fluxso2ba(i)
+      ! DMS EMISSIONS
+      fluxdms(i) = (lmt_dms(i) + lmt_dmsbio(i))              &
+              * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
+      ! SULPHATE EMISSIONS
+      fluxso4ba(i) = lmt_so2ba(i) * 1.e4 / RNAVO * masse_s * 1.e3        &
+              * (1 - fracso2emis) ! mgS/m2/s
+      fluxso4nff(i) = (1 - fracso2emis) * lmt_so2nff(i) * 1.e4 / RNAVO * &
+              masse_s * 1.e3  ! mgS/m2/s
+      fluxso4(i) = fluxso4ff(i) + fluxso4bb(i) + fluxso4ba(i) + fluxso4nff(i)
+      ! BLACK CARBON EMISSIONS
+
+      fluxbcnff(i) = lmt_bcnff(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxbcba(i) = lmt_bcba(i) * 1.e4 * 1.e3    !mg/m2/s
+      fluxbc(i) = fluxbcbb(i) + fluxbcff(i) + fluxbcnff(i) + fluxbcba(i)
+      ! ORGANIC MATTER EMISSIONS
+      fluxomnat(i) = lmt_omnat(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxomba(i) = lmt_omba(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxomnff(i) = lmt_omnff(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxom(i) = fluxombb(i) + fluxomff(i) + fluxomnat(i) + fluxomba(i) + &
+              fluxomnff(i)
+      ! DUST EMISSIONS
+      fluxdustec(i) = dust_ec(i) * 1.e6 ! old dust emission scheme
+      !JE20140605<<         old dust emission version
+      !         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
+      !     .                                  * dust_ec(i)*0.093*1.e6
+      !         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
+      !     .                                  * dust_ec(i)*0.905*1.e6
+      !         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
+      !JE20140605>>
+      fluxddfine(i) = flux_sparam_ddfine(i)
+      fluxddcoa(i) = flux_sparam_ddcoa(i)
+      fluxddsco(i) = flux_sparam_ddsco(i)
+      fluxdd(i) = fluxddfine(i) + fluxddcoa(i) + fluxddsco(i)
+      ! SEA SALT EMISSIONS
+      fluxssfine(i) = scale_param_ssacc * lmt_sea_salt(i, 1) * 1.e4 * 1.e3
+      fluxsscoa(i) = scale_param_sscoa * lmt_sea_salt(i, 2) * 1.e4 * 1.e3
+      fluxss(i) = fluxssfine(i) + fluxsscoa(i)
+    ENDDO
+
+    !      prepare outputs cvltr
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_cv(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_cv_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_trsp(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_trsp_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_sscav(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_sscav_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_sat(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_sat_o(i, k, itr) = tmp_var(i, k)   &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_uscav(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_uscav_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_insc(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_insc_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_bcscav(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_bcscav_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_evapls(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_evapls_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_ls(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_ls_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_dyn(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_dyn_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_cl(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_cl_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_th(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_th_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    DO itr = 1, nbtr
+      WRITE(str2, '(i2.2)') itr
+      DO i = 1, klon
+        his_dh(i, itr) = his_dhlsc(i, itr) + his_dhcon(i, itr) + &
+                his_dhbclsc(i, itr) + his_dhbccon(i, itr)
+
+      ENDDO
+    ENDDO
+
+    !AS: commenting out and deleting lines
+    !!      IF (ok_histrac) THEN
+    !!
+    !! SAVING VARIABLES IN TRACEUR
+    !!----- many lines deleted----
+    !!      ENDIF ! ok_histrac
+
+
+
+
+    !JE20141224
+    ! saving variables for output
+    ! 2D outputs
+    DO i = 1, klon
+      trm01(i) = 0.
+      trm02(i) = 0.
+      trm03(i) = 0.
+      trm04(i) = 0.
+      trm05(i) = 0.
+      sconc01(i) = 0.
+      sconc02(i) = 0.
+      sconc03(i) = 0.
+      sconc04(i) = 0.
+      sconc05(i) = 0.
+      flux01(i) = 0.
+      flux02(i) = 0.
+      flux03(i) = 0.
+      flux04(i) = 0.
+      flux05(i) = 0.
+      ds01(i) = 0.
+      ds02(i) = 0.
+      ds03(i) = 0.
+      ds04(i) = 0.
+      ds05(i) = 0.
+      dh01(i) = 0.
+      dh02(i) = 0.
+      dh03(i) = 0.
+      dh04(i) = 0.
+      dh05(i) = 0.
+      dtrconv01(i) = 0.
+      dtrconv02(i) = 0.
+      dtrconv03(i) = 0.
+      dtrconv04(i) = 0.
+      dtrconv05(i) = 0.
+      dtherm01(i) = 0.
+      dtherm02(i) = 0.
+      dtherm03(i) = 0.
+      dtherm04(i) = 0.
+      dtherm05(i) = 0.
+      dhkecv01(i) = 0.
+      dhkecv02(i) = 0.
+      dhkecv03(i) = 0.
+      dhkecv04(i) = 0.
+      dhkecv05(i) = 0.
+      d_tr_ds01(i) = 0.
+      d_tr_ds02(i) = 0.
+      d_tr_ds03(i) = 0.
+      d_tr_ds04(i) = 0.
+      d_tr_ds05(i) = 0.
+      dhkelsc01(i) = 0.
+      dhkelsc02(i) = 0.
+      dhkelsc03(i) = 0.
+      dhkelsc04(i) = 0.
+      dhkelsc05(i) = 0.
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      IF(id_prec>0)  trm01(i) = trm(i, id_prec)
+      IF(id_fine>0)  trm02(i) = trm(i, id_fine)
+      IF(id_coss>0)  trm03(i) = trm(i, id_coss)
+      IF(id_codu>0)  trm04(i) = trm(i, id_codu)
+      IF(id_scdu>0)  trm05(i) = trm(i, id_scdu)
+      IF(id_prec>0)    sconc01(i) = sconc_seri(i, id_prec)
+      IF(id_fine>0)    sconc02(i) = sconc_seri(i, id_fine)
+      IF(id_coss>0)    sconc03(i) = sconc_seri(i, id_coss)
+      IF(id_codu>0)    sconc04(i) = sconc_seri(i, id_codu)
+      IF(id_scdu>0)    sconc05(i) = sconc_seri(i, id_scdu)
+      IF(id_prec>0)    flux01(i) = flux_tr(i, id_prec)
+      IF(id_fine>0)    flux02(i) = flux_tr(i, id_fine)
+      IF(id_coss>0)    flux03(i) = flux_tr(i, id_coss)
+      IF(id_codu>0)    flux04(i) = flux_tr(i, id_codu)
+      IF(id_scdu>0)    flux05(i) = flux_tr(i, id_scdu)
+      IF(id_prec>0)    ds01(i) = his_ds(i, id_prec)
+      IF(id_fine>0)    ds02(i) = his_ds(i, id_fine)
+      IF(id_coss>0)    ds03(i) = his_ds(i, id_coss)
+      IF(id_codu>0)    ds04(i) = his_ds(i, id_codu)
+      IF(id_scdu>0)    ds05(i) = his_ds(i, id_scdu)
+      IF(id_prec>0)    dh01(i) = his_dh(i, id_prec)
+      IF(id_fine>0)    dh02(i) = his_dh(i, id_fine)
+      IF(id_coss>0)    dh03(i) = his_dh(i, id_coss)
+      IF(id_codu>0)    dh04(i) = his_dh(i, id_codu)
+      IF(id_scdu>0)    dh05(i) = his_dh(i, id_scdu)
+      IF(id_prec>0)    dtrconv01(i) = dtrconv(i, id_prec)
+      IF(id_fine>0)    dtrconv02(i) = dtrconv(i, id_fine)
+      IF(id_coss>0)    dtrconv03(i) = dtrconv(i, id_coss)
+      IF(id_codu>0)    dtrconv04(i) = dtrconv(i, id_codu)
+      IF(id_scdu>0)    dtrconv05(i) = dtrconv(i, id_scdu)
+      IF(id_prec>0)    dtherm01(i) = his_th(i, id_prec)
+      IF(id_fine>0)    dtherm02(i) = his_th(i, id_fine)
+      IF(id_coss>0)    dtherm03(i) = his_th(i, id_coss)
+      IF(id_codu>0)    dtherm04(i) = his_th(i, id_codu)
+      IF(id_scdu>0)    dtherm05(i) = his_th(i, id_scdu)
+      IF(id_prec>0)    dhkecv01(i) = his_dhkecv(i, id_prec)
+      IF(id_fine>0)    dhkecv02(i) = his_dhkecv(i, id_fine)
+      IF(id_coss>0)    dhkecv03(i) = his_dhkecv(i, id_coss)
+      IF(id_codu>0)    dhkecv04(i) = his_dhkecv(i, id_codu)
+      IF(id_scdu>0)    dhkecv05(i) = his_dhkecv(i, id_scdu)
+      IF(id_prec>0)    d_tr_ds01(i) = his_ds(i, id_prec)
+      IF(id_fine>0)    d_tr_ds02(i) = his_ds(i, id_fine)
+      IF(id_coss>0)    d_tr_ds03(i) = his_ds(i, id_coss)
+      IF(id_codu>0)    d_tr_ds04(i) = his_ds(i, id_codu)
+      IF(id_scdu>0)    d_tr_ds05(i) = his_ds(i, id_scdu)
+      IF(id_prec>0)    dhkelsc01(i) = his_dhkelsc(i, id_prec)
+      IF(id_fine>0)    dhkelsc02(i) = his_dhkelsc(i, id_fine)
+      IF(id_coss>0)    dhkelsc03(i) = his_dhkelsc(i, id_coss)
+      IF(id_codu>0)    dhkelsc04(i) = his_dhkelsc(i, id_codu)
+      IF(id_scdu>0)    dhkelsc05(i) = his_dhkelsc(i, id_scdu)
+      u10m_ss(i) = u10m_ec(i)
+      v10m_ss(i) = v10m_ec(i)
+    ENDDO
+    ! 3D outs
+    DO i = 1, klon
+      DO k = 1, klev
+        d_tr_cv01(i, k) = 0.
+        d_tr_cv02(i, k) = 0.
+        d_tr_cv03(i, k) = 0.
+        d_tr_cv04(i, k) = 0.
+        d_tr_cv05(i, k) = 0.
+        d_tr_trsp01(i, k) = 0.
+        d_tr_trsp02(i, k) = 0.
+        d_tr_trsp03(i, k) = 0.
+        d_tr_trsp04(i, k) = 0.
+        d_tr_trsp05(i, k) = 0.
+        d_tr_sscav01(i, k) = 0.
+        d_tr_sscav02(i, k) = 0.
+        d_tr_sscav03(i, k) = 0.
+        d_tr_sscav04(i, k) = 0.
+        d_tr_sscav05(i, k) = 0.
+        d_tr_sat01(i, k) = 0.
+        d_tr_sat02(i, k) = 0.
+        d_tr_sat03(i, k) = 0.
+        d_tr_sat04(i, k) = 0.
+        d_tr_sat05(i, k) = 0.
+        d_tr_uscav01(i, k) = 0.
+        d_tr_uscav02(i, k) = 0.
+        d_tr_uscav03(i, k) = 0.
+        d_tr_uscav04(i, k) = 0.
+        d_tr_uscav05(i, k) = 0.
+        d_tr_insc01(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_insc02(i, k) = 0.
+        d_tr_insc03(i, k) = 0.
+        d_tr_insc04(i, k) = 0.
+        d_tr_insc05(i, k) = 0.
+        d_tr_bcscav01(i, k) = 0.
+        d_tr_bcscav02(i, k) = 0.
+        d_tr_bcscav03(i, k) = 0.
+        d_tr_bcscav04(i, k) = 0.
+        d_tr_bcscav05(i, k) = 0.
+        d_tr_evapls01(i, k) = 0.
+        d_tr_evapls02(i, k) = 0.
+        d_tr_evapls03(i, k) = 0.
+        d_tr_evapls04(i, k) = 0.
+        d_tr_evapls05(i, k) = 0.
+        d_tr_ls01(i, k) = 0.
+        d_tr_ls02(i, k) = 0.
+        d_tr_ls03(i, k) = 0.
+        d_tr_ls04(i, k) = 0.
+        d_tr_ls05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_dyn01(i, k) = 0.
+        d_tr_dyn02(i, k) = 0.
+        d_tr_dyn03(i, k) = 0.
+        d_tr_dyn04(i, k) = 0.
+        d_tr_dyn05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_cl01(i, k) = 0.
+        d_tr_cl02(i, k) = 0.
+        d_tr_cl03(i, k) = 0.
+        d_tr_cl04(i, k) = 0.
+        d_tr_cl05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_th01(i, k) = 0.
+        d_tr_th02(i, k) = 0.
+        d_tr_th03(i, k) = 0.
+        d_tr_th04(i, k) = 0.
+        d_tr_th05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ENDDO
+    ENDDO
+
+    IF(1==0) THEN
+      ! calcul in original trunk version; problem: budget not closed. Corrected in "ELSE"
+      DO i = 1, klon
+        DO k = 1, klev
+
+          IF(id_prec>0)        d_tr_cv01(i, k) = d_tr_cv_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_cv02(i, k) = d_tr_cv_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_cv03(i, k) = d_tr_cv_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_cv04(i, k) = d_tr_cv_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_cv05(i, k) = d_tr_cv_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_trsp01(i, k) = d_tr_trsp_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_trsp02(i, k) = d_tr_trsp_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_trsp03(i, k) = d_tr_trsp_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_trsp04(i, k) = d_tr_trsp_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_trsp05(i, k) = d_tr_trsp_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_sscav01(i, k) = d_tr_sscav_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_sscav02(i, k) = d_tr_sscav_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_sscav03(i, k) = d_tr_sscav_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_sscav04(i, k) = d_tr_sscav_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_sscav05(i, k) = d_tr_sscav_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_sat01(i, k) = d_tr_sat_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_sat02(i, k) = d_tr_sat_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_sat03(i, k) = d_tr_sat_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_sat04(i, k) = d_tr_sat_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_sat05(i, k) = d_tr_sat_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_uscav01(i, k) = d_tr_uscav_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_uscav02(i, k) = d_tr_uscav_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_uscav03(i, k) = d_tr_uscav_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_uscav04(i, k) = d_tr_uscav_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_uscav05(i, k) = d_tr_uscav_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_insc01(i, k) = d_tr_insc_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_insc02(i, k) = d_tr_insc_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_insc03(i, k) = d_tr_insc_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_insc04(i, k) = d_tr_insc_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_insc05(i, k) = d_tr_insc_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_bcscav01(i, k) = d_tr_bcscav_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_bcscav02(i, k) = d_tr_bcscav_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_bcscav03(i, k) = d_tr_bcscav_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_bcscav04(i, k) = d_tr_bcscav_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_bcscav05(i, k) = d_tr_bcscav_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_evapls01(i, k) = d_tr_evapls_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_evapls02(i, k) = d_tr_evapls_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_evapls03(i, k) = d_tr_evapls_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_evapls04(i, k) = d_tr_evapls_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_evapls05(i, k) = d_tr_evapls_o(i, k, id_scdu)
+        ENDDO
+      ENDDO
+    ELSE ! correction pour fermeture de bilan, par FH dans les simus de Binta pour Habib
+      DO i = 1, klon
+        DO k = 1, klev
+          IF(id_prec>0)        d_tr_cv01(i, k) = d_tr_cv(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_cv02(i, k) = d_tr_cv(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_cv03(i, k) = d_tr_cv(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_cv04(i, k) = d_tr_cv(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_cv05(i, k) = d_tr_cv(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_trsp01(i, k) = d_tr_trsp(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_trsp02(i, k) = d_tr_trsp(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_trsp03(i, k) = d_tr_trsp(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_trsp04(i, k) = d_tr_trsp(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_trsp05(i, k) = d_tr_trsp(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_sscav01(i, k) = d_tr_sscav(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_sscav02(i, k) = d_tr_sscav(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_sscav03(i, k) = d_tr_sscav(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_sscav04(i, k) = d_tr_sscav(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_sscav05(i, k) = d_tr_sscav(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_sat01(i, k) = d_tr_sat(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_sat02(i, k) = d_tr_sat(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_sat03(i, k) = d_tr_sat(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_sat04(i, k) = d_tr_sat(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_sat05(i, k) = d_tr_sat(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_uscav01(i, k) = d_tr_uscav(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_uscav02(i, k) = d_tr_uscav(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_uscav03(i, k) = d_tr_uscav(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_uscav04(i, k) = d_tr_uscav(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_uscav05(i, k) = d_tr_uscav(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_insc01(i, k) = d_tr_insc(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_insc02(i, k) = d_tr_insc(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_insc03(i, k) = d_tr_insc(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_insc04(i, k) = d_tr_insc(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_insc05(i, k) = d_tr_insc(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_bcscav01(i, k) = d_tr_bcscav(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_bcscav02(i, k) = d_tr_bcscav(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_bcscav03(i, k) = d_tr_bcscav(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_bcscav04(i, k) = d_tr_bcscav(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_bcscav05(i, k) = d_tr_bcscav(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_evapls01(i, k) = d_tr_evapls(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_evapls02(i, k) = d_tr_evapls(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_evapls03(i, k) = d_tr_evapls(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_evapls04(i, k) = d_tr_evapls(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_evapls05(i, k) = d_tr_evapls(i, k, id_scdu) / pdtphys
+        ENDDO
+      ENDDO
+    ENDIF
+
+    IF(1==0) THEN  ! This "if" is as in original trunk
+      DO i = 1, klon
+        DO k = 1, klev
+          IF(id_prec>0)        d_tr_ls01(i, k) = d_tr_ls_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_ls02(i, k) = d_tr_ls_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_ls03(i, k) = d_tr_ls_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_ls04(i, k) = d_tr_ls_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_ls05(i, k) = d_tr_ls_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_dyn01(i, k) = d_tr_dyn_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_dyn02(i, k) = d_tr_dyn_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_dyn03(i, k) = d_tr_dyn_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_dyn04(i, k) = d_tr_dyn_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_dyn05(i, k) = d_tr_dyn_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_cl01(i, k) = d_tr_cl_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_cl02(i, k) = d_tr_cl_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_cl03(i, k) = d_tr_cl_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_cl04(i, k) = d_tr_cl_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_cl05(i, k) = d_tr_cl_o(i, k, id_scdu)
+          IF(id_prec>0)        d_tr_th01(i, k) = d_tr_th_o(i, k, id_prec)
+          IF(id_fine>0)        d_tr_th02(i, k) = d_tr_th_o(i, k, id_fine)
+          IF(id_coss>0)        d_tr_th03(i, k) = d_tr_th_o(i, k, id_coss)
+          IF(id_codu>0)        d_tr_th04(i, k) = d_tr_th_o(i, k, id_codu)
+          IF(id_scdu>0)        d_tr_th05(i, k) = d_tr_th_o(i, k, id_scdu)
+        ENDDO
+      ENDDO
+    ELSE
+      DO i = 1, klon
+        DO k = 1, klev
+          IF(id_prec>0)        d_tr_ls01(i, k) = d_tr_ls(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_ls02(i, k) = d_tr_ls(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_ls03(i, k) = d_tr_ls(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_ls04(i, k) = d_tr_ls(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_ls05(i, k) = d_tr_ls(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_dyn01(i, k) = d_tr_dyn(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_dyn02(i, k) = d_tr_dyn(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_dyn03(i, k) = d_tr_dyn(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_dyn04(i, k) = d_tr_dyn(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_dyn05(i, k) = d_tr_dyn(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_cl01(i, k) = d_tr_cl(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_cl02(i, k) = d_tr_cl(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_cl03(i, k) = d_tr_cl(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_cl04(i, k) = d_tr_cl(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_cl05(i, k) = d_tr_cl(i, k, id_scdu) / pdtphys
+          IF(id_prec>0)        d_tr_th01(i, k) = d_tr_th(i, k, id_prec) / pdtphys
+          IF(id_fine>0)        d_tr_th02(i, k) = d_tr_th(i, k, id_fine) / pdtphys
+          IF(id_coss>0)        d_tr_th03(i, k) = d_tr_th(i, k, id_coss) / pdtphys
+          IF(id_codu>0)        d_tr_th04(i, k) = d_tr_th(i, k, id_codu) / pdtphys
+          IF(id_scdu>0)        d_tr_th05(i, k) = d_tr_th(i, k, id_scdu) / pdtphys
+        ENDDO
+      ENDDO
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+
+      dife = clock_end - clock_start
+      ti_outs = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_outs = tia_outs + REAL(ti_outs) / REAL(clock_rate)
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+
+      dife = clock_end - clock_start_spla
+      ti_spla = dife * MAX(0, SIGN(1, dife)) &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+
+      tia_spla = tia_spla + REAL(ti_spla) / REAL(clock_rate)
+      PRINT *, 'times for this timestep:timeproc,timeproc/time_pytracr_spl-'
+      PRINT *, 'time spla', REAL(ti_spla) / REAL(clock_rate)                &
+              , REAL(ti_spla) / REAL(ti_spla)
+      PRINT *, 'time init', REAL(ti_init) / REAL(clock_rate)                &
+              , REAL(ti_init) / REAL(ti_spla)
+      PRINT *, 'time inittype', REAL(ti_inittype) / REAL(clock_rate)        &
+              , REAL(ti_inittype) / REAL(ti_spla)
+      PRINT *, 'time inittwrite', REAL(ti_inittwrite) / REAL(clock_rate)    &
+              , REAL(ti_inittwrite) / REAL(ti_spla)
+      PRINT *, 'time emis', REAL(ti_emis) / REAL(clock_rate)                &
+              , REAL(ti_emis) / REAL(ti_spla)
+      PRINT *, 'time depo ', REAL(ti_depo) / REAL(clock_rate)               &
+              , REAL(ti_depo) / REAL(ti_spla)
+      PRINT *, 'time cltr', REAL(ti_cltr) / REAL(clock_rate)                &
+              , REAL(ti_cltr) / REAL(ti_spla)
+      PRINT *, 'time ther', REAL(ti_ther) / REAL(clock_rate)                &
+              , REAL(ti_ther) / REAL(ti_spla)
+      PRINT *, 'time sedi', REAL(ti_sedi) / REAL(clock_rate)                &
+              , REAL(ti_sedi) / REAL(ti_spla)
+      PRINT *, 'time gas to part', REAL(ti_gasp) / REAL(clock_rate)         &
+              , REAL(ti_gasp) / REAL(ti_spla)
+      PRINT *, 'time AP wet', REAL(ti_wetap) / REAL(clock_rate)             &
+              , REAL(ti_wetap) / REAL(ti_spla)
+      PRINT *, 'time convective', REAL(ti_cvltr) / REAL(clock_rate)         &
+              , REAL(ti_cvltr) / REAL(ti_spla)
+      PRINT *, 'time NP lsc scav', REAL(ti_lscs) / REAL(clock_rate)         &
+              , REAL(ti_lscs) / REAL(ti_spla)
+      PRINT *, 'time opt,brdn,etc', REAL(ti_brop) / REAL(clock_rate)        &
+              , REAL(ti_brop) / REAL(ti_spla)
+      PRINT *, 'time outputs', REAL(ti_outs) / REAL(clock_rate)             &
+              , REAL(ti_outs) / REAL(ti_spla)
+
+      PRINT *, '--time accumulated: time proc, time proc/time phytracr_spl--'
+      PRINT *, 'time spla', tia_spla
+      PRINT *, 'time init', tia_init, tia_init / tia_spla
+      PRINT *, 'time inittype', tia_inittype, tia_inittype / tia_spla
+      PRINT *, 'time inittwrite', tia_inittwrite, tia_inittwrite / tia_spla
+      PRINT *, 'time emis', tia_emis, tia_emis / tia_spla
+      PRINT *, 'time depo', tia_depo, tia_depo / tia_spla
+      PRINT *, 'time cltr', tia_cltr, tia_cltr / tia_spla
+      PRINT *, 'time ther', tia_ther, tia_ther / tia_spla
+      PRINT *, 'time sedi', tia_sedi, tia_sedi / tia_spla
+      PRINT *, 'time gas to part', tia_gasp, tia_gasp / tia_spla
+      PRINT *, 'time AP wet', tia_wetap, tia_wetap / tia_spla
+      PRINT *, 'time convective', tia_cvltr, tia_cvltr / tia_spla
+      PRINT *, 'time NP lsc scav', tia_lscs, tia_lscs / tia_spla
+      PRINT *, 'time opt,brdn,etc', tia_brop, tia_brop / tia_spla
+      PRINT *, 'time outputs', tia_outs, tia_outs / tia_spla
+
+      dife = clock_end_outphytracr - clock_start_outphytracr
+      ti_nophytracr = dife * MAX(0, SIGN(1, dife))  &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_nophytracr = tia_nophytracr + REAL(ti_nophytracr) / REAL(clock_rate)
+      PRINT *, 'Time outside phytracr; Time accum outside phytracr'
+      PRINT*, REAL(ti_nophytracr) / REAL(clock_rate), tia_nophytracr
+
+      clock_start_outphytracr = clock_end
+
+    ENDIF
+    PRINT *, 'END PHYTRACR_SPL '
+    PRINT *, 'lmt_so2ff_l FIN', MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
+
+    !      CALL abort_gcm('TEST1', 'OK1', 1)
+
+  END SUBROUTINE phytracr_spl
+
+  SUBROUTINE readregionsdims2_spl(nbreg, fileregions)
+
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+
+    IMPLICIT NONE
+    CHARACTER*800 fileregions
+    CHARACTER*800 auxstr
+    INTEGER nbreg
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregions)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg
+      CLOSE(UNIT = 1)
+    ENDIF
+    CALL bcast(nbreg)
+
+  END SUBROUTINE readregionsdims2_spl
+
+  SUBROUTINE readregionsdims_spl(nbreg_ind, fileregionsdimsind, &
+          nbreg_dust, fileregionsdimsdust, &
+          nbreg_bb, fileregionsdimsbb)
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+
+    IMPLICIT NONE
+    CHARACTER*800 fileregionsdimsind
+    CHARACTER*800 fileregionsdimsdust
+    CHARACTER*800 fileregionsdimsbb
+    CHARACTER*800 auxstr
+    INTEGER nbreg_ind, nbreg_dust, nbreg_bb
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsind)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg_ind
+      CLOSE(UNIT = 1)
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsdust)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg_dust
+      CLOSE(UNIT = 1)
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsbb)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg_bb
+      CLOSE(UNIT = 1)
+
+    ENDIF
+    CALL bcast(nbreg_ind)
+    CALL bcast(nbreg_dust)
+    CALL bcast(nbreg_bb)
+
+  END SUBROUTINE readregionsdims_spl
+
+  SUBROUTINE readregions_spl(iregion, filenameregion)
+    USE dimphy
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+
+    IMPLICIT NONE
+    CHARACTER*(*) filenameregion
+    INTEGER iregion(klon)
+    INTEGER iregion_glo(klon_glo)
+    INTEGER k
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+
+      PRINT *, trim(adjustl(filenameregion))
+      OPEN(1, file = trim(adjustl(filenameregion)))
+      DO k = 1, klon_glo
+        READ(1, '(i10)') iregion_glo(k)
+      ENDDO
+      CLOSE(UNIT = 1)
+    ENDIF
+    CALL scatter(iregion_glo, iregion)
+
+  END SUBROUTINE readregions_spl
+
+  !! AS: SUBROUTINE readscaleparams_spl pas appellee
+  SUBROUTINE readscaleparams_spl(scale_param, nbreg, &
+          filescaleparams)
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+    IMPLICIT NONE
+
+    CHARACTER*800 filescaleparams
+    INTEGER nbreg
+    REAL scale_param(nbreg)
+    INTEGER k
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+      OPEN(1, file = trim(adjustl(filescaleparams)), form = 'unformatted')
+      DO k = 1, nbreg
+        read(1)  scale_param(k)
+      enddo
+      CLOSE(1)
+    ENDIF
+    CALL bcast(scale_param)
+    !      PRINT *,'holaaaaaaaaaaaa'
+    !      PRINT *,scale_param
+
+  END SUBROUTINE readscaleparams_spl
+
+  SUBROUTINE readscaleparamsnc_spl(scale_param_ind, &
+          nbreg_ind, paramname_ind, &
+          scale_param_ff, nbreg_ff, paramname_ff, &
+          scale_param_bb, nbreg_bb, paramname_bb, &
+          scale_param_dustacc, nbreg_dustacc, paramname_dustacc, &
+          scale_param_dustcoa, nbreg_dustcoa, paramname_dustcoa, &
+          scale_param_dustsco, nbreg_dustsco, paramname_dustsco, &
+          param_wstarBLperregion, nbreg_wstardustBL, paramname_wstarBL, &
+          param_wstarWAKEperregion, nbreg_wstardustWAKE, paramname_wstarWAKE, &
+          scale_param_ssacc, paramname_ssacc, &
+          scale_param_sscoa, paramname_sscoa, &
+          filescaleparams, julien, jH_phys, pdtphys, debutphy)
+    !      SUBROUTINE readscaleparamsnc_spl(scale_param, nbreg, &
+    !                                        filescaleparams,paramname,&
+    !                                        julien,jH_phys, pdtphys,debutphy)
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+    IMPLICIT NONE
+
+    CHARACTER*800 filescaleparams
+    CHARACTER*100 paramname_ind, paramname_ff, paramname_bb
+    CHARACTER*100 paramname_dustacc, paramname_dustcoa
+    CHARACTER*100 paramname_dustsco
+    CHARACTER*100 paramname_ssacc
+    CHARACTER*100 paramname_sscoa
+    CHARACTER*100 paramname_wstarBL
+    CHARACTER*100 paramname_wstarWAKE
+
+    INTEGER nbreg, iday
+    INTEGER nbreg_ind, nbreg_ff, nbreg_bb, nbreg_dustacc
+    INTEGER nbreg_dustcoa, nbreg_dustsco, nbreg_wstardustBL
+    INTEGER  nbreg_wstardustWAKE
+    INTEGER, PARAMETER :: nbreg_ssacc = 1
+    INTEGER, PARAMETER :: nbreg_sscoa = 1
+    REAL, PARAMETER :: sca_resol = 24. ! resolution of scalig params in hours
+    REAL scale_param_ind(nbreg_ind)
+    REAL scale_param_bb(nbreg_bb)
+    REAL scale_param_ff(nbreg_ff)
+    REAL scale_param_dustacc(nbreg_dustacc)
+    REAL scale_param_dustcoa(nbreg_dustcoa)
+    REAL scale_param_dustsco(nbreg_dustsco)
+    REAL param_wstarBLperregion(nbreg_wstardustBL)
+    REAL param_wstarWAKEperregion(nbreg_wstardustWAKE)
+    REAL scale_param_ssacc
+    REAL scale_param_ssacc_tmp(nbreg_ssacc)
+    REAL scale_param_sscoa
+    REAL scale_param_sscoa_tmp(nbreg_sscoa)
+
+    INTEGER k, step_sca, test_sca
+    REAL :: jH_phys, pdtphys
+    REAL, SAVE :: jH_sca, jH_ini
+    INTEGER julien
+    LOGICAL debutphy
+    SAVE step_sca, test_sca, iday
+    !$OMP THREADPRIVATE(step_sca,test_sca,iday)
+    !$OMP THREADPRIVATE(jH_sca,jH_ini)
+
+    IF (debutphy) THEN
+      iday = julien
+      step_sca = 1
+      test_sca = 0
+      jH_ini = jH_phys
+      jH_sca = jH_phys
+    ENDIF
+
+    IF (test_sca == 0) THEN
+      ! READ file!!
+      CALL read_scalenc(filescaleparams, paramname_ind, &
+              nbreg_ind, step_sca, &
+              scale_param_ind)
+      CALL read_scalenc(filescaleparams, paramname_bb, &
+              nbreg_bb, step_sca, &
+              scale_param_bb)
+      CALL read_scalenc(filescaleparams, paramname_ff, &
+              nbreg_ff, step_sca, &
+              scale_param_ff)
+      CALL read_scalenc(filescaleparams, paramname_dustacc, &
+              nbreg_dustacc, step_sca, &
+              scale_param_dustacc)
+      CALL read_scalenc(filescaleparams, paramname_dustcoa, &
+              nbreg_dustcoa, step_sca, &
+              scale_param_dustcoa)
+      CALL read_scalenc(filescaleparams, paramname_dustsco, &
+              nbreg_dustsco, step_sca, &
+              scale_param_dustsco)
+      CALL read_scalenc(filescaleparams, paramname_wstarBL, &
+              nbreg_wstardustBL, step_sca, &
+              param_wstarBLperregion)
+      CALL read_scalenc(filescaleparams, paramname_wstarWAKE, &
+              nbreg_wstardustWAKE, step_sca, &
+              param_wstarWAKEperregion)
+      CALL read_scalenc(filescaleparams, paramname_ssacc, &
+              nbreg_ssacc, step_sca, &
+              scale_param_ssacc_tmp)
+      CALL read_scalenc(filescaleparams, paramname_sscoa, &
+              nbreg_sscoa, step_sca, &
+              scale_param_sscoa_tmp)
+      scale_param_ssacc = scale_param_ssacc_tmp(1)
+      scale_param_sscoa = scale_param_sscoa_tmp(1)
+
+      !PRINT *,'JEREADFILE',julien,jH_phys
+      step_sca = step_sca + 1
+      test_sca = 1
+    ENDIF
+
+    jH_sca = jH_sca + pdtphys / (24. * 3600.)
+    IF (jH_sca>(sca_resol) / 24.) THEN
+      test_sca = 0
+      jH_sca = jH_ini
+    ENDIF
+
+  END SUBROUTINE readscaleparamsnc_spl
+
+  SUBROUTINE read_scalenc(filescaleparams, paramname, nbreg, step_sca, &
+          scale_param)
+
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+    USE netcdf, ONLY: nf90_open, nf90_close, nf90_inq_varid, nf90_nowrite, nf90_noerr, nf90_get_var
+    IMPLICIT NONE
+
+    CHARACTER*800 filescaleparams
+    CHARACTER*100 paramname
+    INTEGER nbreg, step_sca
+    REAL scale_param(nbreg)
+    !local vars
+    INTEGER nid, ierr, nvarid
+    REAL rcode, auxreal
+    INTEGER start(4), count(4), status
+    !      local
+    CHARACTER*104 varname
+    CHARACTER*2 aux_2s
+    INTEGER i, j, ig
+    !$OMP MASTER
+    IF (is_mpi_root .AND. is_omp_root) THEN
+      ierr = nf90_open(trim(adjustl(filescaleparams)), nf90_nowrite, nid)
+      IF (ierr == nf90_noerr) THEN
+        DO i = 1, nbreg
+          WRITE(aux_2s, '(i2.2)') i
+          varname = trim(adjustl(paramname)) // aux_2s
+          PRINT *, varname
+          ierr = nf90_inq_varid(nid, trim(adjustl(varname)), nvarid)
+          ierr = nf90_get_var(nid, nvarid, auxreal, [step_sca])
+          IF (ierr /= nf90_noerr) THEN
+            PRINT*, 'Pb de lecture pour modvalues'
+            PRINT *, 'JE  scale_var, step_sca', trim(adjustl(varname)), step_sca
+            CALL HANDLE_ERR(ierr)
+            PRINT *, 'error ierr= ', ierr
+            CALL exit(1)
+            CALL abort_gcm('read_scalenc', 'error reading variable', 1)
+          ENDIF
+
+          PRINT *, auxreal
+          scale_param(i) = auxreal
+        enddo
+
+        ierr = nf90_close(nid)
+      else
+        PRINT *, 'File ' // trim(adjustl(filescaleparams)) // ' not found'
+        PRINT *, 'doing nothing...'
+      endif
+
+    ENDIF ! mpi_root
+    !$OMP END MASTER
+    !$OMP BARRIER
+    !      CALL scatter(var local _glo,var local) o algo asi
+    CALL bcast(scale_param)
+  END SUBROUTINE read_scalenc
+
+
+END MODULE lmdz_phytracr_spl
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_precuremission.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_precuremission.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_precuremission.f90	(revision 5160)
@@ -0,0 +1,268 @@
+MODULE lmdz_precureemission
+  IMPLICIT NONE; PRIVATE
+  PUBLIC precuremission
+
+CONTAINS
+
+  ! Subroutine that calculates the emission of aerosols precursors
+  SUBROUTINE precuremission(ftsol, u10m_ec, v10m_ec, &
+          pctsrf, u_seri, v_seri, paprs, pplay, cdragh, &
+          cdragm, t_seri, q_seri, tsol, fracso2emis, &
+          frach2sofso2, bateau, zdz, zalt, &
+          kminbc, kmaxbc, pdtphys, scale_param_bb, &
+          scale_param_ind, iregion_ind, iregion_bb, &
+          nbreg_ind, nbreg_bb, &
+          lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, &
+          lmt_so2ba, lmt_so2bb_l, lmt_so2bb_h, &
+          lmt_so2volc_cont, lmt_altvolc_cont, &
+          lmt_so2volc_expl, lmt_altvolc_expl, &
+          lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &
+          lmt_dms, id_prec, id_fine, &
+          flux_sparam_ind, flux_sparam_bb, &
+          source_tr, flux_tr, tr_seri)
+
+    USE dimphy
+    USE indice_sol_mod
+    USE infotrac
+    USE lmdz_yomcst
+
+    USE lmdz_paramet
+    USE lmdz_chem, ONLY: masse_s
+    USE lmdz_chem_spla, ONLY: masse_ammsulfate
+    IMPLICIT NONE
+
+    !============================= INPUT ===================================
+    INTEGER :: kminbc, kmaxbc
+    REAL :: ftsol(klon, nbsrf)  ! temperature du sol par type
+    REAL :: tsol(klon)         ! temperature du sol moyenne
+    REAL :: t_seri(klon, klev)  ! temperature
+    REAL :: u_seri(klon, klev)  ! vent
+    REAL :: v_seri(klon, klev)  ! vent
+    REAL :: q_seri(klon, klev)  ! vapeur d eau kg/kg
+    REAL :: u10m_ec(klon), v10m_ec(klon)  ! vent a 10 metres
+    REAL :: pctsrf(klon, nbsrf)
+    REAL :: pdtphys  ! pas d'integration pour la physique (seconde)
+    REAL :: paprs(klon, klev + 1)  ! pression pour chaque inter-couche (en Pa)
+    REAL :: pplay(klon, klev)  ! pression pour le mileu de chaque couche (en Pa)
+    REAL :: cdragh(klon), cdragm(klon)
+    REAL :: fracso2emis        !--fraction so2 emis en so2
+    REAL :: frach2sofso2       !--fraction h2s from so2
+    REAL :: zdz(klon, klev)
+    LOGICAL :: edgar, bateau
+    INTEGER :: id_prec, id_fine
+
+    !------------------------- Scaling Parameters --------------------------
+
+    INTEGER :: nbreg_ind, nbreg_bb
+    INTEGER :: iregion_ind(klon)  !Defines regions for SO2, BC & OM
+    INTEGER :: iregion_bb(klon)  !Defines regions for SO2, BC & OM
+    REAL :: scale_param_bb(nbreg_bb)  !Scaling parameter for biomas burning
+    REAL :: scale_param_ind(nbreg_ind) !Scaling parameter for industrial emissions
+
+    !============================= OUTPUT ==================================
+
+    REAL :: source_tr(klon, nbtr)
+    REAL :: flux_tr(klon, nbtr)
+    REAL :: tr_seri(klon, klev, nbtr) ! traceur
+    REAL :: flux_sparam_ind(klon), flux_sparam_bb(klon)
+    !========================= LOCAL VARIABLES =============================
+    INTEGER :: i, k, kkk_cont(klon), kkk_expl(klon)
+    REAL :: zalt(klon, klev), zaltmid(klon, klev)
+    REAL :: zzdz
+    !------------------------- SULFUR emissions ----------------------------
+    REAL :: lmt_so2volc_cont(klon)  ! emissions so2 volcan (continuous)
+    REAL :: lmt_altvolc_cont(klon)  ! altitude  so2 volcan (continuous)
+    REAL :: lmt_so2volc_expl(klon)  ! emissions so2 volcan (explosive)
+    REAL :: lmt_altvolc_expl(klon)  ! altitude  so2 volcan (explosive)
+    REAL :: lmt_so2ff_l(klon)       ! emissions so2 fossil fuel (low)
+    REAL :: lmt_so2ff_h(klon)       ! emissions so2 fossil fuel (high)
+    REAL :: lmt_so2nff(klon)        ! emissions so2 non-fossil fuel
+    REAL :: lmt_so2bb_l(klon)       ! emissions de so2 biomass burning (low)
+    REAL :: lmt_so2bb_h(klon)       ! emissions de so2 biomass burning (high)
+    REAL :: lmt_so2ba(klon)         ! emissions de so2 bateau
+    REAL :: lmt_dms(klon)           ! emissions de dms
+    REAL :: lmt_dmsconc(klon)       ! concentration de dms oceanique
+    REAL :: lmt_dmsbio(klon)        ! emissions de dms bio
+    REAL :: lmt_h2sbio(klon)        ! emissions de h2s bio
+
+    EXTERNAL condsurfs, liss, nightingale
+    !=========================================================================
+    ! Modifications introduced by NHL
+    ! -Variables to save fluxes were introduced
+    ! -lmt_so2ba was multiplied by fracso2emis in line 117
+    ! -scale_param_bb was introduced in line 105
+    ! The last two modifications were errors existing in the original version
+    !=========================================================================
+    !=========================================================================
+    ! LOW LEVEL EMISSIONS
+    !=========================================================================
+
+    CALL nightingale(u_seri, v_seri, u10m_ec, v10m_ec, paprs, &
+            pplay, cdragh, cdragm, t_seri, q_seri, ftsol, &
+            tsol, pctsrf, lmt_dmsconc, lmt_dms)
+
+    IF (.NOT.bateau) THEN
+      DO i = 1, klon
+        lmt_so2ba(i) = 0.0
+      ENDDO
+    ENDIF
+
+    DO i = 1, klon
+      IF (iregion_ind(i)>0) THEN
+        IF(id_prec>0) source_tr(i, id_prec) = source_tr(i, id_prec) &
+                + fracso2emis &
+                        * scale_param_ind(iregion_ind(i)) * lmt_so2ff_l(i) * 1.e4 &
+                + scale_param_ind(iregion_ind(i)) * lmt_so2ff_l(i) * 1.e4 &
+                        * frach2sofso2            ! molec/m2/s
+
+        IF(id_fine>0) source_tr(i, id_fine) = &
+                source_tr(i, id_fine) + (1 - fracso2emis) &
+                        * scale_param_ind(iregion_ind(i)) * lmt_so2ff_l(i) &
+                        * 1.e4 * masse_ammsulfate / RNAVO  ! g/m2/s
+
+        IF(id_prec>0)   flux_tr(i, id_prec) = flux_tr(i, id_prec) + (&
+                scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
+                        lmt_so2ff_h(i)) &
+                        * frach2sofso2 &
+                        + scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
+                        lmt_so2ff_h(i)) &
+                        * fracso2emis &
+                ) * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
+
+        IF(id_fine>0)  flux_tr(i, id_fine) = &
+                flux_tr(i, id_fine) + (1 - fracso2emis) &
+                        * scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
+                        lmt_so2ff_h(i)) &
+                        * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
+
+        flux_sparam_ind(i) = flux_sparam_ind(i) + (1 - fracso2emis) &
+                * scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
+                lmt_so2ff_h(i)) &
+                * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
+      ENDIF
+      IF (iregion_bb(i)>0) THEN
+        IF(id_prec>0) source_tr(i, id_prec) = &
+                source_tr(i, id_prec) + fracso2emis &
+                        * scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) &
+                        * (1. - pctsrf(i, is_oce)) * 1.e4
+
+        IF(id_fine>0)     source_tr(i, id_fine) = &
+                source_tr(i, id_fine) + (1 - fracso2emis) &
+                        * scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) * &
+                        (1. - pctsrf(i, is_oce)) * 1.e4 * &
+                        masse_ammsulfate / RNAVO  ! g/m2/s
+
+        IF(id_prec>0)     flux_tr(i, id_prec) = flux_tr(i, id_prec) + &
+                (scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) &
+                        + scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i)) &
+                        * (1. - pctsrf(i, is_oce)) * fracso2emis &
+                        * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
+
+        IF(id_fine>0) flux_tr(i, id_fine) = &
+                flux_tr(i, id_fine) + (1 - fracso2emis) &
+                        * (scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) &
+                                + scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i)) &
+                        * (1. - pctsrf(i, is_oce)) &
+                        * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
+
+        flux_sparam_bb(i) = &
+                scale_param_bb(iregion_bb(i)) * (lmt_so2bb_l(i) + &
+                        lmt_so2bb_h(i)) &
+                        * (1. - pctsrf(i, is_oce)) * fracso2emis &
+                        * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
+        flux_sparam_bb(i) = flux_sparam_bb(i) + (1 - fracso2emis) * &
+                (scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) + &
+                        scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i)) &
+                * (1. - pctsrf(i, is_oce)) &
+                * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
+      ENDIF
+      IF(id_prec>0)   source_tr(i, id_prec) = source_tr(i, id_prec) &
+              + fracso2emis &
+                      * (lmt_so2ba(i) + lmt_so2nff(i)) * 1.e4 &
+              + (lmt_h2sbio(i) &
+                      + lmt_dms(i) + lmt_dmsbio(i)) * 1.e4            ! molec/m2/s
+
+      IF(id_fine>0)   source_tr(i, id_fine) = source_tr(i, id_fine) &
+              + (1 - fracso2emis) &
+                      * (lmt_so2ba(i) + lmt_so2nff(i)) * 1.e4 * &
+                      masse_ammsulfate / RNAVO  ! g/m2/s
+
+      IF(id_prec>0)   flux_tr(i, id_prec) = flux_tr(i, id_prec) &
+              + (lmt_h2sbio(i) &
+                      + lmt_so2volc_cont(i) + lmt_so2volc_expl(i) &
+                      + (lmt_so2ba(i) + lmt_so2nff(i)) * fracso2emis &
+                      + lmt_dms(i) + lmt_dmsbio(i)) &
+                      * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
+
+      IF(id_fine>0)   flux_tr(i, id_fine) = flux_tr(i, id_fine) &
+              + (1 - fracso2emis) &
+                      * (lmt_so2ba(i) + lmt_so2nff(i)) &
+                      * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
+
+      flux_sparam_ind(i) = flux_sparam_ind(i) + (1 - fracso2emis) &
+              * lmt_so2nff(i) &
+              * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
+
+    ENDDO
+
+    !========================================================================
+    ! HIGH LEVEL EMISSIONS
+    !========================================================================
+    !  Source de SO2 volcaniques
+    DO i = 1, klon
+      kkk_cont(i) = 1
+      kkk_expl(i) = 1
+    ENDDO
+    DO k = 1, klev - 1
+      DO i = 1, klon
+        zaltmid(i, k) = zalt(i, k) + zdz(i, k) / 2.
+        IF (zalt(i, k + 1)<lmt_altvolc_cont(i)) kkk_cont(i) = k + 1
+        IF (zalt(i, k + 1)<lmt_altvolc_expl(i)) kkk_expl(i) = k + 1
+      ENDDO
+    ENDDO
+    IF(id_prec>0) THEN
+      DO i = 1, klon
+        tr_seri(i, kkk_cont(i), id_prec) = tr_seri(i, kkk_cont(i), id_prec) + &
+                lmt_so2volc_cont(i) / zdz(i, kkk_cont(i)) / 100. * pdtphys
+        tr_seri(i, kkk_expl(i), id_prec) = tr_seri(i, kkk_expl(i), id_prec) + &
+                lmt_so2volc_expl(i) / zdz(i, kkk_expl(i)) / 100. * pdtphys
+      ENDDO
+    ENDIF
+    !  Sources hautes de SO2
+
+
+    !--only GEIA SO2 emissions has high emissions
+    !--unit: molec/cm2/s divided by layer height (in cm) multiplied by timestep
+
+    k = 2                             !introducing emissions in level 2
+    DO i = 1, klon
+
+      IF (iregion_bb(i)>0) THEN
+        IF(id_prec>0)   tr_seri(i, k, id_prec) = &
+                tr_seri(i, k, id_prec) + fracso2emis &
+                        * scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i) &
+                        / zdz(i, k) / 100. * pdtphys
+
+        IF(id_fine>0)     tr_seri(i, k, id_fine) = tr_seri(i, k, id_fine) &
+                + (1. - fracso2emis) &
+                        * scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i) &
+                        * masse_ammsulfate / RNAVO / zdz(i, k) / 100. * pdtphys   !g/cm3
+      ENDIF
+      IF (iregion_ind(i)>0) THEN
+        IF(id_prec>0)  tr_seri(i, k, id_prec) = &
+                tr_seri(i, k, id_prec) + (fracso2emis &
+                        * scale_param_ind(iregion_ind(i)) * lmt_so2ff_h(i) &
+                        + frach2sofso2 &
+                                * scale_param_ind(iregion_ind(i)) * lmt_so2ff_h(i)) &
+                        / zdz(i, k) / 100. * pdtphys
+
+        IF(id_fine>0)    tr_seri(i, k, id_fine) = tr_seri(i, k, id_fine) &
+                + (1. - fracso2emis) &
+                        * scale_param_ind(iregion_ind(i)) * lmt_so2ff_h(i) &
+                        * masse_ammsulfate / RNAVO / zdz(i, k) / 100. * pdtphys   !g/cm3
+      ENDIF
+
+    ENDDO
+
+  END SUBROUTINE precuremission
+END MODULE lmdz_precureemission
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_read_newemissions.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_read_newemissions.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_read_newemissions.f90	(revision 5160)
@@ -0,0 +1,372 @@
+MODULE lmdz_read_newemissions
+  IMPLICIT NONE; PRIVATE
+  PUBLIC read_newemissions
+
+CONTAINS
+
+  ! Routine to read the emissions of the different species
+  SUBROUTINE read_newemissions(julien, jH_emi, edgar, flag_dms, &
+          debutphy, &
+          pdtphys, lafinphy, nbjour, pctsrf, &
+          t_seri, xlat, xlon, &
+          pmflxr, pmflxs, prfl, psfl, &
+          u10m_ec, v10m_ec, dust_ec, &
+          lmt_sea_salt, lmt_so2ff_l, &
+          lmt_so2ff_h, lmt_so2nff, lmt_so2ba, &
+          lmt_so2bb_l, lmt_so2bb_h, &
+          lmt_so2volc_cont, lmt_altvolc_cont, &
+          lmt_so2volc_expl, lmt_altvolc_expl, &
+          lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &
+          lmt_bcff, lmt_bcnff, lmt_bcbb_l, &
+          lmt_bcbb_h, lmt_bcba, lmt_omff, &
+          lmt_omnff, lmt_ombb_l, lmt_ombb_h, &
+          lmt_omnat, lmt_omba)
+
+    USE dimphy
+    USE indice_sol_mod
+    USE lmdz_grid_phy
+    USE lmdz_phys_para
+    USE lmdz_ssum_scopy, ONLY: scopy
+    USE lmdz_paramet
+    USE lmdz_chem_spla, ONLY: ss_bins, masse_ammsulfate
+    USE lmdz_seasalt, ONLY: seasalt
+
+    IMPLICIT NONE
+
+    LOGICAL :: debutphy, lafinphy, edgar
+    INTEGER :: test_vent, test_day, step_vent, flag_dms, nbjour
+    INTEGER :: julien, i, iday
+    SAVE step_vent, test_vent, test_day, iday
+    !$OMP THREADPRIVATE(step_vent, test_vent, test_day, iday)
+    REAL :: pct_ocean(klon), pctsrf(klon, nbsrf)
+    REAL :: pdtphys  ! pas d'integration pour la physique (seconde)
+    REAL :: t_seri(klon, klev)  ! temperature
+
+    REAL :: xlat(klon)       ! latitudes pour chaque point
+    REAL :: xlon(klon)       ! longitudes pour chaque point
+
+
+    !   Emissions:
+    !   ---------
+
+    !---------------------------- SEA SALT & DUST emissions ------------------------
+    REAL :: lmt_sea_salt(klon, ss_bins) !Sea salt 0.03-8.0 um !NOT SAVED OK
+    REAL :: clyfac, avgdryrate, drying
+    ! je      REAL u10m_ec1(klon), v10m_ec1(klon), dust_ec1(klon)
+    ! je      REAL u10m_ec2(klon), v10m_ec2(klon), dust_ec2(klon)
+
+    REAL, SAVE, ALLOCATABLE :: u10m_ec1(:), v10m_ec1(:), dust_ec1(:)
+    REAL, SAVE, ALLOCATABLE :: u10m_ec2(:), v10m_ec2(:), dust_ec2(:)
+    !$OMP THREADPRIVATE(u10m_ec1, v10m_ec1, dust_ec1)
+    !$OMP THREADPRIVATE(u10m_ec2, v10m_ec2, dust_ec2)
+    ! as      REAL u10m_nc(iip1,jjp1), v10m_nc(iip1,jjp1)
+    REAL :: u10m_ec(klon), v10m_ec(klon), dust_ec(klon)
+    !      REAL cly(klon), wth(klon), zprecipinsoil(klon)
+    REAL, SAVE, ALLOCATABLE :: cly(:), wth(:), zprecipinsoil(:)
+    REAL :: cly_glo(klon_glo), wth_glo(klon_glo)
+    REAL :: zprecipinsoil_glo(klon_glo)
+    !$OMP THREADPRIVATE(cly,wth,zprecipinsoil)
+
+
+    ! je     SAVE u10m_ec2, v10m_ec2, dust_ec2
+    ! je      SAVE u10m_ec1, v10m_ec1, dust_ec1   ! Added on titane
+    ! je      SAVE cly, wth, zprecipinsoil        ! Added on titane
+    ! SAVE cly, wth, zprecipinsoil, u10m_ec2, v10m_ec2, dust_ec2
+    !------------------------- BLACK CARBON emissions ----------------------
+    REAL :: lmt_bcff(klon)       ! emissions de BC fossil fuels
+    REAL :: lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
+    REAL :: lmt_bcbb_l(klon)     ! emissions de BC biomass basses
+    REAL :: lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
+    REAL :: lmt_bcba(klon)       ! emissions de BC bateau
+    !------------------------ ORGANIC MATTER emissions ---------------------
+    REAL :: lmt_omff(klon)     ! emissions de OM fossil fuels
+    REAL :: lmt_omnff(klon)    ! emissions de OM non-fossil fuels
+    REAL :: lmt_ombb_l(klon)   ! emissions de OM biomass basses
+    REAL :: lmt_ombb_h(klon)   ! emissions de OM biomass hautes
+    REAL :: lmt_omnat(klon)    ! emissions de OM Natural
+    REAL :: lmt_omba(klon)     ! emissions de OM bateau
+    !------------------------- SULFUR emissions ----------------------------
+    REAL :: lmt_so2ff_l(klon)       ! emissions so2 fossil fuels (low)
+    REAL :: lmt_so2ff_h(klon)       ! emissions so2 fossil fuels (high)
+    REAL :: lmt_so2nff(klon)        ! emissions so2 non-fossil fuels
+    REAL :: lmt_so2bb_l(klon)       ! emissions de so2 biomass burning basse
+    REAL :: lmt_so2bb_h(klon)       ! emissions de so2 biomass burning hautes
+    REAL :: lmt_so2ba(klon)         ! emissions de so2 bateau
+    REAL :: lmt_so2volc_cont(klon)  ! emissions so2 volcan continuous
+    REAL :: lmt_altvolc_cont(klon)  ! altitude  so2 volcan continuous
+    REAL :: lmt_so2volc_expl(klon)  ! emissions so2 volcan explosive
+    REAL :: lmt_altvolc_expl(klon)  ! altitude  so2 volcan explosive
+    REAL :: lmt_dmsconc(klon)       ! concentration de dms oceanique
+    REAL :: lmt_dmsbio(klon)        ! emissions de dms bio
+    REAL :: lmt_h2sbio(klon)        ! emissions de h2s bio
+
+    REAL, SAVE, ALLOCATABLE :: lmt_dms(:)           ! emissions de dms
+    !$OMP THREADPRIVATE(lmt_dms)
+
+    !  Lessivage
+    !  ---------
+
+    REAL :: pmflxr(klon, klev + 1), pmflxs(klon, klev + 1) !--convection
+    REAL :: prfl(klon, klev + 1), psfl(klon, klev + 1)   !--large-scale
+    ! REAL pmflxr(klon,klev), pmflxs(klon,klev) !--convection
+    ! REAL prfl(klon,klev),   psfl(klon,klev)   !--large-scale
+
+    !  Variable interne
+    !  ----------------
+
+    INTEGER :: icount
+    REAL :: tau_1, tau_2
+    REAL :: max_flux, min_flux
+    INTRINSIC MIN, MAX
+
+    ! JE: Changes due to new pdtphys in new physics.
+    !  REAL windintime ! time in hours of the wind input files resolution
+    !  REAL dayemintime ! time in hours of the other emissions input files resolution
+    REAL :: jH_init ! shift in the hour (count as days) respecto to
+    ! realhour = (pdtphys*i)/3600/24 -days_elapsed
+    REAL :: jH_emi, jH_vent, jH_day
+    SAVE jH_init, jH_vent, jH_day
+    !$OMP THREADPRIVATE(jH_init,jH_vent,jH_day)
+    REAL, PARAMETER :: vent_resol = 6. ! resolution of winds in hours
+    REAL, PARAMETER :: day_resol = 24. ! resolution of daily emmis. in hours
+    ! INTEGER   test_day1
+    ! SAVE test_day1
+    ! REAL tau_1j,tau_2j
+    ! je
+    ! allocate if necessary
+    !
+
+    IF (.NOT. ALLOCATED(u10m_ec1)) ALLOCATE(u10m_ec1(klon))
+    IF (.NOT. ALLOCATED(v10m_ec1)) ALLOCATE(v10m_ec1(klon))
+    IF (.NOT. ALLOCATED(dust_ec1)) ALLOCATE(dust_ec1(klon))
+    IF (.NOT. ALLOCATED(u10m_ec2)) ALLOCATE(u10m_ec2(klon))
+    IF (.NOT. ALLOCATED(v10m_ec2)) ALLOCATE(v10m_ec2(klon))
+    IF (.NOT. ALLOCATED(dust_ec2)) ALLOCATE(dust_ec2(klon))
+    IF (.NOT. ALLOCATED(cly)) ALLOCATE(cly(klon))
+    IF (.NOT. ALLOCATED(wth)) ALLOCATE(wth(klon))
+    IF (.NOT. ALLOCATED(zprecipinsoil)) ALLOCATE(zprecipinsoil(klon))
+    IF (.NOT. ALLOCATED(lmt_dms)) ALLOCATE(lmt_dms(klon))
+    ! end je nov2013
+
+    !***********************************************************************
+    ! DUST EMISSIONS
+    !***********************************************************************
+
+    IF (debutphy) THEN
+      !---Fields are read only at the beginning of the period
+      !--reading wind and dust
+      iday = julien
+      step_vent = 1
+      test_vent = 0
+      test_day = 0
+      CALL read_vent(.TRUE., step_vent, nbjour, u10m_ec2, v10m_ec2)
+      PRINT *, 'Read (debut) dust emissions: step_vent,julien,nbjour', &
+              step_vent, julien, nbjour
+      CALL read_dust(.TRUE., step_vent, nbjour, dust_ec2)
+      ! Threshold velocity map
+      !$OMP MASTER
+      IF (is_mpi_root .AND. is_omp_root) THEN
+        zprecipinsoil_glo(:) = 0.0
+        OPEN(51, file = 'wth.dat', status = 'unknown', form = 'formatted')
+        READ(51, '(G18.10)') (wth_glo(i), i = 1, klon_glo)
+        CLOSE(51)
+        ! Clay content
+        OPEN(52, file = 'cly.dat', status = 'unknown', form = 'formatted')
+        READ(52, '(G18.10)') (cly_glo(i), i = 1, klon_glo)
+        CLOSE(52)
+        OPEN(53, file = 'precipinsoil.dat', &
+                status = 'old', form = 'formatted', err = 999)
+        READ(53, '(G18.10)') (zprecipinsoil_glo(i), i = 1, klon_glo)
+        PRINT *, 'lecture precipinsoil.dat'
+        999   CONTINUE
+        CLOSE(53)
+      ENDIF
+      !$OMP END MASTER
+      !$OMP BARRIER
+      CALL scatter(wth_glo, wth)
+      CALL scatter(cly_glo, cly)
+      CALL scatter(zprecipinsoil_glo, zprecipinsoil)
+
+      !JE20140908<<        GOTO 1000
+      ! DO i=1, klon
+      !   zprecipinsoil(i)=0.0
+      ! ENDDO
+      ! 1000   CLOSE(53)
+      !JE20140908>>
+      jH_init = jH_emi
+      jH_vent = jH_emi
+      jH_day = jH_emi
+      ! test_day1=0
+      !JE end
+      !
+
+    ENDIF !--- debutphy
+
+    PRINT *, 'READ_EMISSION: test_vent & test_day = ', test_vent, &
+            test_day
+    IF (test_vent==0) THEN    !--on lit toutes les 6 h
+      CALL SCOPY(klon, u10m_ec2, 1, u10m_ec1, 1)
+      CALL SCOPY(klon, v10m_ec2, 1, v10m_ec1, 1)
+      CALL SCOPY(klon, dust_ec2, 1, dust_ec1, 1)
+      step_vent = step_vent + 1
+      ! !PRINT *,'step_vent=', step_vent
+      CALL read_vent(.FALSE., step_vent, nbjour, u10m_ec2, v10m_ec2)
+      PRINT *, 'Reading dust emissions: step_vent, julien, nbjour ', &
+              step_vent, julien, nbjour
+      ! !PRINT *,'test_vent, julien = ',test_vent, julien
+      CALL read_dust(.FALSE., step_vent, nbjour, dust_ec2)
+
+    ENDIF !--test_vent
+
+    ! ubicacion original
+    !  test_vent=test_vent+1
+    !  IF (test_vent.EQ.(6*2)) test_vent=0 !on remet a zero ttes les 6 h
+
+    !JE      tau_2=FLOAT(test_vent)/12.
+    !JE      tau_1=1.-tau_2
+    tau_2 = (jH_vent - jH_init) * 24. / (vent_resol)
+    tau_1 = 1. - tau_2
+    ! PRINT*,'JEdec jHv,JHi,ventres',jH_vent,jH_init,vent_resol
+    ! PRINT*,'JEdec tau2,tau1',tau_2,tau_1
+    ! PRINT*,'JEdec step_vent',step_vent
+    DO i = 1, klon
+      ! PRINT*,'JE tau_2,tau_2j',tau_2,tau_2j
+      u10m_ec(i) = tau_1 * u10m_ec1(i) + tau_2 * u10m_ec2(i)
+      v10m_ec(i) = tau_1 * v10m_ec1(i) + tau_2 * v10m_ec2(i)
+      dust_ec(i) = tau_1 * dust_ec1(i) + tau_2 * dust_ec2(i)
+    ENDDO
+
+    !JE      IF (test_vent.EQ.(6*2)) THEN
+    !JE        PRINT *,'6 hrs interval reached'
+    !JE        PRINT *,'day in read_emission, test_vent = ',julien, test_vent
+    !JE      ENDIF
+    !JE
+    !JE      test_vent=test_vent+1
+    !JE      IF (test_vent.EQ.(6*2)) test_vent=0 !on remet a zero ttes les 6 h
+    ! JE
+    jH_vent = jH_vent + pdtphys / (24. * 3600.)
+    test_vent = test_vent + 1
+    IF (jH_vent>(vent_resol) / 24.) THEN
+      test_vent = 0
+      jH_vent = jH_init
+    ENDIF
+    ! PRINT*,'JE test_vent,test_vent1,jH_vent ', test_vent,test_vent1
+    ! .     ,jH_vent
+    ! endJEi
+
+    avgdryrate = 300. / 365. * pdtphys / 86400.
+
+    DO i = 1, klon
+
+      IF (cly(i)<9990..AND.wth(i)<9990.) THEN
+        zprecipinsoil(i) = zprecipinsoil(i) + &
+                (pmflxr(i, 1) + pmflxs(i, 1) + prfl(i, 1) + psfl(i, 1)) * pdtphys
+
+        clyfac = MIN(16., cly(i) * 0.4 + 8.) ![mm] max amount of water hold in top soil
+        drying = avgdryrate * exp(0.03905491 * &
+                exp(0.17446 * (t_seri(i, 1) - 273.15))) ! [mm]
+        zprecipinsoil(i) = min(max(0., zprecipinsoil(i) - drying), clyfac) ! [mm]
+      ENDIF
+      ! zprecipinsoil(i)=0.0 ! Temporarely introduced to reproduce obelix result
+    ENDDO
+
+    ! PRINT *,'cly = ',sum(cly),maxval(cly),minval(cly)
+    ! PRINT *,'wth = ',sum(wth),maxval(wth),minval(wth)
+    ! PRINT *,'t_seri = ',sum(t_seri),maxval(t_seri),minval(t_seri)
+    ! PRINT *,'precipinsoil = ',sum(zprecipinsoil),maxval(zprecipinsoil)
+    ! .                      ,minval(zprecipinsoil)
+    icount = 0
+    DO i = 1, klon
+      IF (cly(i)>=9990..OR.wth(i)>=9990..OR. &
+              t_seri(i, 1)<=273.15.OR.zprecipinsoil(i)>1.e-8) THEN
+        dust_ec(i) = 0.0 ! commented out for test dustemtest
+        ! PRINT *,'Dust emissions surpressed at grid = ',i
+        ! icount=icount+1
+      ENDIF
+    ENDDO
+
+    PRINT *, 'Total N of grids with surpressed emission = ', icount
+    PRINT *, 'dust_ec = ', SUM(dust_ec), MINVAL(dust_ec), &
+            MAXVAL(dust_ec)
+    !nhl Transitory scaling of desert dust emissions
+
+    !nhl      DO i=1, klon
+    !nhl         dust_ec(i)=dust_ec(i)/2.
+    !nhl      ENDDO
+
+    !-saving precipitation field to be read in next simulation
+
+    IF (lafinphy) THEN
+
+      CALL gather(zprecipinsoil, zprecipinsoil_glo)
+      !$OMP MASTER
+      IF (is_mpi_root .AND. is_omp_root) THEN
+
+        OPEN(53, file = 'newprecipinsoil.dat', &
+                status = 'unknown', form = 'formatted')
+        WRITE(53, '(G18.10)') (zprecipinsoil_glo(i), i = 1, klon_glo)
+        CLOSE(53)
+      ENDIF
+      !$OMP END MASTER
+      !$OMP BARRIER
+
+    ENDIF
+
+    !***********************************************************************
+    ! SEA SALT EMISSIONS
+    !***********************************************************************
+
+    DO i = 1, klon
+      pct_ocean(i) = pctsrf(i, is_oce)
+    ENDDO
+
+    PRINT *, 'IS_OCE = ', is_oce
+    CALL seasalt(v10m_ec, u10m_ec, pct_ocean, lmt_sea_salt) !mgSeaSalt/cm2/s
+    ! PRINT *,'SUM, MAX & MIN Sea Salt = ',SUM(lmt_sea_salt),
+    ! .               MAXVAL(lmt_sea_salt),MINVAL(lmt_sea_salt)
+
+    !***********************************************************************
+    ! SULFUR & CARBON EMISSIONS
+    !***********************************************************************
+    !
+
+    IF (test_day==0) THEN
+      PRINT *, 'Computing SULFATE emissions for day : ', iday, julien, &
+              step_vent
+      CALL condsurfs_new(iday, edgar, flag_dms, &
+              lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, &
+              lmt_so2bb_l, lmt_so2bb_h, lmt_so2ba, &
+              lmt_so2volc_cont, lmt_altvolc_cont, &
+              lmt_so2volc_expl, lmt_altvolc_expl, &
+              lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc)
+      PRINT *, 'Computing CARBON emissions for day : ', iday, julien, &
+              step_vent
+      CALL condsurfc_new(iday, &
+              lmt_bcff, lmt_bcnff, lmt_bcbb_l, lmt_bcbb_h, &
+              lmt_bcba, lmt_omff, lmt_omnff, lmt_ombb_l, &
+              lmt_ombb_h, lmt_omnat, lmt_omba)
+      PRINT *, 'IDAY = ', iday
+      iday = iday + 1
+      PRINT *, 'BCBB_L emissions :', SUM(lmt_bcbb_l), MAXVAL(lmt_bcbb_l) &
+              , MINVAL(lmt_bcbb_l)
+      PRINT *, 'BCBB_H emissions :', SUM(lmt_bcbb_h), MAXVAL(lmt_bcbb_h) &
+              , MINVAL(lmt_bcbb_h)
+    ENDIF
+
+    !JE      test_day=test_day+1
+    !JE      IF (test_day.EQ.(24*2.)) THEN
+    !JE        test_day=0 !on remet a zero ttes les 24 h
+    !JE        PRINT *,'LAST TIME STEP OF DAY ',julien
+    !JE      ENDIF
+
+    jH_day = jH_day + pdtphys / (24. * 3600.)
+    test_day = test_day + 1
+    IF (jH_day>(day_resol) / 24.) THEN
+      PRINT *, 'LAST TIME STEP OF DAY ', julien
+      test_day = 0
+      jH_day = jH_init
+    ENDIF
+    ! PRINT*,'test_day,test_day1',test_day,test_day1
+
+  END SUBROUTINE read_newemissions
+END MODULE lmdz_read_newemissions
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_seasalt.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_seasalt.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lmdz_seasalt.f90	(revision 5160)
@@ -0,0 +1,52 @@
+MODULE lmdz_seasalt
+  IMPLICIT NONE; PRIVATE
+  PUBLIC seasalt
+CONTAINS
+  ! This SUBROUTINE estimates Sea Salt emission fluxes over Oceanic surfaces.
+  SUBROUTINE seasalt(v_10m, u_10m, pct_ocean, lmt_sea_salt)
+    USE dimphy
+    USE lmdz_YOECUMF
+    USE lmdz_yomcst
+    USE lmdz_chem_spla, ONLY: ss_bins
+
+    IMPLICIT NONE
+
+    INTEGER :: i, bin                 !local variables
+    REAL :: pct_ocean(klon)           !hfraction of Ocean in each grid
+    REAL :: v_10m(klon), u_10m(klon)  !V&H components of wind @10 m
+    REAL :: w_speed_10m(klon)         !wind speed at 10m from surface
+    REAL :: lmt_sea_salt(klon, ss_bins)!sea salt emission flux - mg/m2/s
+    REAL :: sea_salt_flux(ss_bins)    !sea salt emission flux per unit wind speed
+
+    REAL :: wind, ocean
+
+    !------Sea salt emission fluxes for each size bin calculated
+    !------based on on parameterisation of Gong et al. (1997).
+    !------Fluxes of sea salt for each size bin are given in mg/m^2/sec
+    !------at wind speed of 1 m/s at 10m height (at 80% RH).
+    !------Fluxes at various wind speeds (@10 m from sea
+    !------surfaces are estimated using relationship: F=flux*U_10^3.14
+
+    !nhl for size bin of 0.03-0.5 and 0.5-20
+    DATA sea_salt_flux/4.5E-09, 8.7E-7/
+
+    DO i = 1, klon
+      w_speed_10m(i) = (v_10m(i)**2.0 + u_10m(i)**2.0)**0.5
+    ENDDO
+
+    DO bin = 1, ss_bins
+      wind = 0.0
+      ocean = 0.0
+      DO i = 1, klon
+        lmt_sea_salt(i, bin) = sea_salt_flux(bin) * (w_speed_10m(i)**3.41) &
+                * pct_ocean(i) * 1.e-4 * 1.e-3                       !g/cm2/s
+        wind = wind + w_speed_10m(i)
+        ocean = ocean + pct_ocean(i)
+      ENDDO
+      ! PRINT *,'Sea Salt flux = ',sea_salt_flux(bin)
+    ENDDO
+    ! PRINT *,'SUM OF WIND = ',wind
+    ! PRINT *,'SUM OF OCEAN SURFACE = ',ocean
+
+  END SUBROUTINE seasalt
+END MODULE lmdz_seasalt
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_orig.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_orig.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_orig.F90	(revision 5160)
@@ -1,7 +1,7 @@
 !$Id $
 
-SUBROUTINE lsc_scav_orig(pdtime,it,iflag_lscav,oliq,flxr,flxs,rneb,beta_fisrt,  &
-                    beta_v1,pplay,paprs,t,tr_seri,d_tr_insc,          &
-                    d_tr_bcscav,d_tr_evap,qPrls) 
+SUBROUTINE lsc_scav_orig(pdtime, it, iflag_lscav, oliq, flxr, flxs, rneb, beta_fisrt, &
+        beta_v1, pplay, paprs, t, tr_seri, d_tr_insc, &
+        d_tr_bcscav, d_tr_evap, qPrls)
   USE ioipsl
   USE dimphy
@@ -9,282 +9,280 @@
   USE lmdz_phys_para
   USE traclmdz_mod
-  USE infotrac,ONLY: nbtr
+  USE infotrac, ONLY: nbtr
   USE iophy
   USE lmdz_yomcst
   USE lmdz_YOECUMF
-
   USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+
   IMPLICIT NONE
-!=====================================================================
-! Objet : depot humide (lessivage et evaporation) de traceurs
-! Inspired by routines of Olivier Boucher (mars 1998)
-! author R. Pilon 10 octobre 2012
-! last modification 16/01/2013 (reformulation partie evaporation)
-!=====================================================================
-
-
-  INCLUDE "chem.h"
-
-  REAL,INTENT(IN)                        :: pdtime ! time step (s)
-  INTEGER,INTENT(IN)                     :: it     ! tracer number
-  INTEGER,INTENT(IN)                     :: iflag_lscav ! LS scavenging param:
-!                                             3=Reddy_Boucher2004, 4=3+RPilon.
-  REAL,DIMENSION(klon,klev+1),INTENT(IN) :: flxr     ! flux precipitant de pluie
-  REAL,DIMENSION(klon,klev+1),INTENT(IN) :: flxs     ! flux precipitant de neige
-  REAL,INTENT(IN)                        :: oliq ! contenu en eau liquide dans le nuage (kg/kg)
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay    ! pression
-  REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs    ! pression
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: t        ! temperature
-! tracers
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(IN)   :: tr_seri        ! q de traceur  
-  REAL,DIMENSION(klon,klev),INTENT(IN)        :: beta_fisrt     ! taux de conversion de l'eau cond
-  REAL,DIMENSION(klon,klev),INTENT(OUT)       :: beta_v1        ! -- (originale version)
-  REAL,DIMENSION(klon)                        :: his_dh         ! tendance de traceur integre verticalement
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)  :: d_tr_insc      ! tendance du traceur 
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)  :: d_tr_bcscav  ! tendance de traceur
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)  :: d_tr_evap
-  REAL,DIMENSION(klon,nbtr),INTENT(OUT)       :: qPrls      !jyg: concentration tra dans pluie LS a la surf.
-  REAL :: dxin,dxev                              ! tendance temporaire de traceur incloud
-  REAL,DIMENSION(klon,klev) :: dxbc       ! tendance temporaire de traceur bc
-
-
-!  variables locales      
- LOGICAL,SAVE :: debut=.TRUE.
-!$OMP THREADPRIVATE(debut)
-
-  REAL,PARAMETER :: henry=1.4  ! constante de Henry en mol/l/atm ~1.4 for gases
-  REAL           :: henry_t    !  constante de Henry a T t  (mol/l/atm)
-  REAL,PARAMETER :: kk=2900.   ! coefficient de dependence en T (K)
+  !=====================================================================
+  ! Objet : depot humide (lessivage et evaporation) de traceurs
+  ! Inspired by routines of Olivier Boucher (mars 1998)
+  ! author R. Pilon 10 octobre 2012
+  ! last modification 16/01/2013 (reformulation partie evaporation)
+  !=====================================================================
+
+  REAL, INTENT(IN) :: pdtime ! time step (s)
+  INTEGER, INTENT(IN) :: it     ! tracer number
+  INTEGER, INTENT(IN) :: iflag_lscav ! LS scavenging param:
+  !                                             3=Reddy_Boucher2004, 4=3+RPilon.
+  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: flxr     ! flux precipitant de pluie
+  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: flxs     ! flux precipitant de neige
+  REAL, INTENT(IN) :: oliq ! contenu en eau liquide dans le nuage (kg/kg)
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay    ! pression
+  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs    ! pression
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: t        ! temperature
+  ! tracers
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: tr_seri        ! q de traceur
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: beta_fisrt     ! taux de conversion de l'eau cond
+  REAL, DIMENSION(klon, klev), INTENT(OUT) :: beta_v1        ! -- (originale version)
+  REAL, DIMENSION(klon) :: his_dh         ! tendance de traceur integre verticalement
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(OUT) :: d_tr_insc      ! tendance du traceur
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(OUT) :: d_tr_bcscav  ! tendance de traceur
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(OUT) :: d_tr_evap
+  REAL, DIMENSION(klon, nbtr), INTENT(OUT) :: qPrls      !jyg: concentration tra dans pluie LS a la surf.
+  REAL :: dxin, dxev                              ! tendance temporaire de traceur incloud
+  REAL, DIMENSION(klon, klev) :: dxbc       ! tendance temporaire de traceur bc
+
+
+  !  variables locales
+  LOGICAL, SAVE :: debut = .TRUE.
+  !$OMP THREADPRIVATE(debut)
+
+  REAL, PARAMETER :: henry = 1.4  ! constante de Henry en mol/l/atm ~1.4 for gases
+  REAL :: henry_t    !  constante de Henry a T t  (mol/l/atm)
+  REAL, PARAMETER :: kk = 2900.   ! coefficient de dependence en T (K)
   REAL :: f_a     !  rapport de la phase aqueuse a la phase gazeuse
   REAL :: beta    !  taux de conversion de l'eau en pluie
 
   INTEGER :: i, k
-  REAL,DIMENSION(klon,klev)    :: scav  !  water liquid content / fraction aqueuse du constituant
-  REAL,DIMENSION(klon,klev)    :: zrho
-  REAL,DIMENSION(klon,klev)    :: zdz
-  REAL,DIMENSION(klon,klev)    :: zmass ! layer mass
-
-  REAL           :: frac_ev       ! cste pour la reevaporation : dropplet shrinking
-!  frac_ev = frac_gas ou frac_aer
-  REAL,PARAMETER :: frac_gas=1.0  ! cste pour la reevaporation pour les gaz
-  REAL           :: frac_aer      ! cste pour la reevaporation pour les particules
-  REAL,DIMENSION(klon,klev) :: deltaP     ! P(i+1)-P(i)
-  REAL,DIMENSION(klon,klev) :: beta_ev    !  dP/P(i+1)
-
-!  101.325  m3/l x Pa/atm
-!  R        Pa.m3/mol/K
-!   cste de dissolution pour le depot humide
-  REAL,SAVE :: frac_fine_scav
-  REAL,SAVE :: frac_coar_scav
-!$OMP THREADPRIVATE(frac_fine_scav, frac_coar_scav)
-
-! below-cloud scav variables
-! aerosol : alpha_r=0.001, gas 0.001  (Pruppacher & Klett 1967)
-  REAL,SAVE :: alpha_r  !  coefficient d'impaction pour la pluie
-  REAL,SAVE :: alpha_s  !  coefficient d'impaction pour la neige  
-  REAL,SAVE :: R_r      !  mean raindrop radius (m) 
-  REAL,SAVE :: R_s      !  mean snow crystal radius (m)
-!$OMP THREADPRIVATE(alpha_r, alpha_s, R_r, R_s)
-  REAL           :: pr, ps, ice, water
+  REAL, DIMENSION(klon, klev) :: scav  !  water liquid content / fraction aqueuse du constituant
+  REAL, DIMENSION(klon, klev) :: zrho
+  REAL, DIMENSION(klon, klev) :: zdz
+  REAL, DIMENSION(klon, klev) :: zmass ! layer mass
+
+  REAL :: frac_ev       ! cste pour la reevaporation : dropplet shrinking
+  !  frac_ev = frac_gas ou frac_aer
+  REAL, PARAMETER :: frac_gas = 1.0  ! cste pour la reevaporation pour les gaz
+  REAL :: frac_aer      ! cste pour la reevaporation pour les particules
+  REAL, DIMENSION(klon, klev) :: deltaP     ! P(i+1)-P(i)
+  REAL, DIMENSION(klon, klev) :: beta_ev    !  dP/P(i+1)
+
+  !  101.325  m3/l x Pa/atm
+  !  R        Pa.m3/mol/K
+  !   cste de dissolution pour le depot humide
+  REAL, SAVE :: frac_fine_scav
+  REAL, SAVE :: frac_coar_scav
+  !$OMP THREADPRIVATE(frac_fine_scav, frac_coar_scav)
+
+  ! below-cloud scav variables
+  ! aerosol : alpha_r=0.001, gas 0.001  (Pruppacher & Klett 1967)
+  REAL, SAVE :: alpha_r  !  coefficient d'impaction pour la pluie
+  REAL, SAVE :: alpha_s  !  coefficient d'impaction pour la neige
+  REAL, SAVE :: R_r      !  mean raindrop radius (m)
+  REAL, SAVE :: R_s      !  mean snow crystal radius (m)
+  !$OMP THREADPRIVATE(alpha_r, alpha_s, R_r, R_s)
+  REAL :: pr, ps, ice, water
   REAL :: conserv
 
-!!!!!!!!!!!!!!!!!!!! choix lessivage !!!!!!!!!!!!!!!!!!!!!!!!
-!!  logical,save  :: inscav_fisrt
-!!! $OMP THREADPRIVATE(inscav_first)
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!! choix lessivage !!!!!!!!!!!!!!!!!!!!!!!!
+  !!  logical,save  :: inscav_fisrt
+  !!! $OMP THREADPRIVATE(inscav_first)
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (debut) THEN
 
-!  inscav_fisrt=.TRUE.
-!  CALL getin('inscav_fisrt',inscav_fisrt)
-!  IF(inscav_fisrt) THEN
-!   PRINT*,'beta from fisrtilp.F90, beta = (z_cond - z_oliq)/z_cond, inscav_fisrt=',inscav_fisrt
-!  else
-!   PRINT*,'beta from Reddy and Bocuher 2004 (original version), inscav_fisrt=',inscav_fisrt
-!  ENDIF
-
-      alpha_r=0.001        !  coefficient d'impaction pour la pluie
-      alpha_s=0.01         !  coefficient d'impaction pour la neige  
-      R_r=0.001            !  mean raindrop radius (m) 
-      R_s=0.001            !  mean snow crystal radius (m)
-      frac_fine_scav=0.7
-      frac_coar_scav=0.7
-!     frac_aer=0.5 ~ droplet size shrinks by evap
-      frac_aer=0.5
-
-!JE to speed up, commented 20140219
-
-!      OPEN(99,file='lsc_scav_param.data',status='old', &
-!                form='formatted',err=9999)
-!      READ(99,*,end=9998)  alpha_r
-!      READ(99,*,end=9998)  alpha_s
-!      READ(99,*,end=9998)  R_r
-!      READ(99,*,end=9998)  R_s
-!      READ(99,*,end=9998)  frac_fine_scav
-!      READ(99,*,end=9998)  frac_coar_scav
-!      READ(99,*,end=9998)  frac_aer
-!9998  Continue
-!      CLOSE(99)
-!9999  Continue
-
-!   PRINT*,'alpha_r',alpha_r
-!   PRINT*,'alpha_s',alpha_s
-!   PRINT*,'R_r',R_r
-!   PRINT*,'R_s',R_s
-!   PRINT*,'frac_fine_scav',frac_fine_scav
-!   PRINT*,'frac_coar_scav',frac_coar_scav
-!   PRINT*,'frac_aer ev',frac_aer
-
-! JE endcomment
+    !  inscav_fisrt=.TRUE.
+    !  CALL getin('inscav_fisrt',inscav_fisrt)
+    !  IF(inscav_fisrt) THEN
+    !   PRINT*,'beta from fisrtilp.F90, beta = (z_cond - z_oliq)/z_cond, inscav_fisrt=',inscav_fisrt
+    !  else
+    !   PRINT*,'beta from Reddy and Bocuher 2004 (original version), inscav_fisrt=',inscav_fisrt
+    !  ENDIF
+
+    alpha_r = 0.001        !  coefficient d'impaction pour la pluie
+    alpha_s = 0.01         !  coefficient d'impaction pour la neige
+    R_r = 0.001            !  mean raindrop radius (m)
+    R_s = 0.001            !  mean snow crystal radius (m)
+    frac_fine_scav = 0.7
+    frac_coar_scav = 0.7
+    !     frac_aer=0.5 ~ droplet size shrinks by evap
+    frac_aer = 0.5
+
+    !JE to speed up, commented 20140219
+
+    !      OPEN(99,file='lsc_scav_param.data',status='old', &
+    !                form='formatted',err=9999)
+    !      READ(99,*,end=9998)  alpha_r
+    !      READ(99,*,end=9998)  alpha_s
+    !      READ(99,*,end=9998)  R_r
+    !      READ(99,*,end=9998)  R_s
+    !      READ(99,*,end=9998)  frac_fine_scav
+    !      READ(99,*,end=9998)  frac_coar_scav
+    !      READ(99,*,end=9998)  frac_aer
+    !9998  Continue
+    !      CLOSE(99)
+    !9999  Continue
+
+    !   PRINT*,'alpha_r',alpha_r
+    !   PRINT*,'alpha_s',alpha_s
+    !   PRINT*,'R_r',R_r
+    !   PRINT*,'R_s',R_s
+    !   PRINT*,'frac_fine_scav',frac_fine_scav
+    !   PRINT*,'frac_coar_scav',frac_coar_scav
+    !   PRINT*,'frac_aer ev',frac_aer
+
+    ! JE endcomment
 
   ENDIF !(debut)
-!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-! initialization
-  dxin=0.
-  dxev=0.
-  beta_ev=0.
-
-  DO i=1,klon
-   his_dh(i)=0.
-  ENDDO
-
-  DO k=1,klev
-   DO i=1, klon 
-    dxbc(i,k)=0.
-    beta_v1(i,k)=0.
-    deltaP(i,k)=0.
-   ENDDO
-  ENDDO
-
-  DO k=1,klev
-    DO i=1, klon
-     d_tr_insc(i,k,it)=0.
-     d_tr_bcscav(i,k,it)=0.
-     d_tr_evap(i,k,it)=0.
-    ENDDO
-  ENDDO
-
-!  pressure and size of the layer
-  DO k=klev-1, 1, -1
-   DO i=1, klon 
-     zrho(i,k)=pplay(i,k)/t(i,k)/RD   
-     zdz(i,k)=(paprs(i,k)-paprs(i,k+1))/zrho(i,k)/RG
-     zmass(i,k)=(paprs(i,k)-paprs(i,k+1))/RG
-   ENDDO
-  ENDDO
-
-    IF (it>1) THEN                               !  aerosol
-      frac_ev=frac_aer
-    ELSE                                                !  gas
-      frac_ev=frac_gas
-    ENDIF
-
-    IF(it>1) then  ! aerosol
-     DO k=1, klev
-      DO i=1, klon 
-       scav(i,k)=frac_fine_scav
-      ENDDO 
-     ENDDO
-    ELSE                  ! gas
-     DO k=1, klev
-      DO i=1, klon 
-       henry_t=henry*exp(-kk*(1./298.-1./t(i,k)))    !  mol/l/atm
-       f_a=henry_t/101.325*R*t(i,k)*oliq*zrho(i,k)/rho_water
-       scav(i,k)=f_a/(1.+f_a)
-      ENDDO 
-     ENDDO
-    ENDIF
-
-   DO k=klev-1, 1, -1
-    DO i=1, klon 
-!  incloud scavenging
-!   IF(inscav_fisrt) THEN
-   IF (iflag_lscav == 4) THEN
-      beta=beta_fisrt(i,k)*rneb(i,k)
-   else
-      beta=flxr(i,k)-flxr(i,k+1)+flxs(i,k)-flxs(i,k+1)
-!      beta=beta/zdz(i,k)/oliq/zrho(i,k)
-      beta=beta/zmass(i,k)/oliq
-      beta=MAX(0.,beta)
-   endif ! (iflag_lscav .EQ. 4)
-   beta_v1(i,k)=beta    !! for output
-
-      dxin=tr_seri(i,k,it)*(exp(-scav(i,k)*beta*pdtime)-1.)
-!      his_dh(i)=his_dh(i)-dxin*zrho(i,k)*zdz(i,k)/pdtime !  kg/m2/s
-      his_dh(i)=his_dh(i)-dxin*zmass(i,k)/pdtime !  kg/m2/s
-      d_tr_insc(i,k,it)=dxin
-
-!  below-cloud impaction
-    IF(it==1) THEN
-      d_tr_bcscav(i,k,it)=0.
-    ELSE
-     pr=0.5*(flxr(i,k)+flxr(i,k+1))
-     ps=0.5*(flxs(i,k)+flxs(i,k+1))
-     water=pr*alpha_r/R_r/rho_water
-     ice=ps*alpha_s/R_s/rho_ice
-     dxbc(i,k)=-3./4.*tr_seri(i,k,it)*pdtime*(water+ice)
-!   add tracers from below cloud scav in his_dh
-     his_dh(i)=his_dh(i)-dxbc(i,k)*zmass(i,k)/pdtime !  kg/m2/s
-     d_tr_bcscav(i,k,it)=dxbc(i,k)
-    ENDIF
-
-!  reevaporation
-      deltaP(i,k)=flxr(i,k+1)+flxs(i,k+1)-flxr(i,k)-flxs(i,k)
-      deltaP(i,k)=max(deltaP(i,k),0.)
-
-      IF(flxr(i,k+1)+flxs(i,k+1)>1.e-16) THEN
-       beta_ev(i,k)=deltaP(i,k)/(flxr(i,k+1)+flxs(i,k+1))
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  ! initialization
+  dxin = 0.
+  dxev = 0.
+  beta_ev = 0.
+
+  DO i = 1, klon
+    his_dh(i) = 0.
+  ENDDO
+
+  DO k = 1, klev
+    DO i = 1, klon
+      dxbc(i, k) = 0.
+      beta_v1(i, k) = 0.
+      deltaP(i, k) = 0.
+    ENDDO
+  ENDDO
+
+  DO k = 1, klev
+    DO i = 1, klon
+      d_tr_insc(i, k, it) = 0.
+      d_tr_bcscav(i, k, it) = 0.
+      d_tr_evap(i, k, it) = 0.
+    ENDDO
+  ENDDO
+
+  !  pressure and size of the layer
+  DO k = klev - 1, 1, -1
+    DO i = 1, klon
+      zrho(i, k) = pplay(i, k) / t(i, k) / RD
+      zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG
+      zmass(i, k) = (paprs(i, k) - paprs(i, k + 1)) / RG
+    ENDDO
+  ENDDO
+
+  IF (it>1) THEN                               !  aerosol
+    frac_ev = frac_aer
+  ELSE                                                !  gas
+    frac_ev = frac_gas
+  ENDIF
+
+  IF(it>1) then  ! aerosol
+    DO k = 1, klev
+      DO i = 1, klon
+        scav(i, k) = frac_fine_scav
+      ENDDO
+    ENDDO
+  ELSE                  ! gas
+    DO k = 1, klev
+      DO i = 1, klon
+        henry_t = henry * exp(-kk * (1. / 298. - 1. / t(i, k)))    !  mol/l/atm
+        f_a = henry_t / 101.325 * R * t(i, k) * oliq * zrho(i, k) / rho_water
+        scav(i, k) = f_a / (1. + f_a)
+      ENDDO
+    ENDDO
+  ENDIF
+
+  DO k = klev - 1, 1, -1
+    DO i = 1, klon
+      !  incloud scavenging
+      !   IF(inscav_fisrt) THEN
+      IF (iflag_lscav == 4) THEN
+        beta = beta_fisrt(i, k) * rneb(i, k)
       else
-       beta_ev(i,k)=0.
+        beta = flxr(i, k) - flxr(i, k + 1) + flxs(i, k) - flxs(i, k + 1)
+        !      beta=beta/zdz(i,k)/oliq/zrho(i,k)
+        beta = beta / zmass(i, k) / oliq
+        beta = MAX(0., beta)
+      endif ! (iflag_lscav .EQ. 4)
+      beta_v1(i, k) = beta    !! for output
+
+      dxin = tr_seri(i, k, it) * (exp(-scav(i, k) * beta * pdtime) - 1.)
+      !      his_dh(i)=his_dh(i)-dxin*zrho(i,k)*zdz(i,k)/pdtime !  kg/m2/s
+      his_dh(i) = his_dh(i) - dxin * zmass(i, k) / pdtime !  kg/m2/s
+      d_tr_insc(i, k, it) = dxin
+
+      !  below-cloud impaction
+      IF(it==1) THEN
+        d_tr_bcscav(i, k, it) = 0.
+      ELSE
+        pr = 0.5 * (flxr(i, k) + flxr(i, k + 1))
+        ps = 0.5 * (flxs(i, k) + flxs(i, k + 1))
+        water = pr * alpha_r / R_r / rho_water
+        ice = ps * alpha_s / R_s / rho_ice
+        dxbc(i, k) = -3. / 4. * tr_seri(i, k, it) * pdtime * (water + ice)
+        !   add tracers from below cloud scav in his_dh
+        his_dh(i) = his_dh(i) - dxbc(i, k) * zmass(i, k) / pdtime !  kg/m2/s
+        d_tr_bcscav(i, k, it) = dxbc(i, k)
+      ENDIF
+
+      !  reevaporation
+      deltaP(i, k) = flxr(i, k + 1) + flxs(i, k + 1) - flxr(i, k) - flxs(i, k)
+      deltaP(i, k) = max(deltaP(i, k), 0.)
+
+      IF(flxr(i, k + 1) + flxs(i, k + 1)>1.e-16) THEN
+        beta_ev(i, k) = deltaP(i, k) / (flxr(i, k + 1) + flxs(i, k + 1))
+      else
+        beta_ev(i, k) = 0.
       endif
 
-      beta_ev(i,k)=max(min(1.,beta_ev(i,k)),0.)
-
-!jyg
-      
-      IF(abs(1-(1-frac_ev)*beta_ev(i,k))>1.e-16) THEN
-! remove tracers from precipitation owing to release by evaporation in his_dh
-!      dxev=frac_ev*beta_ev(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
-      dxev=frac_ev*beta_ev(i,k)*his_dh(i) *pdtime/(zmass(i,k)) &
-                                      /(1 -(1-frac_ev)*beta_ev(i,k))
-       his_dh(i)=his_dh(i)*(1 - frac_ev*beta_ev(i,k) / (1 -(1-frac_ev)*beta_ev(i,k)))
+      beta_ev(i, k) = max(min(1., beta_ev(i, k)), 0.)
+
+      !jyg
+
+      IF(abs(1 - (1 - frac_ev) * beta_ev(i, k))>1.e-16) THEN
+        ! remove tracers from precipitation owing to release by evaporation in his_dh
+        !      dxev=frac_ev*beta_ev(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
+        dxev = frac_ev * beta_ev(i, k) * his_dh(i) * pdtime / (zmass(i, k)) &
+                / (1 - (1 - frac_ev) * beta_ev(i, k))
+        his_dh(i) = his_dh(i) * (1 - frac_ev * beta_ev(i, k) / (1 - (1 - frac_ev) * beta_ev(i, k)))
       else
-!       dxev=his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k))
-       dxev=his_dh(i) *pdtime/(zmass(i,k))
-       his_dh(i)=0.
+        !       dxev=his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k))
+        dxev = his_dh(i) * pdtime / (zmass(i, k))
+        his_dh(i) = 0.
       endif
-!      PRINT*,  k, 'beta_ev',beta_ev
-! remove tracers from precipitation owing to release by evaporation in his_dh
-!!      dxev=frac_ev*deltaP(i,k)*pdtime * his_dh(i) /(zrho(i,k)*zdz(i,k))
-!rplmd
-!!      dxev=frac_ev*deltaP(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
-!!                                      /max(flxr(i,k)+flxs(i,k),1.e-16)
-
-
-      d_tr_evap(i,k,it)=dxev
-!!     tendency is further added in phytrac x = x + dx
+      !      PRINT*,  k, 'beta_ev',beta_ev
+      ! remove tracers from precipitation owing to release by evaporation in his_dh
+      !!      dxev=frac_ev*deltaP(i,k)*pdtime * his_dh(i) /(zrho(i,k)*zdz(i,k))
+      !rplmd
+      !!      dxev=frac_ev*deltaP(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
+      !!                                      /max(flxr(i,k)+flxs(i,k),1.e-16)
+
+      d_tr_evap(i, k, it) = dxev
+      !!     tendency is further added in phytrac x = x + dx
     ENDDO !!  do i
-   ENDDO  !! do k
-
-!jyg (20130114)
-   DO i = 1,klon
-     qPrls(i,it) = his_dh(i)/max(flxr(i,1)+flxs(i,1),1.e-16)
-   ENDDO
-!jyg end
-
-
-! test de conservation
-      conserv=0.
-!      DO k= klev,1,-1
-!        DO i=1, klon
-!         conserv=conserv+d_tr_insc(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG &
-!                +d_tr_bcscav(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG  &
-!                +d_tr_evap(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG
-!      IF(it.EQ.3) WRITE(*,'(I2,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12)'),&
-!      k,'lsc conserv ',conserv,'insc',d_tr_insc(i,k,it),'bc',d_tr_bcscav(i,k,it),'ev',d_tr_evap(i,k,it)
-!       ENDDO
-!     ENDDO
+  ENDDO  !! do k
+
+  !jyg (20130114)
+  DO i = 1, klon
+    qPrls(i, it) = his_dh(i) / max(flxr(i, 1) + flxs(i, 1), 1.e-16)
+  ENDDO
+  !jyg end
+
+
+  ! test de conservation
+  conserv = 0.
+  !      DO k= klev,1,-1
+  !        DO i=1, klon
+  !         conserv=conserv+d_tr_insc(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG &
+  !                +d_tr_bcscav(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG  &
+  !                +d_tr_evap(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG
+  !      IF(it.EQ.3) WRITE(*,'(I2,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12)'),&
+  !      k,'lsc conserv ',conserv,'insc',d_tr_insc(i,k,it),'bc',d_tr_bcscav(i,k,it),'ev',d_tr_evap(i,k,it)
+  !       ENDDO
+  !     ENDDO
 
 END SUBROUTINE lsc_scav_orig
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_spl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_spl.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_spl.F90	(revision 5160)
@@ -1,9 +1,9 @@
 !$Id $
 
-SUBROUTINE lsc_scav_spl(pdtime,it,iflag_lscav,oliq,flxr,flxs,rneb,beta_fisrt,  &
-                    beta_v1,pplay,paprs,t,tr_seri,d_tr_insc,          &
-                    alpha_r,alpha_s,kk, henry,     &
-                    id_prec,id_fine,id_coss, id_codu, id_scdu, &
-                    d_tr_bcscav,d_tr_evap,qPrls) 
+SUBROUTINE lsc_scav_spl(pdtime, it, iflag_lscav, oliq, flxr, flxs, rneb, beta_fisrt, &
+        beta_v1, pplay, paprs, t, tr_seri, d_tr_insc, &
+        alpha_r, alpha_s, kk, henry, &
+        id_prec, id_fine, id_coss, id_codu, id_scdu, &
+        d_tr_bcscav, d_tr_evap, qPrls)
   USE ioipsl
   USE dimphy
@@ -11,292 +11,290 @@
   USE lmdz_phys_para
   USE traclmdz_mod
-  USE infotrac,ONLY: nbtr
+  USE infotrac, ONLY: nbtr
   USE iophy
   USE lmdz_yomcst
   USE lmdz_YOECUMF
-
   USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+
   IMPLICIT NONE
-!=====================================================================
-! Objet : depot humide (lessivage et evaporation) de traceurs
-! Inspired by routines of Olivier Boucher (mars 1998)
-! author R. Pilon 10 octobre 2012
-! last modification 16/01/2013 (reformulation partie evaporation)
-!=====================================================================
-! SPLA version taken from trunk revision 2041
-
-
-  INCLUDE "chem.h"
-
-  REAL,INTENT(IN)                        :: pdtime ! time step (s)
-  INTEGER,INTENT(IN)                     :: it     ! tracer number
-  INTEGER,INTENT(IN)                     :: iflag_lscav ! LS scavenging param:
-!                                             3=Reddy_Boucher2004, 4=3+RPilon.
-  REAL,DIMENSION(klon,klev+1),INTENT(IN) :: flxr     ! flux precipitant de pluie
-  REAL,DIMENSION(klon,klev+1),INTENT(IN) :: flxs     ! flux precipitant de neige
-  REAL,INTENT(IN)                        :: oliq ! contenu en eau liquide dans le nuage (kg/kg)
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay    ! pression
-  REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs    ! pression
-  REAL,DIMENSION(klon,klev),INTENT(IN)   :: t        ! temperature
-! tracers
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(IN)   :: tr_seri        ! q de traceur  
-  REAL,DIMENSION(klon,klev),INTENT(IN)        :: beta_fisrt     ! taux de conversion de l'eau cond
-  REAL,DIMENSION(klon,klev),INTENT(OUT)       :: beta_v1        ! -- (originale version)
-  REAL,DIMENSION(klon)                        :: his_dh         ! tendance de traceur integre verticalement
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)  :: d_tr_insc      ! tendance du traceur 
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)  :: d_tr_bcscav  ! tendance de traceur
-  REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)  :: d_tr_evap
-  REAL,DIMENSION(klon,nbtr),INTENT(OUT)       :: qPrls      !jyg: concentration tra dans pluie LS a la surf.
-  REAL :: dxin,dxev                              ! tendance temporaire de traceur incloud
-  REAL,DIMENSION(klon,klev) :: dxbc       ! tendance temporaire de traceur bc
-
-  INTEGER :: id_prec,id_fine,id_coss, id_codu, id_scdu
-
-!  variables locales      
- LOGICAL,SAVE :: debut=.TRUE.
-!$OMP THREADPRIVATE(debut)
-
-!JE  REAL,PARAMETER :: henry=1.4  ! constante de Henry en mol/l/atm ~1.4 for gases
-  REAL,DIMENSION(nbtr) :: henry  ! constante de Henry en mol/l/atm ~1.4 for gases
-  REAL           :: henry_t    !  constante de Henry a T t  (mol/l/atm)
-!JE  REAL,PARAMETER :: kk=2900.   ! coefficient de dependence en T (K)
-  REAL,DIMENSION(nbtr) :: kk   ! coefficient de dependence en T (K)
+  !=====================================================================
+  ! Objet : depot humide (lessivage et evaporation) de traceurs
+  ! Inspired by routines of Olivier Boucher (mars 1998)
+  ! author R. Pilon 10 octobre 2012
+  ! last modification 16/01/2013 (reformulation partie evaporation)
+  !=====================================================================
+  ! SPLA version taken from trunk revision 2041
+
+  REAL, INTENT(IN) :: pdtime ! time step (s)
+  INTEGER, INTENT(IN) :: it     ! tracer number
+  INTEGER, INTENT(IN) :: iflag_lscav ! LS scavenging param:
+  !                                             3=Reddy_Boucher2004, 4=3+RPilon.
+  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: flxr     ! flux precipitant de pluie
+  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: flxs     ! flux precipitant de neige
+  REAL, INTENT(IN) :: oliq ! contenu en eau liquide dans le nuage (kg/kg)
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay    ! pression
+  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs    ! pression
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: t        ! temperature
+  ! tracers
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: tr_seri        ! q de traceur
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: beta_fisrt     ! taux de conversion de l'eau cond
+  REAL, DIMENSION(klon, klev), INTENT(OUT) :: beta_v1        ! -- (originale version)
+  REAL, DIMENSION(klon) :: his_dh         ! tendance de traceur integre verticalement
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(OUT) :: d_tr_insc      ! tendance du traceur
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(OUT) :: d_tr_bcscav  ! tendance de traceur
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(OUT) :: d_tr_evap
+  REAL, DIMENSION(klon, nbtr), INTENT(OUT) :: qPrls      !jyg: concentration tra dans pluie LS a la surf.
+  REAL :: dxin, dxev                              ! tendance temporaire de traceur incloud
+  REAL, DIMENSION(klon, klev) :: dxbc       ! tendance temporaire de traceur bc
+
+  INTEGER :: id_prec, id_fine, id_coss, id_codu, id_scdu
+
+  !  variables locales
+  LOGICAL, SAVE :: debut = .TRUE.
+  !$OMP THREADPRIVATE(debut)
+
+  !JE  REAL,PARAMETER :: henry=1.4  ! constante de Henry en mol/l/atm ~1.4 for gases
+  REAL, DIMENSION(nbtr) :: henry  ! constante de Henry en mol/l/atm ~1.4 for gases
+  REAL :: henry_t    !  constante de Henry a T t  (mol/l/atm)
+  !JE  REAL,PARAMETER :: kk=2900.   ! coefficient de dependence en T (K)
+  REAL, DIMENSION(nbtr) :: kk   ! coefficient de dependence en T (K)
   REAL :: f_a     !  rapport de la phase aqueuse a la phase gazeuse
   REAL :: beta    !  taux de conversion de l'eau en pluie
 
   INTEGER :: i, k
-  REAL,DIMENSION(klon,klev)    :: scav  !  water liquid content / fraction aqueuse du constituant
-  REAL,DIMENSION(klon,klev)    :: zrho
-  REAL,DIMENSION(klon,klev)    :: zdz
-  REAL,DIMENSION(klon,klev)    :: zmass ! layer mass
-
-  REAL           :: frac_ev       ! cste pour la reevaporation : dropplet shrinking
-!  frac_ev = frac_gas ou frac_aer
-  REAL,PARAMETER :: frac_gas=1.0  ! cste pour la reevaporation pour les gaz
-  REAL           :: frac_aer      ! cste pour la reevaporation pour les particules
-  REAL,DIMENSION(klon,klev) :: deltaP     ! P(i+1)-P(i)
-  REAL,DIMENSION(klon,klev) :: beta_ev    !  dP/P(i+1)
-
-!  101.325  m3/l x Pa/atm
-!  R        Pa.m3/mol/K
-!   cste de dissolution pour le depot humide
-  REAL,SAVE :: frac_fine_scav
-  REAL,SAVE :: frac_coar_scav
-!$OMP THREADPRIVATE(frac_fine_scav, frac_coar_scav)
-
-! below-cloud scav variables
-! aerosol : alpha_r=0.001, gas 0.001  (Pruppacher & Klett 1967)
-!JE<<
-!  REAL,SAVE :: alpha_r  !  coefficient d'impaction pour la pluie
-!  REAL,SAVE :: alpha_s  !  coefficient d'impaction pour la neige  
-!JE>>
+  REAL, DIMENSION(klon, klev) :: scav  !  water liquid content / fraction aqueuse du constituant
+  REAL, DIMENSION(klon, klev) :: zrho
+  REAL, DIMENSION(klon, klev) :: zdz
+  REAL, DIMENSION(klon, klev) :: zmass ! layer mass
+
+  REAL :: frac_ev       ! cste pour la reevaporation : dropplet shrinking
+  !  frac_ev = frac_gas ou frac_aer
+  REAL, PARAMETER :: frac_gas = 1.0  ! cste pour la reevaporation pour les gaz
+  REAL :: frac_aer      ! cste pour la reevaporation pour les particules
+  REAL, DIMENSION(klon, klev) :: deltaP     ! P(i+1)-P(i)
+  REAL, DIMENSION(klon, klev) :: beta_ev    !  dP/P(i+1)
+
+  !  101.325  m3/l x Pa/atm
+  !  R        Pa.m3/mol/K
+  !   cste de dissolution pour le depot humide
+  REAL, SAVE :: frac_fine_scav
+  REAL, SAVE :: frac_coar_scav
+  !$OMP THREADPRIVATE(frac_fine_scav, frac_coar_scav)
+
+  ! below-cloud scav variables
+  ! aerosol : alpha_r=0.001, gas 0.001  (Pruppacher & Klett 1967)
+  !JE<<
+  !  REAL,SAVE :: alpha_r  !  coefficient d'impaction pour la pluie
+  !  REAL,SAVE :: alpha_s  !  coefficient d'impaction pour la neige
+  !JE>>
   REAL, DIMENSION(nbtr) :: alpha_r  !  coefficient d'impaction pour la pluie
   REAL, DIMENSION(nbtr) :: alpha_s  !  coefficient d'impaction pour la neige  
-  REAL,SAVE :: R_r      !  mean raindrop radius (m) 
-  REAL,SAVE :: R_s      !  mean snow crystal radius (m)
-!!! $OMP THREADPRIVATE(alpha_r, alpha_s, R_r, R_s)
-!$OMP THREADPRIVATE(R_r, R_s)
-  REAL           :: pr, ps, ice, water
+  REAL, SAVE :: R_r      !  mean raindrop radius (m)
+  REAL, SAVE :: R_s      !  mean snow crystal radius (m)
+  !!! $OMP THREADPRIVATE(alpha_r, alpha_s, R_r, R_s)
+  !$OMP THREADPRIVATE(R_r, R_s)
+  REAL :: pr, ps, ice, water
   REAL :: conserv
 
-!!!!!!!!!!!!!!!!!!!! choix lessivage !!!!!!!!!!!!!!!!!!!!!!!!
-!!  logical,save  :: inscav_fisrt
-!!! $OMP THREADPRIVATE(inscav_first)
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!! choix lessivage !!!!!!!!!!!!!!!!!!!!!!!!
+  !!  logical,save  :: inscav_fisrt
+  !!! $OMP THREADPRIVATE(inscav_first)
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (debut) THEN
 
-!  inscav_fisrt=.TRUE.
-!  CALL getin('inscav_fisrt',inscav_fisrt)
-!  IF(inscav_fisrt) THEN
-!   PRINT*,'beta from fisrtilp.F90, beta = (z_cond - z_oliq)/z_cond, inscav_fisrt=',inscav_fisrt
-!  else
-!   PRINT*,'beta from Reddy and Bocuher 2004 (original version), inscav_fisrt=',inscav_fisrt
-!  ENDIF
-
-!JE      alpha_r=0.001        !  coefficient d'impaction pour la pluie
-!JE      alpha_s=0.01         !  coefficient d'impaction pour la neige  
-      R_r=0.001            !  mean raindrop radius (m) 
-      R_s=0.001            !  mean snow crystal radius (m)
-      frac_fine_scav=0.7
-      frac_coar_scav=0.7
-!     frac_aer=0.5 ~ droplet size shrinks by evap
-      frac_aer=0.5
-
-!JE to speed up, commented 20140219
-
-!      OPEN(99,file='lsc_scav_param.data',status='old', &
-!                form='formatted',err=9999)
-!      READ(99,*,end=9998)  alpha_r
-!      READ(99,*,end=9998)  alpha_s
-!      READ(99,*,end=9998)  R_r
-!      READ(99,*,end=9998)  R_s
-!      READ(99,*,end=9998)  frac_fine_scav
-!      READ(99,*,end=9998)  frac_coar_scav
-!      READ(99,*,end=9998)  frac_aer
-!9998  Continue
-!      CLOSE(99)
-!9999  Continue
-
-!   PRINT*,'JE alpha_r',alpha_r
-!   PRINT*,'JE alpha_s',alpha_s
-!   PRINT*,'JE R_r',R_r
-!   PRINT*,'JE R_s',R_s
-!   PRINT*,'frac_fine_scav',frac_fine_scav
-!   PRINT*,'frac_coar_scav',frac_coar_scav
-!   PRINT*,'frac_aer ev',frac_aer
-
-! JE endcomment
+    !  inscav_fisrt=.TRUE.
+    !  CALL getin('inscav_fisrt',inscav_fisrt)
+    !  IF(inscav_fisrt) THEN
+    !   PRINT*,'beta from fisrtilp.F90, beta = (z_cond - z_oliq)/z_cond, inscav_fisrt=',inscav_fisrt
+    !  else
+    !   PRINT*,'beta from Reddy and Bocuher 2004 (original version), inscav_fisrt=',inscav_fisrt
+    !  ENDIF
+
+    !JE      alpha_r=0.001        !  coefficient d'impaction pour la pluie
+    !JE      alpha_s=0.01         !  coefficient d'impaction pour la neige
+    R_r = 0.001            !  mean raindrop radius (m)
+    R_s = 0.001            !  mean snow crystal radius (m)
+    frac_fine_scav = 0.7
+    frac_coar_scav = 0.7
+    !     frac_aer=0.5 ~ droplet size shrinks by evap
+    frac_aer = 0.5
+
+    !JE to speed up, commented 20140219
+
+    !      OPEN(99,file='lsc_scav_param.data',status='old', &
+    !                form='formatted',err=9999)
+    !      READ(99,*,end=9998)  alpha_r
+    !      READ(99,*,end=9998)  alpha_s
+    !      READ(99,*,end=9998)  R_r
+    !      READ(99,*,end=9998)  R_s
+    !      READ(99,*,end=9998)  frac_fine_scav
+    !      READ(99,*,end=9998)  frac_coar_scav
+    !      READ(99,*,end=9998)  frac_aer
+    !9998  Continue
+    !      CLOSE(99)
+    !9999  Continue
+
+    !   PRINT*,'JE alpha_r',alpha_r
+    !   PRINT*,'JE alpha_s',alpha_s
+    !   PRINT*,'JE R_r',R_r
+    !   PRINT*,'JE R_s',R_s
+    !   PRINT*,'frac_fine_scav',frac_fine_scav
+    !   PRINT*,'frac_coar_scav',frac_coar_scav
+    !   PRINT*,'frac_aer ev',frac_aer
+
+    ! JE endcomment
 
   ENDIF !(debut)
-!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-! initialization
-  dxin=0.
-  dxev=0.
-  beta_ev=0.
-
-  DO i=1,klon
-   his_dh(i)=0.
-  ENDDO
-
-  DO k=1,klev
-   DO i=1, klon 
-    dxbc(i,k)=0.
-    beta_v1(i,k)=0.
-    deltaP(i,k)=0.
-   ENDDO
-  ENDDO
-
-  DO k=1,klev
-    DO i=1, klon
-     d_tr_insc(i,k,it)=0.
-     d_tr_bcscav(i,k,it)=0.
-     d_tr_evap(i,k,it)=0.
-    ENDDO
-  ENDDO
-
-!  pressure and size of the layer
-  DO k=klev, 1, -1
-   DO i=1, klon 
-     zrho(i,k)=pplay(i,k)/t(i,k)/RD   
-     zdz(i,k)=(paprs(i,k)-paprs(i,k+1))/zrho(i,k)/RG
-     zmass(i,k)=(paprs(i,k)-paprs(i,k+1))/RG
-   ENDDO
-  ENDDO
-
-!JE<<
-    IF (it==id_prec) THEN                               !  gas
-      frac_ev=frac_gas
-    ELSE                                   !aerosol
-      frac_ev=frac_aer
-    ENDIF
-
-    IF (it==id_prec) THEN                               !  gas
-     DO k=1, klev
-      DO i=1, klon 
-       henry_t=henry(it)*exp(-kk(it)*(1./298.-1./t(i,k)))    !  mol/l/atm
-       f_a=henry_t/101.325*R*t(i,k)*oliq*zrho(i,k)/rho_water
-       scav(i,k)=f_a/(1.+f_a)
-      ENDDO 
-     ENDDO
-    ELSE                            !aerosol
-     DO k=1, klev
-      DO i=1, klon
-       scav(i,k)=frac_fine_scav
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  ! initialization
+  dxin = 0.
+  dxev = 0.
+  beta_ev = 0.
+
+  DO i = 1, klon
+    his_dh(i) = 0.
+  ENDDO
+
+  DO k = 1, klev
+    DO i = 1, klon
+      dxbc(i, k) = 0.
+      beta_v1(i, k) = 0.
+      deltaP(i, k) = 0.
+    ENDDO
+  ENDDO
+
+  DO k = 1, klev
+    DO i = 1, klon
+      d_tr_insc(i, k, it) = 0.
+      d_tr_bcscav(i, k, it) = 0.
+      d_tr_evap(i, k, it) = 0.
+    ENDDO
+  ENDDO
+
+  !  pressure and size of the layer
+  DO k = klev, 1, -1
+    DO i = 1, klon
+      zrho(i, k) = pplay(i, k) / t(i, k) / RD
+      zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG
+      zmass(i, k) = (paprs(i, k) - paprs(i, k + 1)) / RG
+    ENDDO
+  ENDDO
+
+  !JE<<
+  IF (it==id_prec) THEN                               !  gas
+    frac_ev = frac_gas
+  ELSE                                   !aerosol
+    frac_ev = frac_aer
+  ENDIF
+
+  IF (it==id_prec) THEN                               !  gas
+    DO k = 1, klev
+      DO i = 1, klon
+        henry_t = henry(it) * exp(-kk(it) * (1. / 298. - 1. / t(i, k)))    !  mol/l/atm
+        f_a = henry_t / 101.325 * R * t(i, k) * oliq * zrho(i, k) / rho_water
+        scav(i, k) = f_a / (1. + f_a)
       ENDDO
-     ENDDO
-    ENDIF
-!JE>>
-   DO k=klev-1, 1, -1
-    DO i=1, klon 
-!  incloud scavenging
-!   IF(inscav_fisrt) THEN
-   IF (iflag_lscav == 4) THEN
-      beta=beta_fisrt(i,k)*rneb(i,k)
-   else
-      beta=flxr(i,k)-flxr(i,k+1)+flxs(i,k)-flxs(i,k+1)
-!      beta=beta/zdz(i,k)/oliq/zrho(i,k)
-      beta=beta/zmass(i,k)/oliq
-      beta=MAX(0.,beta)
-   endif ! (iflag_lscav .EQ. 4)
-   beta_v1(i,k)=beta    !! for output
-
-      dxin=tr_seri(i,k,it)*(exp(-scav(i,k)*beta*pdtime)-1.)
-!      his_dh(i)=his_dh(i)-dxin*zrho(i,k)*zdz(i,k)/pdtime !  kg/m2/s
-      his_dh(i)=his_dh(i)-dxin*zmass(i,k)/pdtime !  kg/m2/s
-      d_tr_insc(i,k,it)=dxin
-
-!  below-cloud impaction
-    IF(it==id_prec) THEN
-      d_tr_bcscav(i,k,it)=0.
-    ELSE
-     pr=0.5*(flxr(i,k)+flxr(i,k+1))
-     ps=0.5*(flxs(i,k)+flxs(i,k+1))
-     water=pr*alpha_r(it)/R_r/rho_water
-     ice=ps*alpha_s(it)/R_s/rho_ice
-     dxbc(i,k)=-3./4.*tr_seri(i,k,it)*pdtime*(water+ice)
-!   add tracers from below cloud scav in his_dh
-     his_dh(i)=his_dh(i)-dxbc(i,k)*zmass(i,k)/pdtime !  kg/m2/s
-     d_tr_bcscav(i,k,it)=dxbc(i,k)
-    ENDIF
-
-!  reevaporation
-      deltaP(i,k)=flxr(i,k+1)+flxs(i,k+1)-flxr(i,k)-flxs(i,k)
-      deltaP(i,k)=max(deltaP(i,k),0.)
-
-      IF(flxr(i,k+1)+flxs(i,k+1)>1.e-16) THEN
-       beta_ev(i,k)=deltaP(i,k)/(flxr(i,k+1)+flxs(i,k+1))
+    ENDDO
+  ELSE                            !aerosol
+    DO k = 1, klev
+      DO i = 1, klon
+        scav(i, k) = frac_fine_scav
+      ENDDO
+    ENDDO
+  ENDIF
+  !JE>>
+  DO k = klev - 1, 1, -1
+    DO i = 1, klon
+      !  incloud scavenging
+      !   IF(inscav_fisrt) THEN
+      IF (iflag_lscav == 4) THEN
+        beta = beta_fisrt(i, k) * rneb(i, k)
       else
-       beta_ev(i,k)=0.
+        beta = flxr(i, k) - flxr(i, k + 1) + flxs(i, k) - flxs(i, k + 1)
+        !      beta=beta/zdz(i,k)/oliq/zrho(i,k)
+        beta = beta / zmass(i, k) / oliq
+        beta = MAX(0., beta)
+      endif ! (iflag_lscav .EQ. 4)
+      beta_v1(i, k) = beta    !! for output
+
+      dxin = tr_seri(i, k, it) * (exp(-scav(i, k) * beta * pdtime) - 1.)
+      !      his_dh(i)=his_dh(i)-dxin*zrho(i,k)*zdz(i,k)/pdtime !  kg/m2/s
+      his_dh(i) = his_dh(i) - dxin * zmass(i, k) / pdtime !  kg/m2/s
+      d_tr_insc(i, k, it) = dxin
+
+      !  below-cloud impaction
+      IF(it==id_prec) THEN
+        d_tr_bcscav(i, k, it) = 0.
+      ELSE
+        pr = 0.5 * (flxr(i, k) + flxr(i, k + 1))
+        ps = 0.5 * (flxs(i, k) + flxs(i, k + 1))
+        water = pr * alpha_r(it) / R_r / rho_water
+        ice = ps * alpha_s(it) / R_s / rho_ice
+        dxbc(i, k) = -3. / 4. * tr_seri(i, k, it) * pdtime * (water + ice)
+        !   add tracers from below cloud scav in his_dh
+        his_dh(i) = his_dh(i) - dxbc(i, k) * zmass(i, k) / pdtime !  kg/m2/s
+        d_tr_bcscav(i, k, it) = dxbc(i, k)
+      ENDIF
+
+      !  reevaporation
+      deltaP(i, k) = flxr(i, k + 1) + flxs(i, k + 1) - flxr(i, k) - flxs(i, k)
+      deltaP(i, k) = max(deltaP(i, k), 0.)
+
+      IF(flxr(i, k + 1) + flxs(i, k + 1)>1.e-16) THEN
+        beta_ev(i, k) = deltaP(i, k) / (flxr(i, k + 1) + flxs(i, k + 1))
+      else
+        beta_ev(i, k) = 0.
       endif
 
-      beta_ev(i,k)=max(min(1.,beta_ev(i,k)),0.)
-
-!jyg
-      
-      IF(abs(1-(1-frac_ev)*beta_ev(i,k))>1.e-16) THEN
-! remove tracers from precipitation owing to release by evaporation in his_dh
-!      dxev=frac_ev*beta_ev(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
-      dxev=frac_ev*beta_ev(i,k)*his_dh(i) *pdtime/(zmass(i,k)) &
-                                      /(1 -(1-frac_ev)*beta_ev(i,k))
-       his_dh(i)=his_dh(i)*(1 - frac_ev*beta_ev(i,k) / (1 -(1-frac_ev)*beta_ev(i,k)))
+      beta_ev(i, k) = max(min(1., beta_ev(i, k)), 0.)
+
+      !jyg
+
+      IF(abs(1 - (1 - frac_ev) * beta_ev(i, k))>1.e-16) THEN
+        ! remove tracers from precipitation owing to release by evaporation in his_dh
+        !      dxev=frac_ev*beta_ev(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
+        dxev = frac_ev * beta_ev(i, k) * his_dh(i) * pdtime / (zmass(i, k)) &
+                / (1 - (1 - frac_ev) * beta_ev(i, k))
+        his_dh(i) = his_dh(i) * (1 - frac_ev * beta_ev(i, k) / (1 - (1 - frac_ev) * beta_ev(i, k)))
       else
-!       dxev=his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k))
-       dxev=his_dh(i) *pdtime/(zmass(i,k))
-       his_dh(i)=0.
+        !       dxev=his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k))
+        dxev = his_dh(i) * pdtime / (zmass(i, k))
+        his_dh(i) = 0.
       endif
-!      PRINT*,  k, 'beta_ev',beta_ev
-! remove tracers from precipitation owing to release by evaporation in his_dh
-!!      dxev=frac_ev*deltaP(i,k)*pdtime * his_dh(i) /(zrho(i,k)*zdz(i,k))
-!rplmd
-!!      dxev=frac_ev*deltaP(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
-!!                                      /max(flxr(i,k)+flxs(i,k),1.e-16)
-
-
-      d_tr_evap(i,k,it)=dxev
-!!     tendency is further added in phytrac x = x + dx
+      !      PRINT*,  k, 'beta_ev',beta_ev
+      ! remove tracers from precipitation owing to release by evaporation in his_dh
+      !!      dxev=frac_ev*deltaP(i,k)*pdtime * his_dh(i) /(zrho(i,k)*zdz(i,k))
+      !rplmd
+      !!      dxev=frac_ev*deltaP(i,k)*his_dh(i) *pdtime/(zrho(i,k)*zdz(i,k)) &
+      !!                                      /max(flxr(i,k)+flxs(i,k),1.e-16)
+
+      d_tr_evap(i, k, it) = dxev
+      !!     tendency is further added in phytrac x = x + dx
     ENDDO !!  do i
-   ENDDO  !! do k
-
-!jyg (20130114)
-   DO i = 1,klon
-     qPrls(i,it) = his_dh(i)/max(flxr(i,1)+flxs(i,1),1.e-16)
-   ENDDO
-!jyg end
-
-
-! test de conservation
-      conserv=0.
-!      DO k= klev,1,-1
-!        DO i=1, klon
-!         conserv=conserv+d_tr_insc(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG &
-!                +d_tr_bcscav(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG  &
-!                +d_tr_evap(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG
-!      IF(it.EQ.3) WRITE(*,'(I2,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12)'),&
-!      k,'lsc conserv ',conserv,'insc',d_tr_insc(i,k,it),'bc',d_tr_bcscav(i,k,it),'ev',d_tr_evap(i,k,it)
-!       ENDDO
-!     ENDDO
+  ENDDO  !! do k
+
+  !jyg (20130114)
+  DO i = 1, klon
+    qPrls(i, it) = his_dh(i) / max(flxr(i, 1) + flxs(i, 1), 1.e-16)
+  ENDDO
+  !jyg end
+
+
+  ! test de conservation
+  conserv = 0.
+  !      DO k= klev,1,-1
+  !        DO i=1, klon
+  !         conserv=conserv+d_tr_insc(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG &
+  !                +d_tr_bcscav(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG  &
+  !                +d_tr_evap(i,k,it)*(paprs(i,k)-paprs(i,k+1))/RG
+  !      IF(it.EQ.3) WRITE(*,'(I2,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12)'),&
+  !      k,'lsc conserv ',conserv,'insc',d_tr_insc(i,k,it),'bc',d_tr_bcscav(i,k,it),'ev',d_tr_evap(i,k,it)
+  !       ENDDO
+  !     ENDDO
 
 END SUBROUTINE lsc_scav_spl
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 5160)
@@ -9,5 +9,5 @@
   USE time_phylmdz_mod, ONLY: day_step_phy, start_time, itau_phy
 
-  USE phytracr_spl_mod, ONLY: ok_chimeredust, id_prec, id_fine, id_coss, &
+  USE lmdz_phytracr_spl, ONLY: ok_chimeredust, id_prec, id_fine, id_coss, &
           id_codu, id_scdu, &
           d_tr_cl, d_tr_th, d_tr_cv, d_tr_lessi_impa, &
@@ -89,5 +89,5 @@
 
     ! This SUBROUTINE does the actual writing of diagnostics that were
-    ! defined and initialised mainly in phytracr_spl_mod.F90 (SPLA tracers, SUBROUTINE phytracr_spl_out_init)
+    ! defined and initialised mainly in lmdz_phytracr_spl.F90 (SPLA tracers, SUBROUTINE phytracr_spl_out_init)
 
     USE dimphy, ONLY: klon, klev, klevp1
@@ -400,5 +400,7 @@
     USE lmdz_compbl, ONLY: iflag_pbl, iflag_pbl_split, iflag_order2_sollw, ifl_pbltree
 
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+    USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+    USE lmdz_phys_constants, ONLY: dobson_u
+
     IMPLICIT NONE
 
@@ -436,5 +438,4 @@
     INTEGER, DIMENSION(iim * jjmp1) :: ndex2d
     INTEGER, DIMENSION(iim * jjmp1 * klev) :: ndex3d
-    REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
     REAL :: missing_val
     REAL, PARAMETER :: un_jour = 86400.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90	(revision 5159)
+++ 	(revision )
@@ -1,4489 +1,0 @@
-! $Id: physiq.F90 2298 2015-06-14 19:13:32Z fairhead $
-!#define IO_DEBUG
-
-MODULE phytracr_spl_mod
-
-
-  ! Recuperation des morceaux de la physique de Jeronimo specifiques
-  ! du modele d'aerosols d'Olivier n'co.
-
-  INCLUDE "chem.h"
-  INCLUDE "chem_spla.h"
-
-  REAL, SAVE :: scale_param_ssacc  !Scaling parameter for Fine Sea Salt
-  REAL, SAVE :: scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
-
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_ind !Scaling parameter for industrial emissions of SO2
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_bb  !Scaling parameter for biomas burning (SO2,BC & OM)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_ff  !Scaling parameter for industrial emissions (fossil fuel)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustacc  !Scaling parameter for Fine Dust
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustcoa  !Scaling parameter for Coarse Dust
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustsco  !Scaling parameter for SCoarse Dust
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: param_wstarBLperregion  !parameter for ..
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: param_wstarWAKEperregion  !parameter for ..
-  !$OMP THREADPRIVATE(scale_param_ind,scale_param_bb,scale_param_ff)
-  !$OMP THREADPRIVATE(scale_param_dustacc,scale_param_dustcoa,scale_param_dustsco)
-  !$OMP THREADPRIVATE(scale_param_ssacc,scale_param_sscoa)
-  !$OMP THREADPRIVATE(param_wstarBLperregion,param_wstarWAKEperregion)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dust_ec, u10m_ec, v10m_ec
-  !$OMP THREADPRIVATE(dust_ec, u10m_ec, v10m_ec)
-
-  CHARACTER*800 fileregionsdimsind
-  CHARACTER*800 fileregionsdimsdust
-  CHARACTER*800 fileregionsdimsbb
-  CHARACTER*800 fileregionsdimswstar
-  CHARACTER*100 paramname_ind
-  CHARACTER*100 paramname_bb
-  CHARACTER*100 paramname_ff
-  CHARACTER*100 paramname_dustacc
-  CHARACTER*100 paramname_dustcoa
-  CHARACTER*100 paramname_dustsco
-  CHARACTER*100 paramname_ssacc
-  CHARACTER*100 paramname_sscoa
-  CHARACTER*100 paramname_wstarBL
-  CHARACTER*100 paramname_wstarWAKE
-
-  CHARACTER*800 filescaleparams
-  CHARACTER*800 paramsname
-
-
-  !!------------------------ SULFUR emissions ----------------------------
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2volc_cont  ! emissions so2 volcan continuous
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_altvolc_cont  ! altitude  so2 volcan continuous
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2volc_expl  ! emissions so2 volcan explosive
-  !$OMP THREADPRIVATE( lmt_so2volc_cont,lmt_altvolc_cont,lmt_so2volc_expl )
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_altvolc_expl  ! altitude  so2 volcan explosive
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ff_l       ! emissions so2 fossil fuel (low)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ff_h       ! emissions so2 fossil fuel (high)
-  !$OMP THREADPRIVATE( lmt_altvolc_expl,lmt_so2ff_l,lmt_so2ff_h )
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2nff        ! emissions so2 non-fossil fuel
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ba         ! emissions de so2 bateau
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2bb_l       ! emissions de so2 biomass burning (low)
-  !$OMP THREADPRIVATE( lmt_so2nff,lmt_so2ba,lmt_so2bb_l )
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2bb_h       ! emissions de so2 biomass burning (high)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_dmsconc       ! concentration de dms oceanique
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_dmsbio        ! emissions de dms bio
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_h2sbio        ! emissions de h2s bio
-  !$OMP THREADPRIVATE(lmt_so2bb_h,lmt_dmsconc,lmt_dmsbio,lmt_h2sbio )
-  !------------------------- BLACK CARBON emissions ----------------------
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcff       ! emissions de BC fossil fuels
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcnff      ! emissions de BC non-fossil fuels
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcbb_l     ! emissions de BC biomass basses
-  !$OMP THREADPRIVATE( lmt_bcff,lmt_bcnff,lmt_bcbb_l)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcbb_h     ! emissions de BC biomass hautes
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcba       ! emissions de BC bateau
-  !$OMP THREADPRIVATE(lmt_bcbb_h,lmt_bcba)
-  !------------------------ ORGANIC MATTER emissions ---------------------
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omff     ! emissions de OM fossil fuels
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omnff    ! emissions de OM non-fossil fuels
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_ombb_l   ! emissions de OM biomass basses
-  !$OMP THREADPRIVATE( lmt_omff,lmt_omnff,lmt_ombb_l)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_ombb_h   ! emissions de OM biomass hautes
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omnat    ! emissions de OM Natural
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omba     ! emissions de OM bateau
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: lmt_sea_salt    ! emissions de OM Natural
-  !$OMP THREADPRIVATE(lmt_ombb_h,lmt_omnat,lmt_omba,lmt_sea_salt)
-
-  !JE20141224 >>
-  ! others
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: tsol
-  !$OMP THREADPRIVATE(tsol)
-  INTEGER :: ijulday
-  LOGICAL, parameter :: edgar = .TRUE.
-  INTEGER, parameter :: flag_dms = 4
-  INTEGER(kind = 4)  nbjour
-
-  ! Tracer tendencies, for outputs
-  !-------------------------------
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl  ! Td couche
-  !. limite/traceur
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dec
-  !RomP
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv  ! Td
-  !onvection/traceur
-  ! RomP >>>
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_insc
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_bcscav
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_evapls
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_ls
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_trsp
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sscav
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sat
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_uscav
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPr, qDi ! concentration tra
-  !dans pluie,air descente insaturee
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPa, qMel
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qTrdi, dtrcvMA ! conc traceur
-  !descente air insaturee et td convective MA
-  !! RomP <<<
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th  ! Td thermique
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_impa ! Td du
-  !lessivage par impaction
-  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_nucl ! Td du
-  !lessivage par nucleation
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: qPrls      !jyg:
-  !oncentration tra dans pluie LS a la surf.
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dry ! Td depot
-  !sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: flux_tr_dry ! depot
-  !sec/traceur (surface),ALLOCATABLE,SAVE    jyg
-
-  ! Index of each traceur
-  INTEGER, SAVE :: id_prec, id_fine, id_coss, id_codu, id_scdu
-
-  !$OMP THREADPRIVATE(d_tr_cl,d_tr_dec,d_tr_cv,d_tr_insc,d_tr_bcscav,d_tr_evapls)
-  !$OMP THREADPRIVATE(d_tr_ls,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav)
-  !$OMP THREADPRIVATE(qPr,qDi,qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa)
-  !$OMP THREADPRIVATE(d_tr_lessi_nucl,qPrls,d_tr_dry,flux_tr_dry)
-  !$OMP THREADPRIVATE(id_prec,id_fine,id_coss,id_codu,id_scdu)
-
-  ! JE20141224 <<
-
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diff_aod550_tot  ! epaisseur optique total aerosol 550  nm
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_tot  ! epaisseur optique total aerosol 670 nm
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_tot  ! epaisseur optique total aerosol 865 nm
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diff_aod550_tr2  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_tr2  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_tr2  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_ss  ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_ss  ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_ss   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_dust ! epaisseur optique Dust aerosol 550 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_dust ! epaisseur optique Dust aerosol 670 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_dust ! epaisseur optique Dust aerosol 865 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_dustsco ! epaisseur optique Dust SCOarse aerosol 550 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_dustsco ! epaisseur optique Dust SCOarse aerosol 670 nm, diagnostic
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_dustsco ! epaisseur optique Dust SCOarse aerosol 865 nm, diagnostic
-
-  !$OMP THREADPRIVATE(diff_aod550_tot,diag_aod670_tot,diag_aod865_tot)
-  !$OMP THREADPRIVATE(diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2)
-  !$OMP THREADPRIVATE(diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,diag_aod550_dust)
-  !$OMP THREADPRIVATE(diag_aod670_dust,diag_aod865_dust,diag_aod550_dustsco)
-  !$OMP THREADPRIVATE(diag_aod670_dustsco,diag_aod865_dustsco)
-
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
-
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-
-  !$OMP THREADPRIVATE(aod550_aqua,aod550_tr2_aqua,aod550_ss_aqua,aod550_dust_aqua,aod550_dustsco_aqua)
-  !$OMP THREADPRIVATE(aod670_aqua,aod670_tr2_aqua,aod670_ss_aqua,aod670_dust_aqua,aod670_dustsco_aqua)
-  !$OMP THREADPRIVATE(aod865_aqua,aod865_tr2_aqua,aod865_ss_aqua,aod865_dust_aqua,aod865_dustsco_aqua)
-  !$OMP THREADPRIVATE(aod550_terra,aod550_tr2_terra,aod550_ss_terra,aod550_dust_terra,aod550_dustsco_terra)
-  !$OMP THREADPRIVATE(aod670_terra,aod670_tr2_terra,aod670_ss_terra,aod670_dust_terra,aod670_dustsco_terra)
-  !$OMP THREADPRIVATE(aod865_terra,aod865_tr2_terra,aod865_ss_terra,aod865_dust_terra,aod865_dustsco_terra)
-
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc01 ! surface concentration
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm01   ! burden
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc02 ! surface concentration
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm02   ! burden
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc03 ! surface concentration
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm03   ! burden
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc04 ! surface concentration
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm04   ! burden
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc05 ! surface concentration
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm05   ! burden
-  !$OMP THREADPRIVATE(sconc01,sconc02,sconc03,sconc04,sconc05)
-  !$OMP THREADPRIVATE(trm01,trm02,trm03,trm04,trm05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux05
-  !$OMP THREADPRIVATE(flux01,flux02,flux03,flux04,flux05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds05
-  !$OMP THREADPRIVATE(ds01,ds02,ds03,ds04,ds05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh05
-  !$OMP THREADPRIVATE(dh01,dh02,dh03,dh04,dh05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv05
-  !$OMP THREADPRIVATE(dtrconv01,dtrconv02,dtrconv03,dtrconv04,dtrconv05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm05
-  !$OMP THREADPRIVATE(dtherm01,dtherm02,dtherm03,dtherm04,dtherm05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv05
-  !$OMP THREADPRIVATE(dhkecv01,dhkecv02,dhkecv03,dhkecv04,dhkecv05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds05
-  !$OMP THREADPRIVATE(d_tr_ds01,d_tr_ds02,d_tr_ds03,d_tr_ds04,d_tr_ds05)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc01
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc02
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc03
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc04
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc05
-  !$OMP THREADPRIVATE(dhkelsc01,dhkelsc02,dhkelsc03,dhkelsc04,dhkelsc05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv05
-  !$OMP THREADPRIVATE(d_tr_cv01,d_tr_cv02,d_tr_cv03,d_tr_cv04,d_tr_cv05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp05
-  !$OMP THREADPRIVATE(d_tr_trsp01,d_tr_trsp02,d_tr_trsp03,d_tr_trsp04,d_tr_trsp05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav05
-  !$OMP THREADPRIVATE(d_tr_sscav01,d_tr_sscav02,d_tr_sscav03,d_tr_sscav04,d_tr_sscav05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat05
-  !$OMP THREADPRIVATE(d_tr_sat01,d_tr_sat02,d_tr_sat03,d_tr_sat04,d_tr_sat05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav05
-  !$OMP THREADPRIVATE(d_tr_uscav01,d_tr_uscav02,d_tr_uscav03,d_tr_uscav04,d_tr_uscav05)
-
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc05
-  !$OMP THREADPRIVATE(d_tr_insc01,d_tr_insc02,d_tr_insc03,d_tr_insc04,d_tr_insc05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav05
-  !$OMP THREADPRIVATE(d_tr_bcscav01,d_tr_bcscav02,d_tr_bcscav03,d_tr_bcscav04,d_tr_bcscav05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls05
-  !$OMP THREADPRIVATE(d_tr_evapls01,d_tr_evapls02,d_tr_evapls03,d_tr_evapls04,d_tr_evapls05)
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls05
-  !$OMP THREADPRIVATE(d_tr_ls01,d_tr_ls02,d_tr_ls03,d_tr_ls04,d_tr_ls05)
-
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn05
-  !$OMP THREADPRIVATE(d_tr_dyn01,d_tr_dyn02,d_tr_dyn03,d_tr_dyn04,d_tr_dyn05)
-
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl05
-  !$OMP THREADPRIVATE(d_tr_cl01,d_tr_cl02,d_tr_cl03,d_tr_cl04,d_tr_cl05)
-
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th01
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th02
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th03
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th04
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th05
-  !$OMP THREADPRIVATE(d_tr_th01,d_tr_th02,d_tr_th03,d_tr_th04,d_tr_th05)
-
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_ss3D    ! corresponds to tracer 3
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_dust3D  ! corresponds to tracer 4
-  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_dustsco3D  ! corresponds to tracer 4
-  !$OMP THREADPRIVATE(sed_ss3D,sed_dust3D,sed_dustsco3D)
-
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_ss    ! corresponds to tracer 3
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dust  ! corresponds to tracer 4
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dustsco  ! corresponds to tracer 4
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2pgas  ! corresponds to tracer 4
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2paer  ! corresponds to tracer 4
-  !$OMP THREADPRIVATE(sed_ss,sed_dust,sed_dustsco,his_g2pgas,his_g2paer)
-
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbb
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcbb
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcnff
-  !$OMP THREADPRIVATE(fluxbb,fluxff,fluxbcbb,fluxbcff,fluxbcnff)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcba
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbc
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxombb
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnff
-  !$OMP THREADPRIVATE(fluxbcba,fluxbc,fluxombb,fluxomff,fluxomnff)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomba
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnat
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxom
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2snff
-  !$OMP THREADPRIVATE(fluxomba,fluxomnat,fluxom,fluxh2sff,fluxh2snff)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2nff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2bb
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2vol
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ba
-  !$OMP THREADPRIVATE(fluxso2ff,fluxso2nff,fluxso2bb,fluxso2vol,fluxso2ba)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4nff
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4bb
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ba
-  !$OMP THREADPRIVATE(fluxso2,fluxso4ff,fluxso4nff,fluxso4ba,fluxso4bb)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdms
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sbio
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdustec
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddfine
-  !$OMP THREADPRIVATE(fluxso4,fluxdms,fluxh2sbio,fluxdustec,fluxddfine)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddcoa
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddsco
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdd
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxssfine
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxsscoa
-  !$OMP THREADPRIVATE(fluxddcoa,fluxddsco,fluxdd,fluxssfine,fluxsscoa)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxss
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ind
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_bb
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ff
-  !$OMP THREADPRIVATE(fluxss,flux_sparam_ind,flux_sparam_bb,flux_sparam_ff)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddfine
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddcoa
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddsco
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ssfine
-  !$OMP THREADPRIVATE(flux_sparam_ddfine,flux_sparam_ddcoa)
-  !$OMP THREADPRIVATE(flux_sparam_ddsco,flux_sparam_ssfine)
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_sscoa
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: u10m_ss
-  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: v10m_ss
-  !$OMP THREADPRIVATE(flux_sparam_sscoa,u10m_ss,v10m_ss)
-
-  ! Select dust emission scheme for the Sahara:
-  !      LOGICAL,PARAMETER,SAVE ::  ok_chimeredust=.FALSE.
-  LOGICAL, PARAMETER :: ok_chimeredust = .TRUE.
-  !!!!!! !$OMP THREADPRIVATE(ok_chimeredust)
-
-
-CONTAINS
-
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  SUBROUTINE phytracr_spl_out_init()
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !AS : This SUBROUTINE centralises the ALLOCATE needed for the 1st CALL of
-    !     phys_output_write_spl in physiq
-
-    USE dimphy
-    USE infotrac_phy, ONLY: nbtr
-    USE dustemission_mod, ONLY: dustemis_out_init
-
-    ! pour les variables m[1-3]dflux
-    CALL dustemis_out_init()
-
-    !traceur
-    ALLOCATE(diff_aod550_tot(klon))
-    ALLOCATE(diag_aod670_tot(klon))
-    ALLOCATE(diag_aod865_tot(klon))
-    ALLOCATE(diff_aod550_tr2(klon))
-    ALLOCATE(diag_aod670_tr2(klon))
-    ALLOCATE(diag_aod865_tr2(klon))
-    ALLOCATE(diag_aod550_ss(klon))
-    ALLOCATE(diag_aod670_ss(klon))
-    ALLOCATE(diag_aod865_ss(klon))
-    ALLOCATE(diag_aod550_dust(klon))
-    ALLOCATE(diag_aod670_dust(klon))
-    ALLOCATE(diag_aod865_dust(klon))
-    ALLOCATE(diag_aod550_dustsco(klon))
-    ALLOCATE(diag_aod670_dustsco(klon))
-    ALLOCATE(diag_aod865_dustsco(klon))
-    !AS: les 15 vars _terra et 15 _aqua suivantes sont groupees differemment dans spla_output_write.h
-    ALLOCATE(aod550_terra(klon))
-    ALLOCATE(aod550_tr2_terra(klon))
-    ALLOCATE(aod550_ss_terra(klon))
-    ALLOCATE(aod550_dust_terra(klon))
-    ALLOCATE(aod550_dustsco_terra(klon))
-    ALLOCATE(aod670_terra(klon))
-    ALLOCATE(aod670_tr2_terra(klon))
-    ALLOCATE(aod670_ss_terra(klon))
-    ALLOCATE(aod670_dust_terra(klon))
-    ALLOCATE(aod670_dustsco_terra(klon))
-    ALLOCATE(aod865_terra(klon))
-    ALLOCATE(aod865_tr2_terra(klon))
-    ALLOCATE(aod865_ss_terra(klon))
-    ALLOCATE(aod865_dust_terra(klon))
-    ALLOCATE(aod865_dustsco_terra(klon))
-
-    ALLOCATE(aod550_aqua(klon))
-    ALLOCATE(aod550_tr2_aqua(klon))
-    ALLOCATE(aod550_ss_aqua(klon))
-    ALLOCATE(aod550_dust_aqua(klon))
-    ALLOCATE(aod550_dustsco_aqua(klon))
-    ALLOCATE(aod670_aqua(klon))
-    ALLOCATE(aod670_tr2_aqua(klon))
-    ALLOCATE(aod670_ss_aqua(klon))
-    ALLOCATE(aod670_dust_aqua(klon))
-    ALLOCATE(aod670_dustsco_aqua(klon))
-    ALLOCATE(aod865_aqua(klon))
-    ALLOCATE(aod865_tr2_aqua(klon))
-    ALLOCATE(aod865_ss_aqua(klon))
-    ALLOCATE(aod865_dust_aqua(klon))
-    ALLOCATE(aod865_dustsco_aqua(klon))
-
-    ALLOCATE(sconc01(klon))
-    ALLOCATE(trm01(klon))
-    ALLOCATE(sconc02(klon))
-    ALLOCATE(trm02(klon))
-    ALLOCATE(sconc03(klon))
-    ALLOCATE(trm03(klon))
-    ALLOCATE(sconc04(klon))
-    ALLOCATE(trm04(klon))
-    ALLOCATE(sconc05(klon))
-    ALLOCATE(trm05(klon))
-
-    ! Lessivage
-    ALLOCATE(flux01(klon))
-    ALLOCATE(flux02(klon))
-    ALLOCATE(flux03(klon))
-    ALLOCATE(flux04(klon))
-    ALLOCATE(flux05(klon))
-    ALLOCATE(ds01(klon))
-    ALLOCATE(ds02(klon))
-    ALLOCATE(ds03(klon))
-    ALLOCATE(ds04(klon))
-    ALLOCATE(ds05(klon))
-    ALLOCATE(dh01(klon))
-    ALLOCATE(dh02(klon))
-    ALLOCATE(dh03(klon))
-    ALLOCATE(dh04(klon))
-    ALLOCATE(dh05(klon))
-    ALLOCATE(dtrconv01(klon))
-    ALLOCATE(dtrconv02(klon))
-    ALLOCATE(dtrconv03(klon))
-    ALLOCATE(dtrconv04(klon))
-    ALLOCATE(dtrconv05(klon))
-    ALLOCATE(dtherm01(klon))
-    ALLOCATE(dtherm02(klon))
-    ALLOCATE(dtherm03(klon))
-    ALLOCATE(dtherm04(klon))
-    ALLOCATE(dtherm05(klon))
-    ALLOCATE(dhkecv01(klon))
-    ALLOCATE(dhkecv02(klon))
-    ALLOCATE(dhkecv03(klon))
-    ALLOCATE(dhkecv04(klon))
-    ALLOCATE(dhkecv05(klon))
-    ALLOCATE(d_tr_ds01(klon))
-    ALLOCATE(d_tr_ds02(klon))
-    ALLOCATE(d_tr_ds03(klon))
-    ALLOCATE(d_tr_ds04(klon))
-    ALLOCATE(d_tr_ds05(klon))
-    ALLOCATE(dhkelsc01(klon))
-    ALLOCATE(dhkelsc02(klon))
-    ALLOCATE(dhkelsc03(klon))
-    ALLOCATE(dhkelsc04(klon))
-    ALLOCATE(dhkelsc05(klon))
-    ALLOCATE(d_tr_cv01(klon, klev))
-    ALLOCATE(d_tr_cv02(klon, klev))
-    ALLOCATE(d_tr_cv03(klon, klev))
-    ALLOCATE(d_tr_cv04(klon, klev))
-    ALLOCATE(d_tr_cv05(klon, klev))
-    ALLOCATE(d_tr_trsp01(klon, klev))
-    ALLOCATE(d_tr_trsp02(klon, klev))
-    ALLOCATE(d_tr_trsp03(klon, klev))
-    ALLOCATE(d_tr_trsp04(klon, klev))
-    ALLOCATE(d_tr_trsp05(klon, klev))
-    ALLOCATE(d_tr_sscav01(klon, klev))
-    ALLOCATE(d_tr_sscav02(klon, klev))
-    ALLOCATE(d_tr_sscav03(klon, klev))
-    ALLOCATE(d_tr_sscav04(klon, klev))
-    ALLOCATE(d_tr_sscav05(klon, klev))
-    ALLOCATE(d_tr_sat01(klon, klev))
-    ALLOCATE(d_tr_sat02(klon, klev))
-    ALLOCATE(d_tr_sat03(klon, klev))
-    ALLOCATE(d_tr_sat04(klon, klev))
-    ALLOCATE(d_tr_sat05(klon, klev))
-    ALLOCATE(d_tr_uscav01(klon, klev))
-    ALLOCATE(d_tr_uscav02(klon, klev))
-    ALLOCATE(d_tr_uscav03(klon, klev))
-    ALLOCATE(d_tr_uscav04(klon, klev))
-    ALLOCATE(d_tr_uscav05(klon, klev))
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    ALLOCATE(d_tr_insc01(klon, klev))
-    ALLOCATE(d_tr_insc02(klon, klev))
-    ALLOCATE(d_tr_insc03(klon, klev))
-    ALLOCATE(d_tr_insc04(klon, klev))
-    ALLOCATE(d_tr_insc05(klon, klev))
-    ALLOCATE(d_tr_bcscav01(klon, klev))
-    ALLOCATE(d_tr_bcscav02(klon, klev))
-    ALLOCATE(d_tr_bcscav03(klon, klev))
-    ALLOCATE(d_tr_bcscav04(klon, klev))
-    ALLOCATE(d_tr_bcscav05(klon, klev))
-    ALLOCATE(d_tr_evapls01(klon, klev))
-    ALLOCATE(d_tr_evapls02(klon, klev))
-    ALLOCATE(d_tr_evapls03(klon, klev))
-    ALLOCATE(d_tr_evapls04(klon, klev))
-    ALLOCATE(d_tr_evapls05(klon, klev))
-    ALLOCATE(d_tr_ls01(klon, klev))
-    ALLOCATE(d_tr_ls02(klon, klev))
-    ALLOCATE(d_tr_ls03(klon, klev))
-    ALLOCATE(d_tr_ls04(klon, klev))
-    ALLOCATE(d_tr_ls05(klon, klev))
-
-    ALLOCATE(d_tr_dyn01(klon, klev))
-    ALLOCATE(d_tr_dyn02(klon, klev))
-    ALLOCATE(d_tr_dyn03(klon, klev))
-    ALLOCATE(d_tr_dyn04(klon, klev))
-    ALLOCATE(d_tr_dyn05(klon, klev))
-
-    ALLOCATE(d_tr_cl01(klon, klev))
-    ALLOCATE(d_tr_cl02(klon, klev))
-    ALLOCATE(d_tr_cl03(klon, klev))
-    ALLOCATE(d_tr_cl04(klon, klev))
-    ALLOCATE(d_tr_cl05(klon, klev))
-    ALLOCATE(d_tr_th01(klon, klev))
-    ALLOCATE(d_tr_th02(klon, klev))
-    ALLOCATE(d_tr_th03(klon, klev))
-    ALLOCATE(d_tr_th04(klon, klev))
-    ALLOCATE(d_tr_th05(klon, klev))
-
-    ALLOCATE(sed_ss(klon))
-    ALLOCATE(sed_dust(klon))
-    ALLOCATE(sed_dustsco(klon))
-    ALLOCATE(his_g2pgas(klon))
-    ALLOCATE(his_g2paer(klon))
-
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    ALLOCATE(sed_ss3D(klon, klev))
-    ALLOCATE(sed_dust3D(klon, klev))
-    ALLOCATE(sed_dustsco3D(klon, klev))
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    ! histrac_spl
-
-    ALLOCATE(fluxbb(klon))
-    ALLOCATE(fluxff(klon))
-    ALLOCATE(fluxbcbb(klon))
-    ALLOCATE(fluxbcff(klon))
-    ALLOCATE(fluxbcnff(klon))
-    ALLOCATE(fluxbcba(klon))
-    ALLOCATE(fluxbc(klon))
-    ALLOCATE(fluxombb(klon))
-    ALLOCATE(fluxomff(klon))
-    ALLOCATE(fluxomnff(klon))
-    ALLOCATE(fluxomba(klon))
-    ALLOCATE(fluxomnat(klon))
-    ALLOCATE(fluxom(klon))
-    ALLOCATE(fluxh2sff(klon))
-    ALLOCATE(fluxh2snff(klon))
-    ALLOCATE(fluxso2ff(klon))
-    ALLOCATE(fluxso2nff(klon))
-    ALLOCATE(fluxso2bb(klon))
-    ALLOCATE(fluxso2vol(klon))
-    ALLOCATE(fluxso2ba(klon))
-    ALLOCATE(fluxso2(klon))
-    ALLOCATE(fluxso4ff(klon))
-    ALLOCATE(fluxso4nff(klon))
-    ALLOCATE(fluxso4bb(klon))
-    ALLOCATE(fluxso4ba(klon))
-    ALLOCATE(fluxso4(klon))
-    ALLOCATE(fluxdms(klon))
-    ALLOCATE(fluxh2sbio(klon))
-    ALLOCATE(fluxdustec(klon))
-    ALLOCATE(fluxddfine(klon))
-    ALLOCATE(fluxddcoa(klon))
-    ALLOCATE(fluxddsco(klon))
-    ALLOCATE(fluxdd(klon))
-    ALLOCATE(fluxssfine(klon))
-    ALLOCATE(fluxsscoa(klon))
-    ALLOCATE(fluxss(klon))
-    ALLOCATE(flux_sparam_ind(klon))
-    ALLOCATE(flux_sparam_bb(klon))
-    ALLOCATE(flux_sparam_ff(klon))
-    ALLOCATE(flux_sparam_ddfine(klon))
-    ALLOCATE(flux_sparam_ddcoa(klon))
-    ALLOCATE(flux_sparam_ddsco(klon))
-    ALLOCATE(flux_sparam_ssfine(klon))
-    ALLOCATE(flux_sparam_sscoa(klon))
-    ALLOCATE(u10m_ss(klon))
-    ALLOCATE(v10m_ss(klon))
-
-    !AS: in phys_output_write_spl, but not in spla_output_write.h
-    !------------------------------------------------------
-    ALLOCATE(d_tr_cl(klon, klev, nbtr))
-    ALLOCATE(d_tr_th(klon, klev, nbtr))
-    ALLOCATE(d_tr_cv(klon, klev, nbtr))
-    ALLOCATE(d_tr_lessi_impa(klon, klev, nbtr))
-    ALLOCATE(d_tr_lessi_nucl(klon, klev, nbtr))
-    ALLOCATE(d_tr_insc(klon, klev, nbtr))
-    ALLOCATE(d_tr_bcscav(klon, klev, nbtr))
-    ALLOCATE(d_tr_evapls(klon, klev, nbtr))
-    ALLOCATE(d_tr_ls(klon, klev, nbtr))
-    ALLOCATE(d_tr_trsp(klon, klev, nbtr))
-    ALLOCATE(d_tr_sscav(klon, klev, nbtr))
-    ALLOCATE(d_tr_sat(klon, klev, nbtr))
-    ALLOCATE(d_tr_uscav(klon, klev, nbtr))
-
-  END SUBROUTINE phytracr_spl_out_init
-
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  SUBROUTINE phytracr_spl_ini(klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust)
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-    IMPLICIT NONE
-    INTEGER klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust
-
-    ALLOCATE(tsol(klon))
-
-    !AS: IF permettant le debranchage des coefs de Jeronimo Escribano: fichiers *_meta
-    ! nbreg_* sont initialisés à 1 dans phytracr_spl, if debutphy,
-    ! avant d'appeler la SUBROUTINE presente, phytracr_spl_ini
-    ! (phytracr_spl_ini appele readregionsdims2_spl,
-    ! qui lit et fait "bcast" de nbreg_ind,_bb,_dust,_wstardust dans fichiers regions_*_meta)
-    IF("ASSIM"=="YES") THEN
-      fileregionsdimsind = 'regions_ind_meta'
-      fileregionsdimsdust = 'regions_dustacc_meta'
-      !  fileregionsdimsdust='regions_dust_meta'
-      fileregionsdimsbb = 'regions_bb_meta'
-      fileregionsdimswstar = 'regions_pwstarwake_meta'
-      CALL  readregionsdims2_spl(nbreg_ind, fileregionsdimsind)
-      CALL  readregionsdims2_spl(nbreg_dust, fileregionsdimsdust)
-      CALL  readregionsdims2_spl(nbreg_bb, fileregionsdimsbb)
-      CALL  readregionsdims2_spl(nbreg_wstardust, fileregionsdimswstar)
-    ENDIF ! ASSIM
-    ! fin debranchage
-
-    !readregions_spl()
-
-    ALLOCATE(scale_param_ind(nbreg_ind))
-    ALLOCATE(scale_param_bb(nbreg_bb))
-    ALLOCATE(scale_param_ff(nbreg_ind))
-    ALLOCATE(scale_param_dustacc(nbreg_dust))
-    ALLOCATE(scale_param_dustcoa(nbreg_dust))
-    ALLOCATE(scale_param_dustsco(nbreg_dust))
-    ALLOCATE(param_wstarBLperregion(nbreg_wstardust))
-    ALLOCATE(param_wstarWAKEperregion(nbreg_wstardust))
-    ALLOCATE(dust_ec(klon))
-    ALLOCATE(u10m_ec(klon))
-    ALLOCATE(v10m_ec(klon))
-    ALLOCATE(lmt_so2volc_cont(klon))
-    ALLOCATE(lmt_altvolc_cont(klon))
-    ALLOCATE(lmt_so2volc_expl(klon))
-    ALLOCATE(lmt_altvolc_expl(klon))
-    ALLOCATE(lmt_so2ff_l(klon))
-    ALLOCATE(lmt_so2ff_h(klon))
-    ALLOCATE(lmt_so2nff(klon))
-    ALLOCATE(lmt_so2ba(klon))
-    ALLOCATE(lmt_so2bb_l(klon))
-    ALLOCATE(lmt_so2bb_h(klon))
-    ALLOCATE(lmt_dmsconc(klon))
-    ALLOCATE(lmt_dmsbio(klon))
-    ALLOCATE(lmt_h2sbio(klon))
-    ALLOCATE(lmt_bcff(klon))
-    ALLOCATE(lmt_bcnff(klon))
-    ALLOCATE(lmt_bcbb_l(klon))
-    ALLOCATE(lmt_bcbb_h(klon))
-    ALLOCATE(lmt_bcba(klon))
-    ALLOCATE(lmt_omff(klon))
-    ALLOCATE(lmt_omnff(klon))
-    ALLOCATE(lmt_ombb_l(klon))
-    ALLOCATE(lmt_ombb_h(klon))
-    ALLOCATE(lmt_omnat(klon))
-    ALLOCATE(lmt_omba(klon))
-    ALLOCATE(lmt_sea_salt(klon, ss_bins))
-
-
-
-
-    !temporal hardcoded null inicialization of assimilation emmision factors
-    !AS: scale_param sont ensuite lus dans modvalues.nc
-    ! par la SUBROUTINE read_scalenc, appelee par readscaleparamsnc_spl
-    scale_param_ssacc = 1.
-    scale_param_sscoa = 1.
-    scale_param_ind(:) = 1.
-    scale_param_bb(:) = 1.
-    scale_param_ff(:) = 1.
-    scale_param_dustacc(:) = 1.
-    scale_param_dustcoa(:) = 1.
-    scale_param_dustsco(:) = 1.
-    param_wstarBLperregion(:) = 0.
-    param_wstarWAKEperregion(:) = 0.
-
-
-  END SUBROUTINE phytracr_spl_ini
-
-
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  SUBROUTINE phytracr_spl(debutphy, lafin, jD_cur, jH_cur, iflag_conv, &  ! I
-          pdtphys, ftsol, &  ! I
-          t_seri, q_seri, paprs, pplay, RHcl, &  ! I
-          pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &  ! I
-          coefh, cdragh, cdragm, yu1, yv1, &  ! I
-          u_seri, v_seri, rlat, rlon, &  ! I
-          pphis, pctsrf, pmflxr, pmflxs, prfl, psfl, &  ! I
-          da, phi, phi2, d1a, dam, mp, ep, sigd, sij, clw, elij, &  ! I
-          epmlmMm, eplaMm, upwd, dnwd, itop_con, ibas_con, &  ! I
-          evapls, wdtrainA, wdtrainM, wght_cvfd, &  ! I
-          fm_therm, entr_therm, rneb, &  ! I
-          beta_fisrt, beta_v1, &  ! I
-          zu10m, zv10m, wstar, ale_bl, ale_wake, &  ! I
-          d_tr_dyn, tr_seri)                                            ! O
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-    USE lmdz_grid_phy
-    USE lmdz_phys_para
-    USE IOIPSL
-    USE dimphy
-    USE infotrac
-    USE indice_sol_mod
-    USE lmdz_writefield_phy
-
-    USE lmdz_phys_transfert_para
-    USE lmdz_thermcell_dq, ONLY: thermcell_dq
-    USE phys_cal_mod, ONLY: jD_1jan, year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
-            mth_cur, phys_cal_update
-
-    USE lmdz_yomcst
-    USE lmdz_alpale
-    USE lmdz_yoethf
-    USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
-    USE lmdz_paramet
-
-    IMPLICIT NONE
-
-    !======================================================================
-    ! Auteur(s) FH
-    ! Objet: Moniteur general des tendances traceurs
-
-    ! Remarques en vrac:
-    ! ------------------
-    ! 1/ le CALL phytrac se fait avec nqmax-2 donc nous avons bien
-    ! les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
-    !! AS : nqmax-2 devrait etre nqmax-3 apres introducton de H2Oi ;
-    !!   et c'est encore different avec le parser de DC ?
-    !======================================================================
-    INCLUDE "chem.h"
-    INCLUDE "chem_spla.h"
-
-    !======================================================================
-
-    ! Arguments:
-
-    !  EN ENTREE:
-    !  ==========
-
-    !  divers:
-    !  -------
-
-    REAL, INTENT(IN) :: pdtphys  ! pas d'integration pour la physique (seconde)
-    REAL, INTENT(IN) :: jD_cur, jH_cur
-    REAL, INTENT(IN) :: ftsol(klon, nbsrf)  ! temperature du sol par type
-    REAL, INTENT(IN) :: t_seri(klon, klev)  ! temperature
-    REAL, INTENT(IN) :: u_seri(klon, klev)  ! vent
-    REAL, INTENT(IN) :: v_seri(klon, klev)  ! vent
-    REAL, INTENT(IN) :: q_seri(klon, klev)  ! vapeur d eau kg/kg
-
-    LOGICAL, INTENT(IN) :: lafin
-
-    REAL tr_seri(klon, klev, nbtr) ! traceur
-    REAL tmp_var(klon, klev) ! auxiliary variable to replace traceur
-    REAL tmp_var2(klon, nbtr) ! auxiliary variable to replace source
-    REAL tmp_var3(klon, klev, nbtr) ! auxiliary variable 3D
-    REAL dummy1d ! JE auxiliary variable
-    REAL aux_var2(klon) ! auxiliary variable to replace traceur
-    REAL aux_var3(klon, klev) ! auxiliary variable to replace traceur
-    REAL d_tr(klon, klev, nbtr)    ! traceur  tendance
-    REAL sconc_seri(klon, nbtr) ! surface concentration of traceur
-
-    INTEGER nbjour
-    save nbjour
-    !$OMP THREADPRIVATE(nbjour)
-
-    INTEGER  masque_aqua_cur(klon)
-    INTEGER  masque_terra_cur(klon)
-    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_aqua  !mask for 1 day
-    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_terra !
-    !$OMP THREADPRIVATE(masque_aqua,masque_terra)
-
-    INTEGER, SAVE :: nbreg_dust, nbreg_ind, nbreg_bb, nbreg_ss, nbreg_wstardust
-    !$OMP THREADPRIVATE(nbreg_dust, nbreg_ind, nbreg_bb,nbreg_ss,nbreg_wstardust)
-
-    REAL lmt_dms(klon)           ! emissions de dms
-
-    !JE20150518<<
-    REAL, DIMENSION(klon_glo) :: aod550_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-
-    REAL, DIMENSION(klon_glo) :: aod550_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod550_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod670_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    REAL, DIMENSION(klon_glo) :: aod865_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-    !!!!!!!!!!!!!
-    !JE20150518>>
-
-    REAL, INTENT(IN) :: paprs(klon, klev + 1)  ! pression pour chaque inter-couche (en Pa)
-    REAL, INTENT(IN) :: pplay(klon, klev)  ! pression pour le mileu de chaque couche (en Pa)
-    REAL, INTENT(IN) :: RHcl(klon, klev)  ! humidite relativen ciel clair
-    REAL znivsig(klev)  ! indice des couches
-    REAL paire(klon)
-    REAL, INTENT(IN) :: pphis(klon)
-    REAL, INTENT(IN) :: pctsrf(klon, nbsrf)
-    logical, INTENT(IN) :: debutphy   ! le flag de l'initialisation de la physique
-
-    !  Scaling Parameters:
-    !  ----------------------
-
-    CHARACTER*50 c_Directory
-    CHARACTER*80 c_FileName1
-    CHARACTER*80 c_FileName2
-    CHARACTER*130 c_FullName1
-    CHARACTER*130 c_FullName2
-    INTEGER :: xidx, yidx
-    INTEGER, DIMENSION(klon) :: mask_bbreg
-    INTEGER, DIMENSION(klon) :: mask_ffso2reg
-    INTEGER :: aux_mask1
-    INTEGER :: aux_mask2
-    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_so4 !Defines regions for SO4 ; AS: PAS UTILISE!
-    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_ind  !Defines regions for SO2, BC & OM
-    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_bb   !Defines regions for SO2, BC & OM
-    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_dust !Defines  dust regions
-    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_wstardust !Defines  dust regions
-    !$OMP THREADPRIVATE(iregion_so4,iregion_ind,iregion_bb,iregion_dust,iregion_wstardust)
-
-    !  Emissions:
-
-    !---------------------------- SEA SALT & DUST emissions ------------------------
-    REAL lmt_sea_salt(klon, ss_bins) !Sea salt 0.03-8.0 um
-    REAL u10m_ec1(klon), v10m_ec1(klon)
-    REAL u10m_ec2(klon), v10m_ec2(klon), dust_ec2(klon)
-    REAL dust_ec(klon)
-    !     new dust emission chimere je20140522
-    REAL, DIMENSION(klon), INTENT(IN) :: zu10m
-    REAL, DIMENSION(klon), INTENT(IN) :: zv10m
-    REAL, DIMENSION(klon), INTENT(IN) :: wstar, ale_bl, ale_wake
-
-    !  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
-
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !Dynamique
-    !--------
-    REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: d_tr_dyn
-
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !  convection:
-    !  -----------
-
-    REAL, INTENT(IN) :: pmfu(klon, klev)  ! flux de masse dans le panache montant
-    REAL, INTENT(IN) :: pmfd(klon, klev)  ! flux de masse dans le panache descendant
-    REAL, INTENT(IN) :: pen_u(klon, klev) ! flux entraine dans le panache montant
-    REAL, INTENT(IN) :: pde_u(klon, klev) ! flux detraine dans le panache montant
-    REAL, INTENT(IN) :: pen_d(klon, klev) ! flux entraine dans le panache descendant
-    REAL, INTENT(IN) :: pde_d(klon, klev) ! flux detraine dans le panache descendant
-
-    !  Convection KE scheme:
-    !  ---------------------
-
-    !! Variables pour le lessivage convectif
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: da
-    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi
-    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi2
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: d1a, dam
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: mp
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: upwd      ! saturated
-    !            updraft mass flux
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: dnwd      ! saturated
-    !            downdraft mass flux
-    INTEGER, DIMENSION(klon), INTENT(IN) :: itop_con
-    INTEGER, DIMENSION(klon), INTENT(IN) :: ibas_con
-    REAL, DIMENSION(klon, klev) :: evapls
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainA
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainM
-
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: ep
-    REAL, DIMENSION(klon), INTENT(IN) :: sigd
-    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: sij
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: clw
-    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: elij
-    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: epmlmMm
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: eplaMm
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: wght_cvfd          !RL
-
-
-    !     KE: Tendances de traceurs (Td) et flux de traceurs:
-    !     ------------------------
-    REAL, DIMENSION(klon, klev) :: Mint
-    REAL, DIMENSION(klon, klev, nbtr) :: zmfd1a
-    REAL, DIMENSION(klon, klev, nbtr) :: zmfdam
-    REAL, DIMENSION(klon, klev, nbtr) :: zmfphi2
-
-    !                                                        !tra dans pluie LS a la surf.
-    !      outputs for cvltr_spl
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_trsp_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sscav_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sat_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_uscav_o
-    !!!!!!!!!!!!!!!!!
-    !!!!!!!!!!!!!!!!!
-    !!!!!!!!!!!!!!!!!
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_insc_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_bcscav_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_evapls_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_ls_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dyn_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl_o
-    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th_o
-    !!!!!!!!!!!!!!!!!
-    !!!!!!!!!!!!!!!!!
-    !!!!!!!!!!!!!!!!!
-
-    !$OMP THREADPRIVATE(d_tr_cv_o,d_tr_trsp_o,d_tr_sscav_o,d_tr_sat_o,d_tr_uscav_o)
-    !$OMP THREADPRIVATE(d_tr_insc_o,d_tr_bcscav_o,d_tr_evapls_o,d_tr_ls_o)
-    !$OMP THREADPRIVATE(d_tr_dyn_o,d_tr_cl_o,d_tr_th_o)
-
-    INTEGER :: nsplit
-
-    !  Lessivage
-    !  ---------
-
-    REAL, INTENT(IN) :: pmflxr(klon, klev + 1), pmflxs(klon, klev + 1)   !--convection
-    REAL, INTENT(IN) :: prfl(klon, klev + 1), psfl(klon, klev + 1)     !--large-scale
-    REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
-    REAL :: ql_incloud_ref    ! ref value of in-cloud condensed water content
-
-    REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb    ! fraction nuageuse (grande echelle)
-
-    REAL, DIMENSION(klon, klev) :: beta_fisrt ! taux de conversion
-    !                                                          ! de l'eau cond (de fisrtilp)
-    REAL, DIMENSION(klon, klev) :: beta_v1    ! -- (originale version)
-    INTEGER, SAVE :: iflag_lscav_omp, iflag_lscav
-    !$OMP THREADPRIVATE(iflag_lscav_omp,iflag_lscav)
-
-
-
-
-    !Thermiques:
-    !----------
-    REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: fm_therm
-    REAL, DIMENSION(klon, klev), INTENT(INOUT) :: entr_therm
-
-    !  Couche limite:
-    !  --------------
-
-    REAL, INTENT(IN) :: coefh(klon, klev) ! coeff melange CL
-    REAL, INTENT(IN) :: cdragh(klon), cdragm(klon)
-    REAL, INTENT(IN) :: yu1(klon)        ! vent dans la 1iere couche
-    REAL, INTENT(IN) :: yv1(klon)        ! vent dans la 1iere couche
-
-
-    !----------------------------------------------------------------------
-    REAL his_ds(klon, nbtr)
-    REAL his_dh(klon, nbtr)
-    REAL his_dhlsc(klon, nbtr)        ! in-cloud scavenging lsc
-    REAL his_dhcon(klon, nbtr)       ! in-cloud scavenging con
-    REAL his_dhbclsc(klon, nbtr)      ! below-cloud scavenging lsc
-    REAL his_dhbccon(klon, nbtr)      ! below-cloud scavenging con
-    REAL trm(klon, nbtr)
-
-    REAL u10m_ec(klon), v10m_ec(klon)
-
-    REAL his_th(klon, nbtr)
-    REAL his_dhkecv(klon, nbtr)
-    REAL his_dhkelsc(klon, nbtr)
-
-    !  Coordonnees
-    !  -----------
-
-    REAL, INTENT(IN) :: rlat(klon)       ! latitudes pour chaque point
-    REAL, INTENT(IN) :: rlon(klon)       ! longitudes pour chaque point
-
-    INTEGER i, k, iq, itr, j, ig
-
-    ! DEFINITION OF DIAGNOSTIC VARIABLES
-
-    REAL diag_trm(nbtr), diag_drydep(nbtr)
-    REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
-    REAL diag_emissn(nbtr), diag_g2part
-    REAL diag_sedimt
-    REAL trm_aux(nbtr), src_aux(nbtr)
-
-    ! Variables locales pour effectuer les appels en serie
-    !----------------------------------------------------
-    REAL source_tr(klon, nbtr)
-    REAL flux_tr(klon, nbtr)
-    REAL m_conc(klon, klev)
-    REAL henry(nbtr)  !--cste de Henry  mol/l/atm
-    REAL kk(nbtr)     !--coefficient de var avec T (K)
-    REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
-    REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
-    REAL vdep_oce(nbtr), vdep_sic(nbtr)
-    REAL vdep_ter(nbtr), vdep_lic(nbtr)
-    REAL ccntrAA_spla(nbtr)
-    REAL ccntrENV_spla(nbtr)
-    REAL coefcoli_spla(nbtr)
-    REAL dtrconv(klon, nbtr)
-    REAL zrho(klon, klev), zdz(klon, klev)
-    REAL zalt(klon, klev)
-    REAL, DIMENSION(klon, klev) :: zmasse    ! densité atmosphérique
-    !     .                                              Kg/m2
-    REAL, DIMENSION(klon, klev) :: ztra_th
-    REAL qmin, qmax, aux
-    !      PARAMETER (qmin=0.0, qmax=1.e33)
-    PARAMETER (qmin = 1.e33, qmax = -1.e33)
-
-    ! Variables to save data into file
-    !----------------------------------
-
-    CHARACTER*2 str2
-    !!AS:      LOGICAL ok_histrac
-    !!!JE2014124      PARAMETER (ok_histrac=.TRUE.)
-    !!      PARAMETER (ok_histrac=.FALSE.)
-    INTEGER ndex2d(iim * (jjm + 1)), ndex3d(iim * (jjm + 1) * klev)
-    INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
-    INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-    SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-    !$OMP THREADPRIVATE(nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5)
-    INTEGER itra
-    SAVE itra                    ! compteur pour la physique
-    !$OMP THREADPRIVATE(itra)
-    INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
-    SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
-    !$OMP THREADPRIVATE(ecrit_tra, ecrit_tra_h, ecrit_tra_m)
-    REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
-    REAL zx_tmp_2d(iim, jjm + 1), zx_tmp_3d(iim, jjm + 1, klev)
-    REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
-    REAL zx_lon_glo(nbp_lon, nbp_lat), zx_lat_glo(nbp_lon, nbp_lat)
-    REAL zsto, zout, zout_h, zout_m, zjulian
-
-    !------Molar Masses
-    REAL masse(nbtr)
-
-    REAL fracso2emis                              !--fraction so2 emis en so2
-    PARAMETER (fracso2emis = 0.95)
-    REAL frach2sofso2                             !--fraction h2s from so2
-    PARAMETER (frach2sofso2 = 0.0426)
-
-    !  Controles
-    !-------------
-    LOGICAL convection, lessivage, lminmax, lcheckmass
-    DATA convection, lessivage, lminmax, lcheckmass &
-            /.TRUE., .TRUE., .TRUE., .FALSE./
-
-    REAL xconv(nbtr)
-
-    LOGICAL anthropo, bateau, edgar
-    DATA anthropo, bateau, edgar/.TRUE., .TRUE., .TRUE./
-
-    !c bc_source
-    INTEGER kminbc, kmaxbc
-    !JE20150715      PARAMETER (kminbc=3, kmaxbc=5)
-    PARAMETER (kminbc = 4, kmaxbc = 7)
-
-    REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
-
-    ! JE for updating in  cltrac
-    REAL, DIMENSION(klon, klev) :: delp     ! epaisseur de couche (Pa)
-    !! JE for INCLUDE gas to particle conversion in output
-    !      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
-    !      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
-
-    INTEGER, INTENT(IN) :: iflag_conv
-    LOGICAL iscm3  ! debug variable. for checkmass ! JE
-
-    !------------------------------------------------------------------------
-    !  only to compute time consumption of each process
-    !----
-    INTEGER clock_start, clock_end, clock_rate, clock_start_spla
-    INTEGER clock_end_outphytracr, clock_start_outphytracr
-    INTEGER ti_init, dife, ti_inittype, ti_inittwrite
-    INTEGER ti_spla, ti_emis, ti_depo, ti_cltr, ti_ther
-    INTEGER ti_sedi, ti_gasp, ti_wetap, ti_cvltr, ti_lscs, ti_brop, ti_outs
-    INTEGER ti_nophytracr, clock_per_max
-    REAL tia_init, tia_inittype, tia_inittwrite
-    REAL tia_spla, tia_emis, tia_depo, tia_cltr, tia_ther
-    REAL tia_sedi, tia_gasp, tia_wetap, tia_cvltr, tia_lscs
-    REAL tia_brop, tia_outs
-    REAL tia_nophytracr
-
-    SAVE tia_init, tia_inittype, tia_inittwrite
-    SAVE tia_spla, tia_emis, tia_depo, tia_cltr, tia_ther
-    SAVE tia_sedi, tia_gasp, tia_wetap, tia_cvltr, tia_lscs
-    SAVE tia_brop, tia_outs
-    SAVE ti_nophytracr
-    SAVE tia_nophytracr
-    SAVE clock_end_outphytracr, clock_start_outphytracr
-    SAVE clock_per_max
-    LOGICAL logitime
-    !$OMP THREADPRIVATE(tia_init,tia_inittype,tia_inittwrite)
-    !$OMP THREADPRIVATE(tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther)
-    !$OMP THREADPRIVATE(tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs)
-    !$OMP THREADPRIVATE(tia_brop,tia_outs)
-    !$OMP THREADPRIVATE(ti_nophytracr)
-    !$OMP THREADPRIVATE(tia_nophytracr)
-    !$OMP THREADPRIVATE(clock_end_outphytracr,clock_start_outphytracr)
-    !$OMP THREADPRIVATE(clock_per_max)
-
-    !     utils parallelization
-    REAL :: auxklon_glo(klon_glo)
-    INTEGER :: iauxklon_glo(klon_glo)
-    REAL, DIMENSION(klon_glo, nbp_lev) :: auxklonnbp_lev
-    REAL, DIMENSION(klon_glo, nbp_lev, nbtr) :: auxklonklevnbtr_glo
-    REAL, DIMENSION(nbp_lon, nbp_lat) :: zx_tmp_2d_glo
-    REAL, DIMENSION(nbp_lon, nbp_lat, nbp_lev) :: zx_tmp_3d_glo
-    REAL, DIMENSION(klon_glo) :: zx_tmp_fi2d_glo
-    REAL, DIMENSION(klon_glo, nbp_lev) :: zx_tmp_fi3d_glo
-    REAL, DIMENSION(klon_glo, nbtr) :: auxklonnbtr_glo
-
-    source_tr = 0.
-
-    IF (debutphy) THEN
-#ifdef IOPHYS_DUST
-         CALL iophys_ini(pdtphys)
-#endif
-      nbreg_ind = 1
-      nbreg_bb = 1
-      nbreg_dust = 1
-      nbreg_wstardust = 1
-      CALL phytracr_spl_ini(klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust)
-    endif
-
-
-#ifdef IOPHYS_DUST
-      itr = 0
-      DO iq = 1, nqtot
-         IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-         itr = itr+1
-         WRITE(str2,'(i2.2)') itrr
-         CALL iophys_ecrit('TRA'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-
-
-
-    ijulday = jD_cur - jD_1jan + 1
-    nbjour = 1
-
-    paramname_ind = 'ind'
-    paramname_bb = 'bb'
-    paramname_ff = 'ind'
-    paramname_dustacc = 'dustacc'
-    paramname_dustcoa = 'dustcoasco'
-    paramname_dustsco = 'dustcoasco'
-    !  paramname_dustacc='dust'
-    !  paramname_dustcoa='dust'
-    !  paramname_dustsco='dust'
-    paramname_wstarBL = 'pwstarbl'
-    paramname_wstarWAKE = 'pwstarwake'
-    paramname_ssacc = 'ssacc'
-    paramname_sscoa = 'sscoa'
-
-    filescaleparams = 'modvalues.nc'
-    !AS: debranchage de lecture des coefs d'assmilation de Jeronimo Escribano
-    IF("ASSIM"=="YES") THEN
-      CALL readscaleparamsnc_spl(scale_param_ind, &
-              nbreg_ind, paramname_ind, &
-              scale_param_ff, nbreg_ind, paramname_ff, &
-              scale_param_bb, nbreg_bb, paramname_bb, &
-              scale_param_dustacc, nbreg_dust, paramname_dustacc, &
-              scale_param_dustcoa, nbreg_dust, paramname_dustcoa, &
-              scale_param_dustsco, nbreg_dust, paramname_dustsco, &
-              param_wstarBLperregion, nbreg_wstardust, paramname_wstarBL, &
-              param_wstarWAKEperregion, nbreg_wstardust, paramname_wstarWAKE, &
-              scale_param_ssacc, paramname_ssacc, &
-              scale_param_sscoa, paramname_sscoa, &
-              filescaleparams, ijulday, jH_cur, pdtphys, debutphy)
-    ENDIF ! ASSIM
-    !AS: le commentaire suivant "add seasalt" ne semble pas avoir ete mis en pratique.
-    ! Des fichiers regions_ssacc et _sscoa existent mais ne semblent pas lus.
-    ! Ca reste donc aux valeurs initialisées: nbreg_ss=1, scale_param_ss*=1, cf fichiers ss et modvalues
-    !! add seasalt
-
-    print *, 'JE : check scale_params'
-
-    print *, 'nbreg_ind', nbreg_ind
-    print *, 'nbreg_dust', nbreg_dust
-    print *, 'nbreg_bb', nbreg_bb
-    print *, 'ind', scale_param_ind
-    print *, 'dustacc', scale_param_dustacc
-    print *, 'dustcoa', scale_param_dustcoa
-    print *, 'dustsco', scale_param_dustsco
-    print *, 'wstardustBL', param_wstarBLperregion
-    print *, 'wstardustWAKE', param_wstarWAKEperregion
-    print *, 'ff', scale_param_ff
-    print *, 'bb', scale_param_bb
-    print *, 'ssacc', scale_param_ssacc
-    print *, 'sscoa', scale_param_sscoa
-
-    print *, 'JE: before read_newemissions '
-    print *, 'JE: jD_cur:', jD_cur, ' ijulday:', ijulday, ' jH_cur:', jH_cur, ' pdtphys:', pdtphys
-    print *, 'JE: now read_newemissions:'
-    !AS: La ligne suivante fait planter a l'execution : lmt_so2ff_l pas initialise
-    !  print *,'lmt_so2ff_l AVANT' , MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
-    CALL read_newemissions(ijulday, jH_cur, edgar, flag_dms, debutphy, & !I
-            pdtphys, lafin, nbjour, pctsrf, &       !I
-            t_seri, rlat, rlon, &                         !I
-            pmflxr, pmflxs, prfl, psfl, &            !I
-            u10m_ec, v10m_ec, dust_ec, &     !O
-            lmt_sea_salt, lmt_so2ff_l, &     !O
-            lmt_so2ff_h, lmt_so2nff, &       !O
-            lmt_so2ba, lmt_so2bb_l, lmt_so2bb_h, &  !O
-            lmt_so2volc_cont, lmt_altvolc_cont, &   !O
-            lmt_so2volc_expl, lmt_altvolc_expl, &   !O
-            lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &  !O
-            lmt_bcff, lmt_bcnff, lmt_bcbb_l, &      !O
-            lmt_bcbb_h, lmt_bcba, lmt_omff, &       !O
-            lmt_omnff, lmt_ombb_l, lmt_ombb_h, &    !O
-            lmt_omnat, lmt_omba)                    !O
-
-    print *, 'Check emissions'
-    print *, 'lmt_so2ff_l', MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
-    print *, 'lmt_so2ff_h', MINVAL(lmt_so2ff_h), MAXVAL(lmt_so2ff_h)
-    print *, 'lmt_so2nff', MINVAL(lmt_so2nff), MAXVAL(lmt_so2nff)
-    print *, 'lmt_so2ba', MINVAL(lmt_so2ba), MAXVAL(lmt_so2ba)
-    print *, 'lmt_so2bb_l', MINVAL(lmt_so2bb_l), MAXVAL(lmt_so2bb_l)
-    print *, 'lmt_so2bb_h', MINVAL(lmt_so2bb_h), MAXVAL(lmt_so2bb_h)
-    print *, 'lmt_so2volc_cont', MINVAL(lmt_so2volc_cont), MAXVAL(lmt_so2volc_cont)
-    print *, 'lmt_altvolc_cont', MINVAL(lmt_altvolc_cont), MAXVAL(lmt_altvolc_cont)
-    print *, 'lmt_so2volc_expl', MINVAL(lmt_so2volc_expl), MAXVAL(lmt_so2volc_expl)
-    print *, 'lmt_altvolc_expl', MINVAL(lmt_altvolc_expl), MAXVAL(lmt_altvolc_expl)
-    print *, 'lmt_dmsbio', MINVAL(lmt_dmsbio), MAXVAL(lmt_dmsbio)
-    print *, 'lmt_h2sbio', MINVAL(lmt_h2sbio), MAXVAL(lmt_h2sbio)
-    print *, 'lmt_dmsconc', MINVAL(lmt_dmsconc), MAXVAL(lmt_dmsconc)
-    print *, 'lmt_bcff', MINVAL(lmt_bcff), MAXVAL(lmt_bcff)
-    print *, 'lmt_bcnff', MINVAL(lmt_bcnff), MAXVAL(lmt_bcnff)
-    print *, 'lmt_bcbb_l', MINVAL(lmt_bcbb_l), MAXVAL(lmt_bcbb_l)
-    print *, 'lmt_bcbb_h', MINVAL(lmt_bcbb_h), MAXVAL(lmt_bcbb_h)
-    print *, 'lmt_bcba', MINVAL(lmt_bcba), MAXVAL(lmt_bcba)
-    print *, 'lmt_omff', MINVAL(lmt_omff), MAXVAL(lmt_omff)
-    print *, 'lmt_omnff', MINVAL(lmt_omnff), MAXVAL(lmt_omnff)
-    print *, 'lmt_ombb_l', MINVAL(lmt_ombb_l), MAXVAL(lmt_ombb_l)
-    print *, 'lmt_ombb_h', MINVAL(lmt_ombb_h), MAXVAL(lmt_ombb_h)
-    print *, 'lmt_omnat', MINVAL(lmt_omnat), MAXVAL(lmt_omnat)
-    print *, 'lmt_omba', MINVAL(lmt_omba), MAXVAL(lmt_omba)
-    print *, 'JE iflag_con', iflag_conv
-
-
-    !JE_dbg
-    DO i = 1, klon
-      tsol(i) = 0.0
-      DO j = 1, nbsrf
-        tsol(i) = tsol(i) + ftsol(i, j) * pctsrf(i, j)
-      enddo
-    enddo
-
-
-    !======================================================================
-    !  INITIALISATIONS
-    !======================================================================
-    !             CALL checknanqfi(da(:,:),1.,-1.,' da_ before
-    !     . phytracr_inphytracr')
-
-    ! computing time
-    !        logitime=.TRUE.
-    logitime = .FALSE.
-    IF (logitime) THEN
-      clock_start = 0
-      clock_end = 0
-      clock_rate = 0
-      CALL SYSTEM_CLOCK(COUNT_RATE = clock_rate, COUNT_MAX = clock_per_max)
-      CALL SYSTEM_CLOCK(COUNT = clock_start_spla)
-      clock_start = clock_start_spla
-      clock_end_outphytracr = clock_start_spla
-    ENDIF
-
-
-    ! Definition of tracers index.
-    PRINT*, 'OK ON PASSSE BIEN LA'
-    CALL minmaxsource(source_tr, qmin, qmax, 'A1 maxsource init phytracr')
-
-    IF (debutphy) THEN
-      id_prec = -1
-      id_fine = -1
-      id_coss = -1
-      id_codu = -1
-      id_scdu = -1
-      itr = 0
-      DO iq = 1, nqtot
-        IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-        itr = itr + 1
-        print *, itr, TRIM(tracers(iq)%name)
-        SELECT CASE(tracers(iq)%name)
-        CASE('PREC'); id_prec = itr
-        CASE('FINE'); id_fine = itr
-        CASE('COSS'); id_coss = itr
-        CASE('CODU'); id_codu = itr
-        CASE('SCDU'); id_scdu = itr
-        END SELECT
-      enddo
-      ! check consistency with dust emission scheme:
-      IF (ok_chimeredust) THEN
-        IF (.NOT.(id_scdu>0 .AND. id_codu>0 .AND. id_fine>0)) THEN
-          CALL abort_gcm('phytracr_mod', 'pb in ok_chimdust 0', 1)
-        endif
-      else
-        IF (id_scdu>0) THEN
-          CALL abort_gcm('phytracr_mod', 'pb in ok_chimdust 1 SCDU', 1)
-        endif
-        IF ((id_codu <= 0) .OR. (id_fine<=0)) THEN
-          CALL abort_gcm('phytracr_mod', 'pb in ok_chimdust 1', 1)
-        endif
-      endif
-
-
-      !print *,id_prec,id_fine,id_coss,id_codu,id_scdu
-    ENDIF
-
-
-
-
-
-
-    !---fraction of tracer that is convected (Tiedke)
-    xconv(:) = 0.
-    IF(id_prec>0)  xconv(id_prec) = 0.8
-    IF(id_fine>0)  xconv(id_fine) = 0.5
-    IF(id_coss>0)  xconv(id_coss) = 0.5
-    IF(id_codu>0)  xconv(id_codu) = 0.6
-    IF(id_scdu>0)  xconv(id_scdu) = 0.6  !!JE fix
-
-    masse(:) = 1.
-    IF(id_prec>0)  masse(id_prec) = 32.
-    IF(id_fine>0)  masse(id_fine) = 6.02e23
-    IF(id_coss>0)  masse(id_coss) = 6.02e23
-    IF(id_codu>0)  masse(id_codu) = 6.02e23
-    IF(id_scdu>0)  masse(id_scdu) = 6.02e23
-
-    henry(:) = 0.
-    IF(id_prec>0)  henry(id_prec) = 1.4
-    IF(id_fine>0)  henry(id_fine) = 0.0
-    IF(id_coss>0)  henry(id_coss) = 0.0
-    IF(id_codu>0)  henry(id_codu) = 0.0
-    IF(id_scdu>0)  henry(id_scdu) = 0.0
-    !henry= (/1.4, 0.0, 0.0, 0.0/)
-    kk(:) = 0.
-    IF(id_prec>0)  kk(id_prec) = 2900.
-    IF(id_fine>0)  kk(id_fine) = 0.0
-    IF(id_coss>0)  kk(id_coss) = 0.0
-    IF(id_codu>0)  kk(id_codu) = 0.0
-    IF(id_scdu>0)  kk(id_scdu) = 0.0
-    !kk = (/2900., 0., 0., 0./)
-    alpha_r(:) = 0.
-    IF(id_prec>0)  alpha_r(id_prec) = 0.0
-    IF(id_fine>0)  alpha_r(id_fine) = 0.001
-    IF(id_coss>0)  alpha_r(id_coss) = 0.001
-    IF(id_codu>0)  alpha_r(id_codu) = 0.001
-    IF(id_scdu>0)  alpha_r(id_scdu) = 0.001  !JE fix
-    alpha_s(:) = 0.
-    IF(id_prec>0)  alpha_s(id_prec) = 0.0
-    IF(id_fine>0)  alpha_s(id_fine) = 0.01
-    IF(id_coss>0)  alpha_s(id_coss) = 0.01
-    IF(id_codu>0)  alpha_s(id_codu) = 0.01
-    IF(id_scdu>0)  alpha_s(id_scdu) = 0.01  !JE fix
-
-    !      alpha_r =  (/0., 0.001, 0.001, 0.001/)
-    !      alpha_s = (/0., 0.01, 0.01, 0.01/)
-
-    ! nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-    ! nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-    !vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
-    vdep_oce(:) = 0.
-    IF(id_prec>0)  vdep_oce(id_prec) = 0.28
-    IF(id_fine>0)  vdep_oce(id_fine) = 0.28
-    IF(id_coss>0)  vdep_oce(id_coss) = 1.2
-    IF(id_codu>0)  vdep_oce(id_codu) = 1.2
-    IF(id_scdu>0)  vdep_oce(id_scdu) = 1.2
-    vdep_sic(:) = 0.
-    IF(id_prec>0)  vdep_sic(id_prec) = 0.2
-    IF(id_fine>0)  vdep_sic(id_fine) = 0.17
-    IF(id_coss>0)  vdep_sic(id_coss) = 1.2
-    IF(id_codu>0)  vdep_sic(id_codu) = 1.2
-    IF(id_scdu>0)  vdep_sic(id_scdu) = 1.2
-
-    !vdep_sic = (/0.2, 0.17, 1.2, 1.2/)
-    !vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
-    vdep_ter(:) = 0.
-    IF(id_prec>0)  vdep_ter(id_prec) = 0.3
-    IF(id_fine>0)  vdep_ter(id_fine) = 0.14
-    IF(id_coss>0)  vdep_ter(id_coss) = 1.2
-    IF(id_codu>0)  vdep_ter(id_codu) = 1.2
-    IF(id_scdu>0)  vdep_ter(id_scdu) = 1.2
-
-    vdep_lic(:) = 0.
-    IF(id_prec>0)  vdep_lic(id_prec) = 0.2
-    IF(id_fine>0)  vdep_lic(id_fine) = 0.17
-    IF(id_coss>0)  vdep_lic(id_coss) = 1.2
-    IF(id_codu>0)  vdep_lic(id_codu) = 1.2
-    IF(id_scdu>0)  vdep_lic(id_scdu) = 1.2
-
-
-    ! convective KE lessivage aer params:
-    ! AS: #DFB (Binta) a aussi teste ccntrAA_spla=ccntrENV_spla=0.9/1.0/0.9/0.9
-    !     mais effet negligeable sur l'AOD
-    ccntrAA_spla(:) = 0.
-    IF(id_prec>0)  ccntrAA_spla(id_prec) = -9999.
-    IF(id_fine>0)  ccntrAA_spla(id_fine) = 0.7
-    IF(id_coss>0)  ccntrAA_spla(id_coss) = 1.0
-    IF(id_codu>0)  ccntrAA_spla(id_codu) = 0.7
-    IF(id_scdu>0)  ccntrAA_spla(id_scdu) = 0.7
-
-    ccntrENV_spla(:) = 0.
-    IF(id_prec>0)  ccntrENV_spla(id_prec) = -9999.
-    IF(id_fine>0)  ccntrENV_spla(id_fine) = 0.7
-    IF(id_coss>0)  ccntrENV_spla(id_coss) = 1.0
-    IF(id_codu>0)  ccntrENV_spla(id_codu) = 0.7
-    IF(id_scdu>0)  ccntrENV_spla(id_scdu) = 0.7
-    ! #DFB
-    coefcoli_spla(:) = 0.
-    IF(id_prec>0)  coefcoli_spla(id_prec) = -9999.
-    IF(id_fine>0)  coefcoli_spla(id_fine) = 0.001
-    IF(id_coss>0)  coefcoli_spla(id_coss) = 0.001
-    IF(id_codu>0)  coefcoli_spla(id_codu) = 0.001
-    IF(id_scdu>0)  coefcoli_spla(id_scdu) = 0.001
-
-    !vdep_lic = (/0.2, 0.17, 1.2, 1.2/)
-
-    iscm3 = .FALSE.
-    IF (debutphy) THEN
-      !$OMP MASTER
-      CALL suphel
-      print *, 'let s check nbtr=', nbtr
-      ! JE before put in zero
-      IF (lminmax) THEN
-        DO itr = 1, nbtr
-          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan init phytracr')
-        ENDDO
-        DO itr = 1, nbtr
-          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'minmax init phytracr')
-        ENDDO
-        CALL minmaxsource(source_tr, qmin, qmax, 'maxsource init phytracr')
-      ENDIF
-      ! JE   initializon to cero the tracers
-      !         DO itr=1,nbtr
-      !            tr_seri(:,:,itr)=0.0
-      !         ENDDO
-      ! JE end
-      ! Initializing to zero tr_seri for comparison purposes
-      !        tr_seri(:,:,:)=0.0
-
-      !        DO itr=1,nbtr
-      !           trm_aux(itr)=0.0
-      !           src_aux(itr)=0.0
-      !           diag_trm(itr)=0.0
-      !           diag_drydep(itr)=0.0
-      !           diag_wetdep(itr)=0.0
-      !           diag_cvtdep(itr)=0.0
-      !           diag_emissn(itr)=0.0
-      !        ENDDO
-      !        diag_g2part=0.0
-      print *, 'PREPARE FILES TO SAVE VARIABLES'
-
-      nbjour = 30
-      ecrit_tra = NINT(86400. / pdtphys)                    !--1-day  average
-      ecrit_tra_h = NINT(86400. / pdtphys * 0.25)               !--6-hour average
-      ecrit_tra_m = NINT(86400. / pdtphys * FLOAT(nbjour))      !--1-mth  average
-      print *, 'ecrit_tra=', pdtphys, ecrit_tra
-
-      !!AS deleting lines
-      !!         IF (ok_histrac) THEN
-      !!           IF (is_mpi_root .AND. is_omp_root) THEN
-      !!-----many deleted lines----
-      !!!       nbjour=1
-      !!         ENDIF ! mpi root
-      !!         ENDIF !--ok_histrac
-
-      !$OMP END MASTER
-      !$OMP BARRIER
-    endif ! debutphy
-
-    !======================================================================
-    ! Initialisations
-    !======================================================================
-
-
-    ! je  KE init
-    IF (debutphy) THEN
-      !$OMP MASTER
-
-      ALLOCATE(d_tr_dry(klon, nbtr))
-      ALLOCATE(flux_tr_dry(klon, nbtr), d_tr_dec(klon, klev, nbtr))
-      ALLOCATE(qPrls(klon, nbtr), qPr(klon, klev, nbtr))
-      ALLOCATE(qDi(klon, klev, nbtr))
-      ALLOCATE(qPa(klon, klev, nbtr), qMel(klon, klev, nbtr))
-      ALLOCATE(qTrdi(klon, klev, nbtr), dtrcvMA(klon, klev, nbtr))
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ALLOCATE(d_tr_cv_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_trsp_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_sscav_o(klon, klev, nbtr), &
-              d_tr_sat_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_uscav_o(klon, klev, nbtr))
-
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ALLOCATE(d_tr_insc_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_bcscav_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_evapls_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_ls_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_dyn_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_cl_o(klon, klev, nbtr))
-      ALLOCATE(d_tr_th_o(klon, klev, nbtr))
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ALLOCATE(iregion_so4(klon))
-      ALLOCATE(iregion_bb(klon))
-      ALLOCATE(iregion_ind(klon))
-      ALLOCATE(iregion_dust(klon))
-      ALLOCATE(iregion_wstardust(klon))
-
-      !JE20150518<<
-      ALLOCATE(masque_aqua(klon))
-      ALLOCATE(masque_terra(klon))
-
-      masque_aqua(:) = 0
-      masque_terra(:) = 0
-
-      aod550_terra(:) = 0.
-      aod550_tr2_terra(:) = 0.
-      aod550_ss_terra(:) = 0.
-      aod550_dust_terra(:) = 0.
-      aod550_dustsco_terra(:) = 0.
-      aod670_terra(:) = 0.
-      aod670_tr2_terra(:) = 0.
-      aod670_ss_terra(:) = 0.
-      aod670_dust_terra(:) = 0.
-      aod670_dustsco_terra(:) = 0.
-      aod865_terra(:) = 0.
-      aod865_tr2_terra(:) = 0.
-      aod865_ss_terra(:) = 0.
-      aod865_dust_terra(:) = 0.
-      aod865_dustsco_terra(:) = 0.
-      aod550_aqua(:) = 0.
-      aod550_tr2_aqua(:) = 0.
-      aod550_ss_aqua(:) = 0.
-      aod550_dust_aqua(:) = 0.
-      aod550_dustsco_aqua(:) = 0.
-      aod670_aqua(:) = 0.
-      aod670_tr2_aqua(:) = 0.
-      aod670_ss_aqua(:) = 0.
-      aod670_dust_aqua(:) = 0.
-      aod670_dustsco_aqua(:) = 0.
-      aod865_aqua(:) = 0.
-      aod865_tr2_aqua(:) = 0.
-      aod865_ss_aqua(:) = 0.
-      aod865_dust_aqua(:) = 0.
-      aod865_dustsco_aqua(:) = 0.
-      !JE20150518>>
-
-      !Config Key  = iflag_lscav
-      !Config Desc = Large scale scavenging parametrization: 0=none,
-      !1=old(Genthon92),
-      !              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
-      !Config Def  = 4
-      !Config
-      iflag_lscav_omp = 4
-      CALL getin('iflag_lscav', iflag_lscav_omp)
-      iflag_lscav = iflag_lscav_omp
-      ! initialiation for time computation
-
-      tia_spla = 0.
-      tia_emis = 0.
-      tia_depo = 0.
-      tia_cltr = 0.
-      tia_ther = 0.
-      tia_sedi = 0.
-      tia_gasp = 0.
-      tia_wetap = 0.
-      tia_cvltr = 0.
-      tia_lscs = 0.
-      tia_brop = 0.
-      tia_outs = 0.
-      tia_nophytracr = 0.
-      clock_start_outphytracr = clock_end_outphytracr + 1
-      !$OMP END MASTER
-      !$OMP BARRIER
-    ENDIF ! debutphy
-
-    lmt_dms(:) = 0.0
-    aux_var2(:) = 0.0
-    aux_var3(:, :) = 0.0
-    source_tr(:, :) = 0.0
-    flux_tr(:, :) = 0.0
-    flux_sparam_bb(:) = 0.0
-    flux_sparam_ff(:) = 0.0
-    flux_sparam_ind(:) = 0.0
-    flux_sparam_ddfine(:) = 0.0
-    flux_sparam_ddcoa(:) = 0.0
-    flux_sparam_ddsco(:) = 0.0
-    flux_sparam_ssfine(:) = 0.0
-    flux_sparam_sscoa(:) = 0.0
-
-    ! initialiation for time computation
-
-    ti_spla = 0
-    ti_emis = 0
-    ti_depo = 0
-    ti_cltr = 0
-    ti_ther = 0
-    ti_sedi = 0
-    ti_gasp = 0
-    ti_wetap = 0
-    ti_cvltr = 0
-    ti_lscs = 0
-    ti_brop = 0
-    ti_outs = 0
-
-    DO k = 1, klev
-      DO i = 1, klon
-        Mint(i, k) = 0.
-      END DO
-    END DO
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_cv(i, k, itr) = 0.
-          d_tr_trsp(i, k, itr) = 0.
-          d_tr_sscav(i, k, itr) = 0.
-          d_tr_sat(i, k, itr) = 0.
-          d_tr_uscav(i, k, itr) = 0.
-          d_tr(i, k, itr) = 0.
-          d_tr_insc(i, k, itr) = 0.
-          d_tr_bcscav(i, k, itr) = 0.
-          d_tr_evapls(i, k, itr) = 0.
-          d_tr_ls(i, k, itr) = 0.
-          d_tr_cl(i, k, itr) = 0.
-          d_tr_th(i, k, itr) = 0.
-
-          d_tr_cv_o(i, k, itr) = 0.
-          d_tr_trsp_o(i, k, itr) = 0.
-          d_tr_sscav_o(i, k, itr) = 0.
-          d_tr_sat_o(i, k, itr) = 0.
-          d_tr_uscav_o(i, k, itr) = 0.
-
-          qDi(i, k, itr) = 0.
-          qPr(i, k, itr) = 0.
-          qPa(i, k, itr) = 0.
-          qMel(i, k, itr) = 0.
-          qTrdi(i, k, itr) = 0.
-          dtrcvMA(i, k, itr) = 0.
-          zmfd1a(i, k, itr) = 0.
-          zmfdam(i, k, itr) = 0.
-          zmfphi2(i, k, itr) = 0.
-        END DO
-      END DO
-    END DO
-
-    DO itr = 1, nbtr
-      DO i = 1, klon
-        qPrls(i, itr) = 0.0
-        dtrconv(i, itr) = 0.0
-        !JE20140507<<
-        d_tr_dry(i, itr) = 0.0
-        flux_tr_dry(i, itr) = 0.0
-        !JE20140507>>
-      ENDDO
-    ENDDO
-
-    DO itr = 1, nbtr
-      DO i = 1, klon
-        his_dh(i, itr) = 0.0
-        his_dhlsc(i, itr) = 0.0
-        his_dhcon(i, itr) = 0.0
-        his_dhbclsc(i, itr) = 0.0
-        his_dhbccon(i, itr) = 0.0
-        trm(i, itr) = 0.0
-        his_th(i, itr) = 0.0
-        his_dhkecv(i, itr) = 0.0
-        his_ds(i, itr) = 0.0
-        his_dhkelsc(i, itr) = 0.0
-
-      ENDDO
-    ENDDO
-    !JE:
-    DO i = 1, klon
-      his_g2pgas(i) = 0.0
-      his_g2paer(i) = 0.0
-    ENDDO
-    ! endJE
-
-    DO k = 1, klev
-      DO i = 1, klon
-        zrho(i, k) = pplay(i, k) / t_seri(i, k) / RD
-        zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG
-        zmasse(i, k) = (paprs(i, k) - paprs(i, k + 1)) / RG
-      ENDDO
-    ENDDO
-
-    DO i = 1, klon
-      zalt(i, 1) = pphis(i) / RG
-    ENDDO
-    DO k = 1, klev - 1
-      DO i = 1, klon
-        zalt(i, k + 1) = zalt(i, k) + zdz(i, k)
-      ENDDO
-    ENDDO
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_init = dife * MAX(0, SIGN(1, dife)) &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_init = tia_init + REAL(ti_init) / REAL(clock_rate)
-    ENDIF
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    IF (debutphy) THEN
-      ! AS: initialisation des indices par point de grille physique iregion_*
-      ! (variables tenant de l'assimilation, a eliminer dans un 2eme temps)
-      iregion_dust(:) = 1
-      iregion_ind(:) = 1
-      iregion_bb(:) = 1
-      iregion_wstardust(:) = 1
-
-      !AS: lecture des indices dans fichiers "regions_*" eliminee par IF("ASSIM"="YES") (faux donc)
-      IF("ASSIM"=="YES") THEN
-        c_FullName1 = 'regions_dustacc'
-        !c_FullName1='regions_dust'
-        CALL readregions_spl(iregion_dust, c_FullName1)
-        c_FullName1 = 'regions_ind'
-        CALL readregions_spl(iregion_ind, c_FullName1)
-        c_FullName1 = 'regions_bb'
-        CALL readregions_spl(iregion_bb, c_FullName1)
-        c_FullName1 = 'regions_pwstarwake'
-        CALL readregions_spl(iregion_wstardust, c_FullName1)
-
-        !$OMP MASTER
-        IF (is_mpi_root .AND. is_omp_root) THEN
-
-          OPEN(25, FILE = 'dustregions_pyvar_je.data')
-          OPEN(55, FILE = 'indregions_pyvar_je.data')
-          OPEN(75, FILE = 'bbregions_pyvar_je.data')
-          OPEN(95, FILE = 'wstardustregions_pyvar_je.data')
-          OPEN(76, FILE = 'xlat.data')
-          OPEN(77, FILE = 'xlon.data')
-        ENDIF ! mpi root
-        !$OMP END MASTER
-        !$OMP BARRIER
-
-        CALL gather(iregion_dust, iauxklon_glo)
-        !$OMP MASTER
-        IF (is_mpi_root .AND. is_omp_root) THEN
-          DO k = 1, klon_glo
-            WRITE(25, '(i10)') iauxklon_glo(k)
-          ENDDO
-        ENDIF ! mpi root
-        !$OMP END MASTER
-        !$OMP BARRIER
-        CALL gather(iregion_ind, iauxklon_glo)
-        !$OMP MASTER
-        IF (is_mpi_root .AND. is_omp_root) THEN
-          DO k = 1, klon_glo
-            WRITE(55, '(i10)') iauxklon_glo(k)
-          ENDDO
-        ENDIF ! mpi root
-        !$OMP END MASTER
-        !$OMP BARRIER
-        CALL gather(iregion_bb, iauxklon_glo)
-        !$OMP MASTER
-        IF (is_mpi_root .AND. is_omp_root) THEN
-          DO k = 1, klon_glo
-            WRITE(75, '(i10)') iauxklon_glo(k)
-          ENDDO
-        ENDIF ! mpi root
-        !$OMP END MASTER
-        !$OMP BARRIER
-        CALL gather(iregion_wstardust, iauxklon_glo)
-        !$OMP MASTER
-        IF (is_mpi_root .AND. is_omp_root) THEN
-          DO k = 1, klon_glo
-            WRITE(95, '(i10)') iauxklon_glo(k)
-          ENDDO
-        ENDIF ! mpi root
-        !$OMP END MASTER
-        !$OMP BARRIER
-
-        CALL gather(rlat, auxklon_glo)
-        !$OMP MASTER
-        IF (is_mpi_root .AND. is_omp_root) THEN
-          DO k = 1, klon_glo
-            WRITE(76, *) auxklon_glo(k)
-          ENDDO
-        ENDIF ! mpi root
-        !$OMP END MASTER
-        !$OMP BARRIER
-        CALL gather(rlon, auxklon_glo)
-        !$OMP MASTER
-        IF (is_mpi_root .AND. is_omp_root) THEN
-          DO k = 1, klon_glo
-            WRITE(77, *) auxklon_glo(k)
-          ENDDO
-
-          CLOSE(25)
-          CLOSE(55)
-          CLOSE(75)
-          CLOSE(76)
-          CLOSE(77)
-          CLOSE(95)
-
-        ENDIF ! mpi root
-        !$OMP END MASTER
-        !$OMP BARRIER
-
-      ENDIF  ! ASSIM
-
-    ENDIF  ! debutphy
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_inittype = dife * MAX(0, SIGN(1, dife)) &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_inittype = tia_inittype + REAL(ti_inittype) / REAL(clock_rate)
-    ENDIF
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    !=======================================================================
-    ! SAVING SURFACE TYPE
-    !=======================================================================
-    IF (debutphy) THEN
-      !$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-
-        OPEN(35, FILE = 'surface_ocean.data')
-        OPEN(45, FILE = 'surface_seaice.data')
-        OPEN(65, FILE = 'surface_land.data')
-        OPEN(85, FILE = 'surface_landice.data')
-      ENDIF ! mpi root
-      !$OMP END MASTER
-      !$OMP BARRIER
-      DO i = 1, klon
-        aux_var2(i) = pctsrf(i, is_oce)
-      enddo
-      CALL gather(aux_var2, auxklon_glo)
-      !$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-        DO i = 1, klon_glo
-          WRITE (35, 103)  auxklon_glo(i)
-        ENDDO
-      ENDIF ! mpi root
-      !$OMP END MASTER
-      !$OMP BARRIER
-
-      DO i = 1, klon
-        aux_var2(i) = pctsrf(i, is_sic)
-      enddo
-      CALL gather(aux_var2, auxklon_glo)
-      !$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-        DO i = 1, klon_glo
-          WRITE (45, 103)  auxklon_glo(i)
-        ENDDO
-      ENDIF ! mpi root
-      !$OMP END MASTER
-      !$OMP BARRIER
-
-      DO i = 1, klon
-        aux_var2(i) = pctsrf(i, is_ter)
-      enddo
-      CALL gather(aux_var2, auxklon_glo)
-      !$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-        DO i = 1, klon_glo
-          WRITE (65, 103)  auxklon_glo(i)
-        ENDDO
-      ENDIF ! mpi root
-      !$OMP END MASTER
-      !$OMP BARRIER
-
-      DO i = 1, klon
-        aux_var2(i) = pctsrf(i, is_lic)
-      enddo
-      CALL gather(aux_var2, auxklon_glo)
-      !$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-        DO i = 1, klon_glo
-          WRITE (85, 103)  auxklon_glo(i)
-        ENDDO
-
-        !      DO i = 1, klon
-        !         WRITE (35,103) pctsrf(i,is_oce)
-        !         WRITE (45,103) pctsrf(i,is_sic)
-        !         WRITE (65,103) pctsrf(i,is_ter)
-        !         WRITE (85,103) pctsrf(i,is_lic)
-        !      ENDDO
-        CLOSE(35)
-        CLOSE(45)
-        CLOSE(65)
-        CLOSE(85)
-        103   FORMAT (f6.2)
-      ENDIF ! mpi root
-      !$OMP END MASTER
-      !$OMP BARRIER
-    ENDIF ! debutphy
-
-    !      stop
-
-    !=======================================================================
-
-    DO itr = 1, nbtr
-      DO j = 1, klev
-        DO i = 1, klon
-          tmp_var(i, j) = tr_seri(i, j, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO j = 1, klev
-        DO i = 1, klon
-          tr_seri(i, j, itr) = tmp_var(i, j)
-        ENDDO
-      ENDDO
-    ENDDO
-    iscm3 = .TRUE.
-
-    !=======================================================================
-
-    DO k = 1, klev
-      DO i = 1, klon
-        m_conc(i, k) = pplay(i, k) / t_seri(i, k) / RKBOL * 1.e-6
-      ENDDO
-    ENDDO
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_avt_coarem')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'avt coarem')
-      ENDDO
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: avt coarem')
-    ENDIF
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_inittwrite = dife * MAX(0, SIGN(1, dife))  &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_inittwrite = tia_inittwrite + REAL(ti_inittwrite) / REAL(clock_rate)
-    ENDIF
-
-
-    !=======================================================================
-    !                     EMISSIONS OF COARSE AEROSOLS
-    !=======================================================================
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    print *, 'Number of tracers = ', nbtr
-
-    print *, 'AT BEGINNING OF PHYTRACR_SPL'
-    !      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-    !     .                                         MAXVAL(tr_seri(:,:,3))
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('sav'//str2,1,'SOURCE','',source_tr(:,itr))
-         CALL iophys_ecrit('fav'//str2,1,'SOURCE','',source_tr(:,itr))
-      enddo
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRB'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-
-    CALL coarsemission(pctsrf, pdtphys, t_seri, &
-            pmflxr, pmflxs, prfl, psfl, &
-            rlat, rlon, debutphy, &
-            zu10m, zv10m, wstar, ale_bl, ale_wake, &
-            scale_param_ssacc, scale_param_sscoa, &
-            scale_param_dustacc, scale_param_dustcoa, &
-            scale_param_dustsco, &
-            nbreg_dust, &
-            iregion_dust, dust_ec, &
-            param_wstarBLperregion, param_wstarWAKEperregion, &
-            nbreg_wstardust, &
-            iregion_wstardust, &
-            lmt_sea_salt, qmin, qmax, &
-            flux_sparam_ddfine, flux_sparam_ddcoa, &
-            flux_sparam_ddsco, &
-            flux_sparam_ssfine, flux_sparam_sscoa, &
-            id_prec, id_fine, id_coss, id_codu, id_scdu, &
-            ok_chimeredust, &
-            source_tr, flux_tr)
-
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('sap'//str2,1,'SOURCE','',source_tr(:,itr))
-         CALL iophys_ecrit('fap'//str2,1,'SOURCE','',source_tr(:,itr))
-      enddo
-#endif
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_coarem')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after coarem')
-      ENDDO
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: after coarem')
-    ENDIF
-
-
-
-    !======================================================================
-    !                   EMISSIONS OF AEROSOL PRECURSORS
-    !======================================================================
-
-#ifdef IOPHYS_DUST
-      print *,'INPUT TO PRECUREMISSION'
-         CALL iophys_ecrit('ftsol',4,'ftsol','',ftsol)
-         CALL iophys_ecrit('u10m_ec',1,'u10m_ec','',u10m_ec)
-         CALL iophys_ecrit('v10m_ec',1,'v10m_ec','',v10m_ec)
-         CALL iophys_ecrit('pctsrf',4,'pctsrf','',pctsrf)
-         CALL iophys_ecrit('u_seri',klev,'u_seri','',u_seri)
-         CALL iophys_ecrit('v_seri',klev,'v_seri','',v_seri)
-         CALL iophys_ecrit('paprs',klev,'paprs','',paprs)
-         CALL iophys_ecrit('pplay',klev,'pplay','',pplay)
-         CALL iophys_ecrit('cdragh',1,'cdragh','',cdragh)
-         CALL iophys_ecrit('cdragm',1,'cdragm','',cdragm)
-         CALL iophys_ecrit('t_seri',klev,'t_seri','',t_seri)
-         CALL iophys_ecrit('q_seri',klev,'q_seri','',q_seri)
-         CALL iophys_ecrit('tsol',1,'tsol','',tsol)
-         PRINT*,'fracso2emis,frach2sofso2,bateau',fracso2emis,frach2sofso2,bateau
-         PRINT*,'kminbc,kmaxbc,pdtphys',kminbc,kmaxbc,pdtphys
-         PRINT*,'scale_param_bb,scale_param_ind',scale_param_bb,scale_param_ind
-         PRINT*,'iregion_ind,iregion_bb,nbreg_ind, nbreg_bb',iregion_ind,iregion_bb,nbreg_ind, nbreg_bb
-         PRINT*,'id_prec,id_fine',id_prec,id_fine
-         CALL iophys_ecrit('zdz',klev,'zdz','',zdz)
-         CALL iophys_ecrit('zalt',klev,'zalt','',zalt)
-         CALL iophys_ecrit('lmt_so2ff_l',1,'lmt_so2ff_l','',lmt_so2ff_l)
-         CALL iophys_ecrit('lmt_so2ff_h',1,'lmt_so2ff_h','',lmt_so2ff_h)
-         CALL iophys_ecrit('lmt_so2nff',1,'lmt_so2nff','',lmt_so2nff)
-         CALL iophys_ecrit('lmt_so2ba',1,'lmt_so2ba','',lmt_so2ba)
-         CALL iophys_ecrit('lmt_so2bb_l',1,'lmt_so2bb_l','',lmt_so2bb_l)
-         CALL iophys_ecrit('lmt_so2bb_h',1,'lmt_so2bb_h','',lmt_so2bb_h)
-         CALL iophys_ecrit('lmt_so2volc_cont',1,'lmt_so2volc_cont','',lmt_so2volc_cont)
-         CALL iophys_ecrit('lmt_altvolc_cont',1,'lmt_altvolc_cont','',lmt_altvolc_cont)
-         CALL iophys_ecrit('lmt_so2volc_expl',1,'lmt_so2volc_expl','',lmt_so2volc_expl)
-         CALL iophys_ecrit('lmt_altvolc_expl',1,'lmt_altvolc_expl','',lmt_altvolc_expl)
-         CALL iophys_ecrit('lmt_dmsbio',1,'lmt_dmsbio','',lmt_dmsbio)
-         CALL iophys_ecrit('lmt_h2sbio',1,'lmt_h2sbio','',lmt_h2sbio)
-         CALL iophys_ecrit('lmt_dmsconc',1,'lmt_dmsconc','',lmt_dmsconc)
-         CALL iophys_ecrit('lmt_dms',1,'lmt_dms','',lmt_dms)
-         CALL iophys_ecrit('flux_sparam_ind',1,'flux_sparam_ind','',flux_sparam_ind)
-         CALL iophys_ecrit('flux_sparam_bb',1,'flux_sparam_bb','',flux_sparam_bb)
-#endif
-
-
-
-    PRINT*, 'ON PASSE DANS precuremission'
-    CALL precuremission(ftsol, u10m_ec, v10m_ec, pctsrf, &
-            u_seri, v_seri, paprs, pplay, cdragh, cdragm, &
-            t_seri, q_seri, tsol, fracso2emis, frach2sofso2, &
-            bateau, zdz, zalt, kminbc, kmaxbc, pdtphys, &
-            scale_param_bb, scale_param_ind, &
-            iregion_ind, iregion_bb, &
-            nbreg_ind, nbreg_bb, &
-            lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, lmt_so2ba, &
-            lmt_so2bb_l, lmt_so2bb_h, &
-            lmt_so2volc_cont, lmt_altvolc_cont, &
-            lmt_so2volc_expl, lmt_altvolc_expl, &
-            lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, lmt_dms, &
-            id_prec, id_fine, &
-            flux_sparam_ind, flux_sparam_bb, &
-            source_tr, flux_tr, tr_seri)
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after precur')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after precur')
-      ENDDO
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: after precur')
-    ENDIF
-
-    !=======================================================================
-    !                      EMISSIONS OF FINE AEROSOLS
-    !=======================================================================
-#ifdef IOPHYS_DUST
-
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('tpr'//str2,1,'SOURCE','',source_tr(:,itr))
-         CALL iophys_ecrit('fpr'//str2,1,'SOURCE','',flux_tr(:,itr))
-      enddo
-#endif
-
-    CALL finemission(zdz, pdtphys, zalt, kminbc, kmaxbc, &
-            scale_param_bb, scale_param_ff, &
-            iregion_ind, iregion_bb, &
-            nbreg_ind, nbreg_bb, &
-            lmt_bcff, lmt_bcnff, lmt_bcbb_l, lmt_bcbb_h, &
-            lmt_bcba, lmt_omff, lmt_omnff, &
-            lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba, &
-            id_fine, &
-            flux_sparam_bb, flux_sparam_ff, &
-            source_tr, flux_tr, tr_seri)
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_fineem')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after fineem')
-      ENDDO
-      IF (lcheckmass) THEN
-        DO itr = 1, nbtr
-          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                  pplay, t_seri, iscm3, 'after fineem')
-        ENDDO
-      ENDIF
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: after fineem')
-    ENDIF
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_emis = dife * MAX(0, SIGN(1, dife))   &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_emis = tia_emis + REAL(ti_emis) / REAL(clock_rate)
-    ENDIF
-
-
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('t'//str2,1,'SOURCE','',source_tr(:,itr))
-         CALL iophys_ecrit('f'//str2,1,'SOURCE','',flux_tr(:,itr))
-      enddo
-#endif
-
-
-    !=======================================================================
-    !                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
-    !=======================================================================
-
-    !        DO itr=1,nbtr
-    !         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,
-    !     .      pplay,t_seri,iscm3,'')
-    !        ENDDO
-
-    !======================================================================
-    !    -- Dry deposition --
-    !======================================================================
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    DO itr = 1, nbtr
-      DO j = 1, klev
-        DO i = 1, klon
-          tmp_var(i, j) = tr_seri(i, j, itr)
-        ENDDO
-      ENDDO
-      CALL cm3_to_kg(pplay, t_seri, tmp_var)
-      DO j = 1, klev
-        DO i = 1, klon
-          tr_seri(i, j, itr) = tmp_var(i, j)
-        ENDDO
-      ENDDO
-    ENDDO
-    iscm3 = .FALSE.
-    !----------------------------
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_depo')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before depo')
-      ENDDO
-      IF (lcheckmass) THEN
-        DO itr = 1, nbtr
-          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                  pplay, t_seri, iscm3, 'before depo')
-        ENDDO
-      ENDIF
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: before depo')
-    ENDIF
-
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRC'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-    CALL deposition(vdep_oce, vdep_sic, vdep_ter, vdep_lic, pctsrf, &
-            zrho, zdz, pdtphys, RHcl, masse, t_seri, pplay, paprs, &
-            lminmax, qmin, qmax, &
-            his_ds, source_tr, tr_seri)
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_depo')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after depo')
-      ENDDO
-      IF (lcheckmass) THEN
-        DO itr = 1, nbtr
-          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                  pplay, t_seri, iscm3, 'after depo')
-        ENDDO
-      ENDIF
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: after depo')
-    ENDIF
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_depo = dife * MAX(0, SIGN(1, dife))                      &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_depo = tia_depo + REAL(ti_depo) / REAL(clock_rate)
-    ENDIF
-
-    !======================================================================
-    !    -- Boundary layer mixing --
-    !======================================================================
-
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRD'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    DO k = 1, klev
-      DO i = 1, klon
-        delp(i, k) = paprs(i, k) - paprs(i, k + 1)
-      END DO
-    END DO
-
-    DO itr = 1, nbtr
-      DO j = 1, klev
-        DO i = 1, klon
-          tmp_var(i, j) = tr_seri(i, j, itr)
-          aux_var2(i) = source_tr(i, itr)
-        ENDDO
-      ENDDO
-      IF (iflag_conv==2) THEN
-        ! Tiedke
-        CALL cltrac_spl(pdtphys, coefh, yu1, yv1, t_seri, tmp_var, &
-                aux_var2, paprs, pplay, aux_var3)
-
-      ELSE IF (iflag_conv>=3) THEN
-        !KE
-        CALL cltrac(pdtphys, coefh, t_seri, tmp_var, aux_var2, paprs, pplay, &
-                delp, aux_var3, d_tr_dry, flux_tr_dry(:, itr))
-      ENDIF
-
-      DO i = 1, klon
-        DO j = 1, klev
-          tr_seri(i, j, itr) = tmp_var(i, j)
-          d_tr(i, j, itr) = aux_var3(i, j)
-          d_tr_cl(i, j, itr) = d_tr(i, j, itr)
-        ENDDO
-      ENDDO
-      DO k = 1, klev
-        DO i = 1, klon
-          tr_seri(i, k, itr) = tr_seri(i, k, itr) + d_tr(i, k, itr)
-        ENDDO
-      ENDDO
-      print *, ' AFTER Cltrac'
-      IF (lminmax) THEN
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after cltrac')
-      ENDIF
-    ENDDO !--end itr loop
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_cltr = dife * MAX(0, SIGN(1, dife))     &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_cltr = tia_cltr + REAL(ti_cltr) / REAL(clock_rate)
-    ENDIF
-
-
-
-    !======================================================================
-    !    -- Calcul de l'effet des thermiques for KE--
-    !======================================================================
-
-#ifdef IOPHYS_DUST
-      PRINT*,'iflag_conv=',iflag_conv
-      CALL iophys_ecrit('coefh',klev,'coefh','',coefh)
-      CALL iophys_ecrit('yu1',1,'yu1','',yu1)
-      CALL iophys_ecrit('yv1',1,'yv1','',yv1)
-      CALL iophys_ecrit('delp',klev,'delp','',delp)
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRE'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-
-
-    IF (iflag_conv>=3) THEN
-
-      IF (logitime) THEN
-        CALL SYSTEM_CLOCK(COUNT = clock_start)
-      ENDIF
-
-      IF (lminmax) THEN
-        DO itr = 1, nbtr
-          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before therm')
-        ENDDO
-        DO itr = 1, nbtr
-          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before therm')
-        ENDDO
-        IF (lcheckmass) THEN
-          DO itr = 1, nbtr
-            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                    pplay, t_seri, iscm3, 'before therm')
-          ENDDO
-        ENDIF
-        CALL minmaxsource(source_tr, qmin, qmax, 'before therm')
-      ENDIF
-
-      DO itr = 1, nbtr
-        DO k = 1, klev
-          DO i = 1, klon
-            tmp_var3(i, k, itr) = tr_seri(i, k, itr)
-            d_tr_th(i, k, itr) = 0.
-            tr_seri(i, k, itr) = MAX(tr_seri(i, k, itr), 0.)
-            !JE: precursor >>1e10         tr_seri(i,k,itr)=MIN(tr_seri(i,k,itr),1.e10)
-          END DO
-        END DO
-      END DO
-
-      !JE  new implicit scheme 20140323
-      DO itr = 1, nbtr
-        CALL thermcell_dq(klon, klev, 1, pdtphys, fm_therm, entr_therm, &
-                zmasse, tr_seri(1:klon, 1:klev, itr), &
-                d_tr(1:klon, 1:klev, itr), ztra_th, 0)
-
-        DO k = 1, klev
-          DO i = 1, klon
-            d_tr(i, k, itr) = pdtphys * d_tr(i, k, itr)
-            d_tr_th(i, k, itr) = d_tr_th(i, k, itr) + d_tr(i, k, itr)
-            tr_seri(i, k, itr) = MAX(tr_seri(i, k, itr) + d_tr(i, k, itr), 0.)
-          END DO
-        END DO
-
-      ENDDO
-
-      ! old scheme explicit
-      !       nsplit=10
-      !       DO itr=1,nbtr
-      !          DO isplit=1,nsplit
-      !              CALL dqthermcell(klon,klev,pdtphys/nsplit,
-      !     .            fm_therm,entr_therm,zmasse,
-      !     .            tr_seri(1:klon,1:klev,itr),
-      !     .            d_tr(1:klon,1:klev,itr),ztra_th)
-      !            DO k=1,klev
-      !               DO i=1,klon
-      !                  d_tr(i,k,itr)=pdtphys*d_tr(i,k,itr)/nsplit
-      !                  d_tr_th(i,k,itr)=d_tr_th(i,k,itr)+d_tr(i,k,itr)
-      !                  tr_seri(i,k,itr)=MAX(tr_seri(i,k,itr)+d_tr(i,k,itr),0.)
-      !               END DO
-      !            END DO
-      !         END DO ! nsplit1
-      !      END DO ! it
-      !JE end modif 20140323
-
-      DO itr = 1, nbtr
-        DO k = 1, klev
-          DO i = 1, klon
-            tmp_var(i, k) = tr_seri(i, k, itr) - tmp_var3(i, k, itr)
-          ENDDO
-        ENDDO
-        IF (lminmax) THEN
-          IF (lcheckmass) THEN
-            CALL checkmass(tmp_var(:, :), RNAVO, masse(itr), zdz, &
-                    pplay, t_seri, iscm3, 'dtr therm ')
-          ENDIF
-        ENDIF
-        CALL kg_to_cm3(pplay, t_seri, tmp_var)
-
-        DO k = 1, klev
-          DO i = 1, klon
-            his_th(i, itr) = his_th(i, itr) + &
-                    (tmp_var(i, k)) / RNAVO * &
-                            masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-          END DO !klon
-        END DO !klev
-
-      END DO !it
-      IF (lminmax) THEN
-        DO itr = 1, nbtr
-          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after therm')
-        ENDDO
-        DO itr = 1, nbtr
-          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after therm')
-        ENDDO
-        IF (lcheckmass) THEN
-          DO itr = 1, nbtr
-            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                    pplay, t_seri, iscm3, 'after therm')
-          ENDDO
-        ENDIF
-        CALL minmaxsource(source_tr, qmin, qmax, 'after therm')
-      ENDIF
-
-      IF (logitime) THEN
-        CALL SYSTEM_CLOCK(COUNT = clock_end)
-        dife = clock_end - clock_start
-        ti_ther = dife * MAX(0, SIGN(1, dife))   &
-                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-        tia_ther = tia_ther + REAL(ti_ther) / REAL(clock_rate)
-      ENDIF
-
-    ENDIF ! iflag_conv KE
-    !------------------------------------
-    !      Sedimentation
-    !-----------------------------------
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    DO itr = 1, nbtr
-      DO j = 1, klev
-        DO i = 1, klon
-          tmp_var(i, j) = tr_seri(i, j, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO j = 1, klev
-        DO i = 1, klon
-          tr_seri(i, j, itr) = tmp_var(i, j)
-        ENDDO
-      ENDDO
-    ENDDO !--end itr loop
-    iscm3 = .TRUE.
-    !--------------------------------------
-    print *, ' BEFORE Sediment'
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_sedi')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before sedi')
-      ENDDO
-      IF (lcheckmass) THEN
-        DO itr = 1, nbtr
-          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                  pplay, t_seri, iscm3, 'before sedi')
-        ENDDO
-      ENDIF
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: before sedi')
-    ENDIF
-
-    print *, 'SPLA VERSION OF SEDIMENTATION IS USED'
-    CALL sediment_mod(t_seri, pplay, zrho, paprs, pdtphys, RHcl, &
-            id_coss, id_codu, id_scdu, &
-            ok_chimeredust, &
-            sed_ss, sed_dust, sed_dustsco, &
-            sed_ss3D, sed_dust3D, sed_dustsco3D, tr_seri)
-    CALL cm3_to_kg(pplay, t_seri, sed_ss3D)
-    CALL cm3_to_kg(pplay, t_seri, sed_dust3D)
-    CALL cm3_to_kg(pplay, t_seri, sed_dustsco3D)
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_sedi')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after sedi')
-      ENDDO
-      IF (lcheckmass) THEN
-        DO itr = 1, nbtr
-          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                  pplay, t_seri, iscm3, 'after sedi')
-        ENDDO
-      ENDIF
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: after sedi')
-    ENDIF
-
-    !=======================================================================
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRF'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_sedi = dife * MAX(0, SIGN(1, dife))   &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_sedi = tia_sedi + REAL(ti_sedi) / REAL(clock_rate)
-    ENDIF
-
-    DO itr = 1, nbtr
-      DO j = 1, klev
-        DO i = 1, klon
-          tmp_var(i, j) = tr_seri(i, j, itr)
-        ENDDO
-      ENDDO
-      CALL cm3_to_kg(pplay, t_seri, tmp_var)
-      DO j = 1, klev
-        DO i = 1, klon
-          tr_seri(i, j, itr) = tmp_var(i, j)
-        ENDDO
-      ENDDO
-    ENDDO
-    iscm3 = .FALSE.
-
-
-    !======================================================================
-    !                      GAS TO PARTICLE CONVERSION
-    !======================================================================
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_beforegastopar')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before gastopar')
-      ENDDO
-      IF (lcheckmass) THEN
-        DO itr = 1, nbtr
-          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                  pplay, t_seri, iscm3, 'before gastopar')
-        ENDDO
-      ENDIF
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: before gastopar')
-    ENDIF
-
-    CALL gastoparticle(pdtphys, zdz, zrho, rlat, &
-            pplay, t_seri, id_prec, id_fine, &
-            tr_seri, his_g2pgas, his_g2paer)
-
-    IF (lminmax) THEN
-      DO itr = 1, nbtr
-        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_gastopar')
-      ENDDO
-      DO itr = 1, nbtr
-        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after gastopar')
-      ENDDO
-      IF (lcheckmass) THEN
-        DO itr = 1, nbtr
-          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                  pplay, t_seri, iscm3, 'after gastopar')
-        ENDDO
-      ENDIF
-      CALL minmaxsource(source_tr, qmin, qmax, 'src: after gastopar')
-    ENDIF
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_gasp = dife * MAX(0, SIGN(1, dife))   &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_gasp = tia_gasp + REAL(ti_gasp) / REAL(clock_rate)
-    ENDIF
-
-    !======================================================================
-    !          EFFECT OF PRECIPITATION: iflag_conv=2
-    !======================================================================
-
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRG'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-
-    IF (iflag_conv==2) THEN
-
-      IF (logitime) THEN
-        CALL SYSTEM_CLOCK(COUNT = clock_start)
-      ENDIF
-
-      DO itr = 1, nbtr
-        DO j = 1, klev
-          DO i = 1, klon
-            tmp_var(i, j) = tr_seri(i, j, itr)
-          ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay, t_seri, tmp_var)
-        DO j = 1, klev
-          DO i = 1, klon
-            tr_seri(i, j, itr) = tmp_var(i, j)
-          ENDDO
-        ENDDO
-      ENDDO
-      iscm3 = .TRUE.
-      !------------------------------
-
-      print *, 'iflag_conv bef lessiv', iflag_conv
-      IF (lessivage) THEN
-
-        print *, ' BEFORE Incloud'
-
-        IF (lminmax) THEN
-          DO itr = 1, nbtr
-            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_incloud')
-          ENDDO
-          DO itr = 1, nbtr
-            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before incloud')
-          ENDDO
-          IF (lcheckmass) THEN
-            DO itr = 1, nbtr
-              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                      pplay, t_seri, iscm3, 'before incloud')
-            ENDDO
-          ENDIF
-          CALL minmaxsource(source_tr, qmin, qmax, 'src: before incloud')
-        ENDIF
-
-
-        !      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
-        !     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-
-        !     .                                     his_dhlsc,his_dhcon,tr_seri)
-        print *, 'iflag_conv bef incloud', iflag_conv
-
-        IF (iflag_conv==2) THEN
-          ! Tiedke
-          CALL incloud_scav(.FALSE., qmin, qmax, masse, henry, kk, prfl, &
-                  psfl, pmflxr, pmflxs, zrho, zdz, t_seri, pdtphys, &
-                  his_dhlsc, his_dhcon, tr_seri)
-
-          !---------- to use this option please comment lsc_scav at the end
-          !        ELSE IF (iflag_conv.GE.3) THEN
-
-          !      CALL incloud_scav_lsc(.FALSE.,qmin,qmax,masse,henry,kk,prfl,
-          !     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-          !     .                                     his_dhlsc,his_dhcon,tr_seri)
-          !--------------------------------------------------------------
-
-        ENDIF
-
-        print *, ' BEFORE blcloud (after incloud)'
-        IF (lminmax) THEN
-          DO itr = 1, nbtr
-            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_blcloud')
-          ENDDO
-          DO itr = 1, nbtr
-            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before blcloud')
-          ENDDO
-          IF (lcheckmass) THEN
-            DO itr = 1, nbtr
-              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                      pplay, t_seri, iscm3, 'before blcloud')
-            ENDDO
-          ENDIF
-          CALL minmaxsource(source_tr, qmin, qmax, 'src: before blcloud')
-        ENDIF
-
-        !      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
-        !     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-        !     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-        IF (iflag_conv==2) THEN
-          ! Tiedke
-
-          CALL blcloud_scav(.FALSE., qmin, qmax, pdtphys, prfl, psfl, &
-                  pmflxr, pmflxs, zdz, alpha_r, alpha_s, masse, &
-                  his_dhbclsc, his_dhbccon, tr_seri)
-
-          !---------- to use this option please comment lsc_scav at the end
-          !           and comment IF iflag=2 after "EFFECT OF PRECIPITATION:"
-
-
-          !        ELSE IF (iflag_conv.GE.3) THEN
-
-          !      CALL blcloud_scav_lsc(.FALSE.,qmin,qmax,pdtphys,prfl,psfl,
-          !     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-          !     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-          !----------------------------------------------------------------------
-        ENDIF
-
-        print *, ' AFTER blcloud '
-
-        IF (lminmax) THEN
-          DO itr = 1, nbtr
-            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_blcloud')
-          ENDDO
-          DO itr = 1, nbtr
-            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after blcloud')
-          ENDDO
-          IF (lcheckmass) THEN
-            DO itr = 1, nbtr
-              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                      pplay, t_seri, iscm3, 'after blcloud')
-            ENDDO
-          ENDIF
-          CALL minmaxsource(source_tr, qmin, qmax, 'src: after blcloud')
-        ENDIF
-
-      ENDIF !--lessivage
-
-      DO itr = 1, nbtr
-        DO j = 1, klev
-          DO i = 1, klon
-            tmp_var(i, j) = tr_seri(i, j, itr)
-          ENDDO
-        ENDDO
-        CALL cm3_to_kg(pplay, t_seri, tmp_var)
-        DO j = 1, klev
-          DO i = 1, klon
-            tr_seri(i, j, itr) = tmp_var(i, j)
-          ENDDO
-        ENDDO
-      ENDDO
-      iscm3 = .FALSE.
-
-      IF (logitime) THEN
-        CALL SYSTEM_CLOCK(COUNT = clock_end)
-        dife = clock_end - clock_start
-        ti_wetap = dife * MAX(0, SIGN(1, dife))    &
-                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-        tia_wetap = tia_wetap + REAL(ti_wetap) / REAL(clock_rate)
-      ENDIF
-
-    ENDIF ! iflag_conv=2
-
-
-    !======================================================================
-    !                         EFFECT OF CONVECTION
-    !======================================================================
-
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRH'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    IF (convection) THEN
-
-      print *, ' BEFORE trconvect'
-
-      IF (lminmax) THEN
-        DO itr = 1, nbtr
-          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_trconve')
-        ENDDO
-        DO itr = 1, nbtr
-          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before trconve')
-        ENDDO
-        IF (lcheckmass) THEN
-          DO itr = 1, nbtr
-            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                    pplay, t_seri, iscm3, 'before trconve')
-          ENDDO
-        ENDIF
-        CALL minmaxsource(source_tr, qmin, qmax, 'src: before trconve')
-      ENDIF
-
-
-      ! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-      !     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
-      !     .                                                 dtrconv,tr_seri)
-      ! -------------------------------------------------------------
-      IF (iflag_conv==2) THEN
-        ! Tiedke
-        CALL trconvect(pplay, t_seri, pdtphys, pmfu, pmfd, pen_u, pde_u, &
-                pen_d, pde_d, paprs, zdz, xconv, qmin, qmax, .FALSE., masse, &
-                dtrconv, tr_seri)
-        DO itr = 1, nbtr
-          d_tr_cv(:, :, itr) = 0.
-        ENDDO
-
-      ELSE IF (iflag_conv>=3) THEN
-        ! KE
-        print *, 'JE: KE in phytracr_spl'
-        DO itr = 1, nbtr
-          DO k = 1, klev
-            DO i = 1, klon
-              tmp_var3(i, k, itr) = tr_seri(i, k, itr)
-            END DO
-          END DO
-        ENDDO
-
-        DO itr = 1, nbtr
-          !          routine for aerosols . otherwise, check cvltrorig
-          print *, 'Check sum before cvltr itr)', itr, SUM(tr_seri(:, :, itr))
-          !           IF (.FALSE.) THEN
-          CALL cvltr_spl(pdtphys, da, phi, phi2, d1a, dam, mp, ep, &
-                  sigd, sij, wght_cvfd, clw, elij, epmlmMm, eplaMm, &
-                  pmflxr, pmflxs, evapls, t_seri, wdtrainA, wdtrainM, &
-                  !            paprs,itr,tr_seri,upwd,dnwd,itop_con,ibas_con,        &
-                  paprs, itr, tmp_var3, upwd, dnwd, itop_con, ibas_con, &
-                  henry, kk, zrho, ccntrAA_spla, ccntrENV_spla, coefcoli_spla, &
-                  id_prec, id_fine, id_coss, id_codu, id_scdu, &
-                  d_tr_cv, d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav, qDi, qPr, &
-                  qPa, qMel, qTrdi, dtrcvMA, Mint, &
-                  zmfd1a, zmfphi2, zmfdam)
-          !           ENDIF
-
-          !           IF (.FALSE.) THEN
-          !           CALL cvltr(pdtphys, da, phi,phi2,d1a,dam, mp,ep,
-          !     .       sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,
-          !     .       pmflxr,pmflxs,evapls,t_seri,wdtrainA,wdtrainM,
-          !     .       paprs,itr,tmp_var3,upwd,dnwd,itop_con,ibas_con,
-          !     .       d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr,
-          !     .       qPa,qMel,qTrdi,dtrcvMA,Mint,
-          !     .       zmfd1a,zmfphi2,zmfdam)
-          !!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-          !           ENDIF
-
-
-
-          !!!!!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
-          !!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
-          !!!     .               upwd,dnwd,d_tr_cv)
-          !             print *,'justbefore cvltrnoscav it= ',it
-          !             CALL checknanqfi(da(:,:),1.,-1.,' da')
-          !             CALL checknanqfi(wght_cvfd(:,:),1.,-1.,'weigth ')
-          !             CALL checknanqfi(mp(:,:),1.,-1.,'mp ')
-          !             CALL checknanqfi(paprs(:,:),1.,-1.,'paprs ')
-          !             CALL checknanqfi(pplay(:,:),1.,-1.,'pplay ')
-          !             CALL checknanqfi(tmp_var3(:,:,itr),1.,-1.,'tmp_var3 ')
-          !             CALL checknanqfi(upwd(:,:),1.,-1.,'upwd ')
-          !             CALL checknanqfi(dnwd(:,:),1.,-1.,'dnwd ')
-          !             CALL checknanqfi(d_tr_cv(:,:,itr),1.,-1.,'d_tr_cv ')
-          !             IF (.TRUE.) THEN
-          !             CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,
-          !     .            pplay,tmp_var3,upwd,dnwd,d_tr_cv)
-          !             ENDIF
-          DO k = 1, klev
-            DO i = 1, klon
-              !               tr_seri(i,k,itr) = tr_seri(i,k,itr) + d_tr_cv(i,k,itr)
-              tr_seri(i, k, itr) = (tmp_var3(i, k, itr) + d_tr_cv(i, k, itr))
-              tmp_var(i, k) = d_tr_cv(i, k, itr)
-
-            END DO
-          END DO
-
-          CALL kg_to_cm3(pplay, t_seri, tmp_var) !just for his_* computation
-
-          DO k = 1, klev
-            DO i = 1, klon
-              dtrconv(i, itr) = 0.0
-              his_dhkecv(i, itr) = his_dhkecv(i, itr) - tmp_var(i, k)  &
-                      / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-            END DO
-          END DO
-
-          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-          CALL kg_to_cm3(pplay, t_seri, tmp_var) !just for his_* computation
-
-          DO k = 1, klev
-            DO i = 1, klon
-              dtrconv(i, itr) = 0.0
-              his_ds(i, itr) = his_ds(i, itr) - tmp_var(i, k)  &
-                      / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-            END DO
-          END DO
-          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-          IF (lminmax) THEN
-
-            print *, 'Check sum after cvltr itr)', itr, SUM(tr_seri(:, :, itr))
-            CALL minmaxqfi2(d_tr_cv(:, :, itr), qmin, qmax, 'd_tr_cv:')
-            CALL minmaxqfi2(d_tr_trsp(:, :, itr), qmin, qmax, 'd_tr_trsp:')
-            CALL minmaxqfi2(d_tr_sscav(:, :, itr), qmin, qmax, 'd_tr_sscav:')
-            CALL minmaxqfi2(d_tr_sat(:, :, itr), qmin, qmax, 'd_tr_sat:')
-            CALL minmaxqfi2(d_tr_uscav(:, :, itr), qmin, qmax, 'd_tr_uscav:')
-            IF (lcheckmass) THEN
-              CALL checkmass(d_tr_cv(:, :, itr), RNAVO, masse(itr), zdz, &
-                      pplay, t_seri, .FALSE., 'd_tr_cv:')
-            ENDIF
-          ENDIF
-        ENDDO ! it=1,nbtr
-
-      ENDIF ! iflag_conv
-      IF (lminmax) THEN
-        DO itr = 1, nbtr
-          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_trcon')
-        ENDDO
-        DO itr = 1, nbtr
-          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after trconv')
-        ENDDO
-        IF (lcheckmass) THEN
-          DO itr = 1, nbtr
-            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                    pplay, t_seri, iscm3, 'after trconv')
-          ENDDO
-        ENDIF
-        CALL minmaxsource(source_tr, qmin, qmax, 'src: after trconv')
-      ENDIF
-    ENDIF ! convection
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_cvltr = dife * MAX(0, SIGN(1, dife))   &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_cvltr = tia_cvltr + REAL(ti_cvltr) / REAL(clock_rate)
-    ENDIF
-
-
-    !=======================================================================
-    !      LARGE SCALE SCAVENGING KE
-    !=======================================================================
-
-#ifdef IOPHYS_DUST
-      CALL iophys_ecrit('da',klev,'da','',da)
-      CALL iophys_ecrit('phi',klev,'phi','',phi)
-      CALL iophys_ecrit('phi2',klev,'phi2','',phi2)
-      CALL iophys_ecrit('d1a',klev,'d1a','',d1a)
-      CALL iophys_ecrit('dam',klev,'dam','',dam)
-      CALL iophys_ecrit('mp',klev,'mp','',mp)
-      CALL iophys_ecrit('ep',klev,'ep','',ep)
-      CALL iophys_ecrit('sigd',klev,'sigd','',sigd)
-      CALL iophys_ecrit('sij',klev,'sij','',sij)
-      CALL iophys_ecrit('wght_cvfd',klev,'wght_cvfd','',wght_cvfd)
-      CALL iophys_ecrit('clw',klev,'clw','',clw)
-      CALL iophys_ecrit('elij',klev,'elij','',elij)
-      CALL iophys_ecrit('epmlmMm',klev,'epmlmMm','',epmlmMm)
-      CALL iophys_ecrit('eplaMm',klev,'eplaMm','',eplaMm)
-      CALL iophys_ecrit('pmflxr',klev,'pmflxr','',pmflxr)
-      CALL iophys_ecrit('pmflxs',klev,'pmflxs','',pmflxs)
-      CALL iophys_ecrit('evapls',klev,'evapls','',evapls)
-      CALL iophys_ecrit('wdtrainA',klev,'wdtrainA','',wdtrainA)
-      CALL iophys_ecrit('wdtrainM',klev,'wdtrainM','',wdtrainM)
-
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRI'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-
-    IF (iflag_conv>=3) THEN
-      IF (logitime) THEN
-        CALL SYSTEM_CLOCK(COUNT = clock_start)
-      ENDIF
-
-      IF (lessivage)  THEN
-        print *, ' BEFORE lsc_scav '
-        IF (lminmax) THEN
-          DO itr = 1, nbtr
-            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_lsc_scav')
-          ENDDO
-          DO itr = 1, nbtr
-            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before lsc_scav')
-          ENDDO
-          IF (lcheckmass) THEN
-            DO itr = 1, nbtr
-              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                      pplay, t_seri, iscm3, 'before lsc_scav')
-            ENDDO
-          ENDIF
-          CALL minmaxsource(source_tr, qmin, qmax, 'src: before lsc_scav')
-        ENDIF
-
-        ql_incloud_ref = 10.e-4
-        ql_incloud_ref = 5.e-4
-        ! calcul du contenu en eau liquide au sein du nuage
-        ql_incl = ql_incloud_ref
-        ! choix du lessivage
-        IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN
-          !IF (.FALSE.) THEN  ! test #DFB (Binta) sans lsc_scav_spl
-          print *, 'JE iflag_lscav', iflag_lscav
-          DO itr = 1, nbtr
-
-            !       incloud scavenging and removal by large scale rain ! orig : ql_incl
-            !         was replaced by 0.5e-3 kg/kg
-            !          the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR
-            !         Liu (2001) proposed to use 1.5e-3 kg/kg
-
-            !       CALL lsc_scav_orig(pdtphys,itr,iflag_lscav,ql_incl,prfl,psfl,
-            !     .               rneb,beta_fisrt, beta_v1,pplay,paprs,
-            !     .               t_seri,tr_seri,d_tr_insc,
-            !     .               d_tr_bcscav,d_tr_evapls,qPrls)
-            CALL lsc_scav_spl(pdtphys, itr, iflag_lscav, ql_incl, prfl, psfl, &
-                    rneb, beta_fisrt, beta_v1, pplay, paprs, &
-                    t_seri, tr_seri, d_tr_insc, &
-                    alpha_r, alpha_s, kk, henry, &
-                    id_prec, id_fine, id_coss, id_codu, id_scdu, &
-                    d_tr_bcscav, d_tr_evapls, qPrls)
-
-            !large scale scavenging tendency
-            DO k = 1, klev
-              DO i = 1, klon
-                d_tr_ls(i, k, itr) = d_tr_insc(i, k, itr) + d_tr_bcscav(i, k, itr) &
-                        + d_tr_evapls(i, k, itr)
-                tr_seri(i, k, itr) = tr_seri(i, k, itr) + d_tr_ls(i, k, itr)
-                tmp_var(i, k) = d_tr_ls(i, k, itr)
-              ENDDO
-            ENDDO
-
-            CALL kg_to_cm3(pplay, t_seri, tmp_var)
-
-            DO k = 1, klev
-              DO i = 1, klon
-                his_dhkelsc(i, itr) = his_dhkelsc(i, itr) - tmp_var(i, k)    &
-                        / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-
-              END DO
-            END DO
-
-          END DO  !it=1,nbtr
-
-        ELSE
-          print *, 'WARNING: NO lsc_scav, Please choose iflag_lscav=3 or 4'
-          DO itr = 1, nbtr
-            DO i = 1, klon
-              his_dhkelsc(i, itr) = 0.0
-            END DO  ! klon
-          END DO  !it=1,nbtr
-        ENDIF !iflag_lscav
-
-        print *, ' AFTER lsc_scav '
-        IF (lminmax) THEN
-          DO itr = 1, nbtr
-            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_lsc_scav')
-          ENDDO
-          DO itr = 1, nbtr
-            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after lsc_scav')
-          ENDDO
-          IF (lcheckmass) THEN
-            DO itr = 1, nbtr
-              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
-                      pplay, t_seri, iscm3, 'after lsc_scav')
-            ENDDO
-          ENDIF
-          CALL minmaxsource(source_tr, qmin, qmax, 'src: after lsc_scav')
-        ENDIF
-
-      ENDIF ! lessivage
-
-      IF (logitime) THEN
-        CALL SYSTEM_CLOCK(COUNT = clock_end)
-        dife = clock_end - clock_start
-        ti_lscs = dife * MAX(0, SIGN(1, dife))   &
-                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-        tia_lscs = tia_lscs + REAL(ti_lscs) / REAL(clock_rate)
-      ENDIF
-
-    ENDIF !iflag_conv
-
-
-    !=======================================================================
-    !                         COMPUTING THE BURDEN
-    !=======================================================================
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRJ'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    DO itr = 1, nbtr
-      DO j = 1, klev
-        DO i = 1, klon
-          tmp_var(i, j) = tr_seri(i, j, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO j = 1, klev
-        DO i = 1, klon
-          tr_seri(i, j, itr) = tmp_var(i, j)
-        ENDDO
-      ENDDO
-    ENDDO
-    iscm3 = .TRUE.
-
-    ! Computing burden in mg/m2
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          trm(i, itr) = trm(i, itr) + tr_seri(i, k, itr) * 1.e6 * zdz(i, k) * &
-                  masse(itr) * 1.e3 / RNAVO     !--mg S/m2
-        ENDDO
-      ENDDO
-    ENDDO
-
-    ! Computing Surface concentration in ug/m3
-
-    DO itr = 1, nbtr
-      DO i = 1, klon
-        sconc_seri(i, itr) = tr_seri(i, 1, itr) * 1.e6 * &
-                masse(itr) * 1.e3 / RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
-      ENDDO
-    ENDDO
-
-    !=======================================================================
-    !                  CALCULATION OF OPTICAL PROPERTIES
-    !=======================================================================
-
-    CALL aeropt_spl(zdz, tr_seri, RHcl, &
-            id_prec, id_fine, id_coss, id_codu, id_scdu, &
-            ok_chimeredust, &
-            diff_aod550_tot, diag_aod670_tot, diag_aod865_tot, &
-            diff_aod550_tr2, diag_aod670_tr2, diag_aod865_tr2, &
-            diag_aod550_ss, diag_aod670_ss, diag_aod865_ss, &
-            diag_aod550_dust, diag_aod670_dust, diag_aod865_dust, &
-            diag_aod550_dustsco, diag_aod670_dustsco, diag_aod865_dustsco)
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-      dife = clock_end - clock_start
-      ti_brop = dife * MAX(0, SIGN(1, dife))   &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_brop = tia_brop + REAL(ti_brop) / REAL(clock_rate)
-    ENDIF
-
-
-    !=======================================================================
-    !   MODIS terra/aqua simulation output
-    !=======================================================================
-    masque_aqua_cur(:) = 0
-    masque_terra_cur(:) = 0
-
-    CALL satellite_out_spla(jD_cur, jH_cur, pdtphys, rlat, rlon, &
-            masque_aqua_cur, masque_terra_cur)
-    IF (jH_cur - pdtphys / 86400. < 0.) THEN
-      !new utc day: put in 0 everything
-      !JE20150518<<
-      masque_aqua(:) = 0
-      masque_terra(:) = 0
-      aod550_terra(:) = 0.
-      aod550_tr2_terra(:) = 0.
-      aod550_ss_terra(:) = 0.
-      aod550_dust_terra(:) = 0.
-      aod550_dustsco_terra(:) = 0.
-      aod670_terra(:) = 0.
-      aod670_tr2_terra(:) = 0.
-      aod670_ss_terra(:) = 0.
-      aod670_dust_terra(:) = 0.
-      aod670_dustsco_terra(:) = 0.
-      aod865_terra(:) = 0.
-      aod865_tr2_terra(:) = 0.
-      aod865_ss_terra(:) = 0.
-      aod865_dust_terra(:) = 0.
-      aod865_dustsco_terra(:) = 0.
-      aod550_aqua(:) = 0.
-      aod550_tr2_aqua(:) = 0.
-      aod550_ss_aqua(:) = 0.
-      aod550_dust_aqua(:) = 0.
-      aod550_dustsco_aqua(:) = 0.
-      aod670_aqua(:) = 0.
-      aod670_tr2_aqua(:) = 0.
-      aod670_ss_aqua(:) = 0.
-      aod670_dust_aqua(:) = 0.
-      aod670_dustsco_aqua(:) = 0.
-      aod865_aqua(:) = 0.
-      aod865_tr2_aqua(:) = 0.
-      aod865_ss_aqua(:) = 0.
-      aod865_dust_aqua(:) = 0.
-      aod865_dustsco_aqua(:) = 0.
-      !JE20150518>>
-    ENDIF
-
-    DO i = 1, klon
-
-      aod550_terra(i) = aod550_terra(i) + &
-              masque_terra_cur(i) * diff_aod550_tot(i)
-      aod550_tr2_terra(i) = aod550_tr2_terra(i) + &
-              masque_terra_cur(i) * diff_aod550_tr2(i)
-      aod550_ss_terra(i) = aod550_ss_terra(i) + &
-              masque_terra_cur(i) * diag_aod550_ss(i)
-      aod550_dust_terra(i) = aod550_dust_terra(i) + &
-              masque_terra_cur(i) * diag_aod550_dust(i)
-      aod550_dustsco_terra(i) = aod550_dustsco_terra(i) + &
-              masque_terra_cur(i) * diag_aod550_dustsco(i)
-      aod670_terra(i) = aod670_terra(i) + &
-              masque_terra_cur(i) * diag_aod670_tot(i)
-      aod670_tr2_terra(i) = aod670_tr2_terra(i) + &
-              masque_terra_cur(i) * diag_aod670_tr2(i)
-      aod670_ss_terra(i) = aod670_ss_terra(i) + &
-              masque_terra_cur(i) * diag_aod670_ss(i)
-      aod670_dust_terra(i) = aod670_dust_terra(i) + &
-              masque_terra_cur(i) * diag_aod670_dust(i)
-      aod670_dustsco_terra(i) = aod670_dustsco_terra(i) + &
-              masque_terra_cur(i) * diag_aod670_dustsco(i)
-      aod865_terra(i) = aod865_terra(i) + &
-              masque_terra_cur(i) * diag_aod865_tot(i)
-      aod865_tr2_terra(i) = aod865_tr2_terra(i) + &
-              masque_terra_cur(i) * diag_aod865_tr2(i)
-      aod865_ss_terra(i) = aod865_ss_terra(i) + &
-              masque_terra_cur(i) * diag_aod865_ss(i)
-      aod865_dust_terra(i) = aod865_dust_terra(i) + &
-              masque_terra_cur(i) * diag_aod865_dust(i)
-      aod865_dustsco_terra(i) = aod865_dustsco_terra(i) + &
-              masque_terra_cur(i) * diag_aod865_dustsco(i)
-
-      aod550_aqua(i) = aod550_aqua(i) + &
-              masque_aqua_cur(i) * diff_aod550_tot(i)
-      aod550_tr2_aqua(i) = aod550_tr2_aqua(i) + &
-              masque_aqua_cur(i) * diff_aod550_tr2(i)
-      aod550_ss_aqua(i) = aod550_ss_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod550_ss(i)
-      aod550_dust_aqua(i) = aod550_dust_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod550_dust(i)
-      aod550_dustsco_aqua(i) = aod550_dustsco_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod550_dustsco(i)
-      aod670_aqua(i) = aod670_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod670_tot(i)
-      aod670_tr2_aqua(i) = aod670_tr2_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod670_tr2(i)
-      aod670_ss_aqua(i) = aod670_ss_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod670_ss(i)
-      aod670_dust_aqua(i) = aod670_dust_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod670_dust(i)
-      aod670_dustsco_aqua(i) = aod670_dustsco_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod670_dustsco(i)
-      aod865_aqua(i) = aod865_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod865_tot(i)
-      aod865_tr2_aqua(i) = aod865_tr2_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod865_tr2(i)
-      aod865_ss_aqua(i) = aod865_ss_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod865_ss(i)
-      aod865_dust_aqua(i) = aod865_dust_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod865_dust(i)
-      aod865_dustsco_aqua(i) = aod865_dustsco_aqua(i) + &
-              masque_aqua_cur(i) * diag_aod865_dustsco(i)
-
-      masque_aqua(i) = masque_aqua(i) + masque_aqua_cur(i)
-      masque_terra(i) = masque_terra(i) + masque_terra_cur(i)
-    ENDDO
-
-    IF (jH_cur + pdtphys / 86400. >= 1.) THEN
-      !          print *,'last step of the day'
-      DO i = 1, klon
-        IF (masque_aqua(i)> 0) THEN
-          aod550_aqua(i) = aod550_aqua(i) / masque_aqua(i)
-          aod670_aqua(i) = aod670_aqua(i) / masque_aqua(i)
-          aod865_aqua(i) = aod865_aqua(i) / masque_aqua(i)
-          aod550_tr2_aqua(i) = aod550_tr2_aqua(i) / masque_aqua(i)
-          aod670_tr2_aqua(i) = aod670_tr2_aqua(i) / masque_aqua(i)
-          aod865_tr2_aqua(i) = aod865_tr2_aqua(i) / masque_aqua(i)
-          aod550_ss_aqua(i) = aod550_ss_aqua(i) / masque_aqua(i)
-          aod670_ss_aqua(i) = aod670_ss_aqua(i) / masque_aqua(i)
-          aod865_ss_aqua(i) = aod865_ss_aqua(i) / masque_aqua(i)
-          aod550_dust_aqua(i) = aod550_dust_aqua(i) / masque_aqua(i)
-          aod670_dust_aqua(i) = aod670_dust_aqua(i) / masque_aqua(i)
-          aod865_dust_aqua(i) = aod865_dust_aqua(i) / masque_aqua(i)
-          aod550_dustsco_aqua(i) = aod550_dustsco_aqua(i) / masque_aqua(i)
-          aod670_dustsco_aqua(i) = aod670_dustsco_aqua(i) / masque_aqua(i)
-          aod865_dustsco_aqua(i) = aod865_dustsco_aqua(i) / masque_aqua(i)
-        ELSE
-          aod550_aqua(i) = -999.
-          aod670_aqua(i) = -999.
-          aod865_aqua(i) = -999.
-          aod550_tr2_aqua(i) = -999.
-          aod670_tr2_aqua(i) = -999.
-          aod865_tr2_aqua(i) = -999.
-          aod550_ss_aqua(i) = -999.
-          aod670_ss_aqua(i) = -999.
-          aod865_ss_aqua(i) = -999.
-          aod550_dust_aqua(i) = -999.
-          aod670_dust_aqua(i) = -999.
-          aod865_dust_aqua(i) = -999.
-          aod550_dustsco_aqua(i) = -999.
-          aod670_dustsco_aqua(i) = -999.
-          aod865_dustsco_aqua(i) = -999.
-        ENDIF
-        IF (masque_terra(i)> 0) THEN
-          aod550_terra(i) = aod550_terra(i) / masque_terra(i)
-          aod670_terra(i) = aod670_terra(i) / masque_terra(i)
-          aod865_terra(i) = aod865_terra(i) / masque_terra(i)
-          aod550_tr2_terra(i) = aod550_tr2_terra(i) / masque_terra(i)
-          aod670_tr2_terra(i) = aod670_tr2_terra(i) / masque_terra(i)
-          aod865_tr2_terra(i) = aod865_tr2_terra(i) / masque_terra(i)
-          aod550_ss_terra(i) = aod550_ss_terra(i) / masque_terra(i)
-          aod670_ss_terra(i) = aod670_ss_terra(i) / masque_terra(i)
-          aod865_ss_terra(i) = aod865_ss_terra(i) / masque_terra(i)
-          aod550_dust_terra(i) = aod550_dust_terra(i) / masque_terra(i)
-          aod670_dust_terra(i) = aod670_dust_terra(i) / masque_terra(i)
-          aod865_dust_terra(i) = aod865_dust_terra(i) / masque_terra(i)
-          aod550_dustsco_terra(i) = aod550_dustsco_terra(i) / masque_terra(i)
-          aod670_dustsco_terra(i) = aod670_dustsco_terra(i) / masque_terra(i)
-          aod865_dustsco_terra(i) = aod865_dustsco_terra(i) / masque_terra(i)
-        ELSE
-          aod550_terra(i) = -999.
-          aod670_terra(i) = -999.
-          aod865_terra(i) = -999.
-          aod550_tr2_terra(i) = -999.
-          aod670_tr2_terra(i) = -999.
-          aod865_tr2_terra(i) = -999.
-          aod550_ss_terra(i) = -999.
-          aod670_ss_terra(i) = -999.
-          aod865_ss_terra(i) = -999.
-          aod550_dust_terra(i) = -999.
-          aod670_dust_terra(i) = -999.
-          aod865_dust_terra(i) = -999.
-          aod550_dustsco_terra(i) = -999.
-          aod670_dustsco_terra(i) = -999.
-          aod865_dustsco_terra(i) = -999.
-        ENDIF
-      ENDDO
-
-      !!AS deleting lines
-      !!      IF (ok_histrac) THEN
-      !!!!      write in output file
-      !!----many deleted lines
-      !!      ENDIF  !mpi_root
-      !!!$OMP END MASTER
-      !!!$OMP BARRIER
-      !!      ENDIF  !--ok_histrac
-
-    ENDIF ! jH_cur...
-
-    !======================================================================
-    !  Stockage sur bande histoire
-    !======================================================================
-#ifdef IOPHYS_DUST
-      DO itr=1,nbtr
-         WRITE(str2,'(i2.2)') itr
-         CALL iophys_ecrit('TRK'//str2,klev,'SOURCE','',tr_seri(:,:,itr))
-      enddo
-#endif
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_start)
-    ENDIF
-
-    DO itr = 1, nbtr
-      DO j = 1, klev
-        DO i = 1, klon
-          tmp_var(i, j) = tr_seri(i, j, itr)
-        ENDDO
-      ENDDO
-      CALL cm3_to_kg(pplay, t_seri, tmp_var)
-      DO j = 1, klev
-        DO i = 1, klon
-          tr_seri(i, j, itr) = tmp_var(i, j)
-        ENDDO
-      ENDDO
-    ENDDO
-    iscm3 = .FALSE.
-
-
-    !======================================================================
-    !  SAVING AEROSOL RELATED VARIABLES INTO FILE
-    !======================================================================
-
-    ndex2d = 0
-    ndex3d = 0
-
-    itra = itra + 1
-
-    print *, 'SAVING VARIABLES FOR DAY ', itra
-
-    fluxbb(:) = 0.0
-    fluxff(:) = 0.0
-    fluxbcbb(:) = 0.0
-    fluxbcff(:) = 0.0
-    fluxbcnff(:) = 0.0
-    fluxbcba(:) = 0.0
-    fluxbc(:) = 0.0
-    fluxombb(:) = 0.0
-    fluxomff(:) = 0.0
-    fluxomnat(:) = 0.0
-    fluxomba(:) = 0.0
-    fluxomnff(:) = 0.0
-    fluxom(:) = 0.0
-    fluxh2sff(:) = 0.0
-    fluxh2snff(:) = 0.0
-    fluxh2sbio(:) = 0.0
-    fluxso2ff(:) = 0.0
-    fluxso2nff(:) = 0.0
-    fluxso2bb(:) = 0.0
-    fluxso2vol(:) = 0.0
-    fluxso2ba(:) = 0.0
-    fluxso2(:) = 0.0
-    fluxso4ff(:) = 0.0
-    fluxso4nff(:) = 0.0
-    fluxso4bb(:) = 0.0
-    fluxso4ba(:) = 0.0
-    fluxso4(:) = 0.0
-    fluxdms(:) = 0.0
-    fluxdustec(:) = 0.0
-    fluxddfine(:) = 0.0
-    fluxddcoa(:) = 0.0
-    fluxddsco(:) = 0.0
-    fluxdd(:) = 0.0
-    fluxssfine(:) = 0.0
-    fluxsscoa(:) = 0.0
-    fluxss(:) = 0.0
-    DO i = 1, klon
-      IF (iregion_ind(i)>0) THEN           ! LAND
-        ! SULFUR EMISSIONS
-        fluxh2sff(i) = (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * frach2sofso2 * &
-                scale_param_ind(iregion_ind(i)) * &
-                1.e4 / RNAVO * masse_s * 1.e3         ! mgS/m2/s
-        fluxso2ff(i) = scale_param_ind(iregion_ind(i)) * fracso2emis * &
-                (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * 1.e4 / RNAVO * &
-                masse_s * 1.e3  ! mgS/m2/s
-        ! SULPHATE EMISSIONS
-        fluxso4ff(i) = scale_param_ind(iregion_ind(i)) * (1 - fracso2emis) * &
-                (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * 1.e4 / RNAVO * &
-                masse_s * 1.e3  ! mgS/m2/s
-        ! BLACK CARBON EMISSIONS
-        fluxbcff(i) = scale_param_ff(iregion_ind(i)) * &
-                lmt_bcff(i) * 1.e4 * 1.e3  !/g/m2/s
-        ! ORGANIC MATTER EMISSIONS
-        fluxomff(i) = scale_param_ff(iregion_ind(i)) * &
-                (lmt_omff(i)) * 1.e4 * 1.e3  !/g/m2/s
-        ! FOSSIL FUEL EMISSIONS
-        fluxff(i) = fluxbcff(i) + fluxomff(i)
-      ENDIF
-      IF (iregion_bb(i)>0) THEN           ! LAND
-        ! SULFUR EMISSIONS
-        fluxso2bb(i) = scale_param_bb(iregion_bb(i)) * fracso2emis * &
-                (lmt_so2bb_l(i) + lmt_so2bb_h(i)) * &
-                (1. - pctsrf(i, is_oce)) * 1.e4 / RNAVO * masse_s * 1.e3       ! mgS/m2/s
-        ! SULPHATE EMISSIONS
-        fluxso4bb(i) = scale_param_bb(iregion_bb(i)) * (1 - fracso2emis) * &
-                (lmt_so2bb_l(i) + lmt_so2bb_h(i)) * &
-                (1. - pctsrf(i, is_oce)) * 1.e4 / RNAVO * masse_s * 1.e3       ! mgS/m2/s
-        ! BLACK CARBON EMISSIONS
-        fluxbcbb(i) = scale_param_bb(iregion_bb(i)) * &
-                (lmt_bcbb_l(i) + lmt_bcbb_h(i)) * 1.e4 * 1.e3  !mg/m2/s
-        ! ORGANIC MATTER EMISSIONS
-        fluxombb(i) = scale_param_bb(iregion_bb(i)) * &
-                (lmt_ombb_l(i) + lmt_ombb_h(i)) * 1.e4 * 1.e3  !mg/m2/s
-        ! BIOMASS BURNING EMISSIONS
-        fluxbb(i) = fluxbcbb(i) + fluxombb(i)
-      ENDIF
-      ! H2S EMISSIONS
-      fluxh2sbio(i) = lmt_h2sbio(i) * 1.e4 / RNAVO * masse_s * 1.e3      ! mgS/m2/s
-      fluxh2snff(i) = lmt_so2nff(i) * frach2sofso2 * &
-              1.e4 / RNAVO * masse_s * 1.e3         ! mgS/m2/s
-      ! SULFUR DIOXIDE EMISSIONS
-      fluxso2nff(i) = fracso2emis * lmt_so2nff(i) * 1.e4 / RNAVO * &
-              masse_s * 1.e3  ! mgS/m2/s
-      fluxso2vol(i) = (lmt_so2volc_cont(i) + lmt_so2volc_expl(i))  &
-              * 1.e4 / RNAVO * masse_s * 1.e3        ! mgS/m2/s
-      fluxso2ba(i) = lmt_so2ba(i) * 1.e4 / RNAVO * masse_s * 1.e3 * &
-              fracso2emis ! mgS/m2/s
-      fluxso2(i) = fluxso2ff(i) + fluxso2bb(i) + fluxso2nff(i) + &
-              fluxso2vol(i) + fluxso2ba(i)
-      ! DMS EMISSIONS
-      fluxdms(i) = (lmt_dms(i) + lmt_dmsbio(i))              &
-              * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
-      ! SULPHATE EMISSIONS
-      fluxso4ba(i) = lmt_so2ba(i) * 1.e4 / RNAVO * masse_s * 1.e3        &
-              * (1 - fracso2emis) ! mgS/m2/s
-      fluxso4nff(i) = (1 - fracso2emis) * lmt_so2nff(i) * 1.e4 / RNAVO * &
-              masse_s * 1.e3  ! mgS/m2/s
-      fluxso4(i) = fluxso4ff(i) + fluxso4bb(i) + fluxso4ba(i) + fluxso4nff(i)
-      ! BLACK CARBON EMISSIONS
-
-      fluxbcnff(i) = lmt_bcnff(i) * 1.e4 * 1.e3  !mg/m2/s
-      fluxbcba(i) = lmt_bcba(i) * 1.e4 * 1.e3    !mg/m2/s
-      fluxbc(i) = fluxbcbb(i) + fluxbcff(i) + fluxbcnff(i) + fluxbcba(i)
-      ! ORGANIC MATTER EMISSIONS
-      fluxomnat(i) = lmt_omnat(i) * 1.e4 * 1.e3  !mg/m2/s
-      fluxomba(i) = lmt_omba(i) * 1.e4 * 1.e3  !mg/m2/s
-      fluxomnff(i) = lmt_omnff(i) * 1.e4 * 1.e3  !mg/m2/s
-      fluxom(i) = fluxombb(i) + fluxomff(i) + fluxomnat(i) + fluxomba(i) + &
-              fluxomnff(i)
-      ! DUST EMISSIONS
-      fluxdustec(i) = dust_ec(i) * 1.e6 ! old dust emission scheme
-      !JE20140605<<         old dust emission version
-      !         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
-      !     .                                  * dust_ec(i)*0.093*1.e6
-      !         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
-      !     .                                  * dust_ec(i)*0.905*1.e6
-      !         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
-      !JE20140605>>
-      fluxddfine(i) = flux_sparam_ddfine(i)
-      fluxddcoa(i) = flux_sparam_ddcoa(i)
-      fluxddsco(i) = flux_sparam_ddsco(i)
-      fluxdd(i) = fluxddfine(i) + fluxddcoa(i) + fluxddsco(i)
-      ! SEA SALT EMISSIONS
-      fluxssfine(i) = scale_param_ssacc * lmt_sea_salt(i, 1) * 1.e4 * 1.e3
-      fluxsscoa(i) = scale_param_sscoa * lmt_sea_salt(i, 2) * 1.e4 * 1.e3
-      fluxss(i) = fluxssfine(i) + fluxsscoa(i)
-    ENDDO
-
-    !      prepare outputs cvltr
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_cv(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_cv_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_trsp(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_trsp_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_sscav(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_sscav_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_sat(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_sat_o(i, k, itr) = tmp_var(i, k)   &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_uscav(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_uscav_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_insc(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_insc_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_bcscav(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_bcscav_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_evapls(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_evapls_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_ls(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_ls_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_dyn(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_dyn_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_cl(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_cl_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-
-    DO itr = 1, nbtr
-      DO k = 1, klev
-        DO i = 1, klon
-          tmp_var(i, k) = d_tr_th(i, k, itr)
-        ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay, t_seri, tmp_var)
-      DO k = 1, klev
-        DO i = 1, klon
-          d_tr_th_o(i, k, itr) = tmp_var(i, k)  &
-                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
-        ENDDO
-      ENDDO
-    ENDDO
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-    DO itr = 1, nbtr
-      WRITE(str2, '(i2.2)') itr
-      DO i = 1, klon
-        his_dh(i, itr) = his_dhlsc(i, itr) + his_dhcon(i, itr) + &
-                his_dhbclsc(i, itr) + his_dhbccon(i, itr)
-
-      ENDDO
-    ENDDO
-
-    !AS: commenting out and deleting lines
-    !!      IF (ok_histrac) THEN
-    !!
-    !! SAVING VARIABLES IN TRACEUR
-    !!----- many lines deleted----
-    !!      ENDIF ! ok_histrac
-
-
-
-
-    !JE20141224
-    ! saving variables for output
-    ! 2D outputs
-    DO i = 1, klon
-      trm01(i) = 0.
-      trm02(i) = 0.
-      trm03(i) = 0.
-      trm04(i) = 0.
-      trm05(i) = 0.
-      sconc01(i) = 0.
-      sconc02(i) = 0.
-      sconc03(i) = 0.
-      sconc04(i) = 0.
-      sconc05(i) = 0.
-      flux01(i) = 0.
-      flux02(i) = 0.
-      flux03(i) = 0.
-      flux04(i) = 0.
-      flux05(i) = 0.
-      ds01(i) = 0.
-      ds02(i) = 0.
-      ds03(i) = 0.
-      ds04(i) = 0.
-      ds05(i) = 0.
-      dh01(i) = 0.
-      dh02(i) = 0.
-      dh03(i) = 0.
-      dh04(i) = 0.
-      dh05(i) = 0.
-      dtrconv01(i) = 0.
-      dtrconv02(i) = 0.
-      dtrconv03(i) = 0.
-      dtrconv04(i) = 0.
-      dtrconv05(i) = 0.
-      dtherm01(i) = 0.
-      dtherm02(i) = 0.
-      dtherm03(i) = 0.
-      dtherm04(i) = 0.
-      dtherm05(i) = 0.
-      dhkecv01(i) = 0.
-      dhkecv02(i) = 0.
-      dhkecv03(i) = 0.
-      dhkecv04(i) = 0.
-      dhkecv05(i) = 0.
-      d_tr_ds01(i) = 0.
-      d_tr_ds02(i) = 0.
-      d_tr_ds03(i) = 0.
-      d_tr_ds04(i) = 0.
-      d_tr_ds05(i) = 0.
-      dhkelsc01(i) = 0.
-      dhkelsc02(i) = 0.
-      dhkelsc03(i) = 0.
-      dhkelsc04(i) = 0.
-      dhkelsc05(i) = 0.
-      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      IF(id_prec>0)  trm01(i) = trm(i, id_prec)
-      IF(id_fine>0)  trm02(i) = trm(i, id_fine)
-      IF(id_coss>0)  trm03(i) = trm(i, id_coss)
-      IF(id_codu>0)  trm04(i) = trm(i, id_codu)
-      IF(id_scdu>0)  trm05(i) = trm(i, id_scdu)
-      IF(id_prec>0)    sconc01(i) = sconc_seri(i, id_prec)
-      IF(id_fine>0)    sconc02(i) = sconc_seri(i, id_fine)
-      IF(id_coss>0)    sconc03(i) = sconc_seri(i, id_coss)
-      IF(id_codu>0)    sconc04(i) = sconc_seri(i, id_codu)
-      IF(id_scdu>0)    sconc05(i) = sconc_seri(i, id_scdu)
-      IF(id_prec>0)    flux01(i) = flux_tr(i, id_prec)
-      IF(id_fine>0)    flux02(i) = flux_tr(i, id_fine)
-      IF(id_coss>0)    flux03(i) = flux_tr(i, id_coss)
-      IF(id_codu>0)    flux04(i) = flux_tr(i, id_codu)
-      IF(id_scdu>0)    flux05(i) = flux_tr(i, id_scdu)
-      IF(id_prec>0)    ds01(i) = his_ds(i, id_prec)
-      IF(id_fine>0)    ds02(i) = his_ds(i, id_fine)
-      IF(id_coss>0)    ds03(i) = his_ds(i, id_coss)
-      IF(id_codu>0)    ds04(i) = his_ds(i, id_codu)
-      IF(id_scdu>0)    ds05(i) = his_ds(i, id_scdu)
-      IF(id_prec>0)    dh01(i) = his_dh(i, id_prec)
-      IF(id_fine>0)    dh02(i) = his_dh(i, id_fine)
-      IF(id_coss>0)    dh03(i) = his_dh(i, id_coss)
-      IF(id_codu>0)    dh04(i) = his_dh(i, id_codu)
-      IF(id_scdu>0)    dh05(i) = his_dh(i, id_scdu)
-      IF(id_prec>0)    dtrconv01(i) = dtrconv(i, id_prec)
-      IF(id_fine>0)    dtrconv02(i) = dtrconv(i, id_fine)
-      IF(id_coss>0)    dtrconv03(i) = dtrconv(i, id_coss)
-      IF(id_codu>0)    dtrconv04(i) = dtrconv(i, id_codu)
-      IF(id_scdu>0)    dtrconv05(i) = dtrconv(i, id_scdu)
-      IF(id_prec>0)    dtherm01(i) = his_th(i, id_prec)
-      IF(id_fine>0)    dtherm02(i) = his_th(i, id_fine)
-      IF(id_coss>0)    dtherm03(i) = his_th(i, id_coss)
-      IF(id_codu>0)    dtherm04(i) = his_th(i, id_codu)
-      IF(id_scdu>0)    dtherm05(i) = his_th(i, id_scdu)
-      IF(id_prec>0)    dhkecv01(i) = his_dhkecv(i, id_prec)
-      IF(id_fine>0)    dhkecv02(i) = his_dhkecv(i, id_fine)
-      IF(id_coss>0)    dhkecv03(i) = his_dhkecv(i, id_coss)
-      IF(id_codu>0)    dhkecv04(i) = his_dhkecv(i, id_codu)
-      IF(id_scdu>0)    dhkecv05(i) = his_dhkecv(i, id_scdu)
-      IF(id_prec>0)    d_tr_ds01(i) = his_ds(i, id_prec)
-      IF(id_fine>0)    d_tr_ds02(i) = his_ds(i, id_fine)
-      IF(id_coss>0)    d_tr_ds03(i) = his_ds(i, id_coss)
-      IF(id_codu>0)    d_tr_ds04(i) = his_ds(i, id_codu)
-      IF(id_scdu>0)    d_tr_ds05(i) = his_ds(i, id_scdu)
-      IF(id_prec>0)    dhkelsc01(i) = his_dhkelsc(i, id_prec)
-      IF(id_fine>0)    dhkelsc02(i) = his_dhkelsc(i, id_fine)
-      IF(id_coss>0)    dhkelsc03(i) = his_dhkelsc(i, id_coss)
-      IF(id_codu>0)    dhkelsc04(i) = his_dhkelsc(i, id_codu)
-      IF(id_scdu>0)    dhkelsc05(i) = his_dhkelsc(i, id_scdu)
-      u10m_ss(i) = u10m_ec(i)
-      v10m_ss(i) = v10m_ec(i)
-    ENDDO
-    ! 3D outs
-    DO i = 1, klon
-      DO k = 1, klev
-        d_tr_cv01(i, k) = 0.
-        d_tr_cv02(i, k) = 0.
-        d_tr_cv03(i, k) = 0.
-        d_tr_cv04(i, k) = 0.
-        d_tr_cv05(i, k) = 0.
-        d_tr_trsp01(i, k) = 0.
-        d_tr_trsp02(i, k) = 0.
-        d_tr_trsp03(i, k) = 0.
-        d_tr_trsp04(i, k) = 0.
-        d_tr_trsp05(i, k) = 0.
-        d_tr_sscav01(i, k) = 0.
-        d_tr_sscav02(i, k) = 0.
-        d_tr_sscav03(i, k) = 0.
-        d_tr_sscav04(i, k) = 0.
-        d_tr_sscav05(i, k) = 0.
-        d_tr_sat01(i, k) = 0.
-        d_tr_sat02(i, k) = 0.
-        d_tr_sat03(i, k) = 0.
-        d_tr_sat04(i, k) = 0.
-        d_tr_sat05(i, k) = 0.
-        d_tr_uscav01(i, k) = 0.
-        d_tr_uscav02(i, k) = 0.
-        d_tr_uscav03(i, k) = 0.
-        d_tr_uscav04(i, k) = 0.
-        d_tr_uscav05(i, k) = 0.
-        d_tr_insc01(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        d_tr_insc02(i, k) = 0.
-        d_tr_insc03(i, k) = 0.
-        d_tr_insc04(i, k) = 0.
-        d_tr_insc05(i, k) = 0.
-        d_tr_bcscav01(i, k) = 0.
-        d_tr_bcscav02(i, k) = 0.
-        d_tr_bcscav03(i, k) = 0.
-        d_tr_bcscav04(i, k) = 0.
-        d_tr_bcscav05(i, k) = 0.
-        d_tr_evapls01(i, k) = 0.
-        d_tr_evapls02(i, k) = 0.
-        d_tr_evapls03(i, k) = 0.
-        d_tr_evapls04(i, k) = 0.
-        d_tr_evapls05(i, k) = 0.
-        d_tr_ls01(i, k) = 0.
-        d_tr_ls02(i, k) = 0.
-        d_tr_ls03(i, k) = 0.
-        d_tr_ls04(i, k) = 0.
-        d_tr_ls05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        d_tr_dyn01(i, k) = 0.
-        d_tr_dyn02(i, k) = 0.
-        d_tr_dyn03(i, k) = 0.
-        d_tr_dyn04(i, k) = 0.
-        d_tr_dyn05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        d_tr_cl01(i, k) = 0.
-        d_tr_cl02(i, k) = 0.
-        d_tr_cl03(i, k) = 0.
-        d_tr_cl04(i, k) = 0.
-        d_tr_cl05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        d_tr_th01(i, k) = 0.
-        d_tr_th02(i, k) = 0.
-        d_tr_th03(i, k) = 0.
-        d_tr_th04(i, k) = 0.
-        d_tr_th05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ENDDO
-    ENDDO
-
-    IF(1==0) THEN
-      ! calcul in original trunk version; problem: budget not closed. Corrected in "ELSE"
-      DO i = 1, klon
-        DO k = 1, klev
-
-          IF(id_prec>0)        d_tr_cv01(i, k) = d_tr_cv_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_cv02(i, k) = d_tr_cv_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_cv03(i, k) = d_tr_cv_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_cv04(i, k) = d_tr_cv_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_cv05(i, k) = d_tr_cv_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_trsp01(i, k) = d_tr_trsp_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_trsp02(i, k) = d_tr_trsp_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_trsp03(i, k) = d_tr_trsp_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_trsp04(i, k) = d_tr_trsp_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_trsp05(i, k) = d_tr_trsp_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_sscav01(i, k) = d_tr_sscav_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_sscav02(i, k) = d_tr_sscav_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_sscav03(i, k) = d_tr_sscav_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_sscav04(i, k) = d_tr_sscav_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_sscav05(i, k) = d_tr_sscav_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_sat01(i, k) = d_tr_sat_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_sat02(i, k) = d_tr_sat_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_sat03(i, k) = d_tr_sat_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_sat04(i, k) = d_tr_sat_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_sat05(i, k) = d_tr_sat_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_uscav01(i, k) = d_tr_uscav_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_uscav02(i, k) = d_tr_uscav_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_uscav03(i, k) = d_tr_uscav_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_uscav04(i, k) = d_tr_uscav_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_uscav05(i, k) = d_tr_uscav_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_insc01(i, k) = d_tr_insc_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_insc02(i, k) = d_tr_insc_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_insc03(i, k) = d_tr_insc_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_insc04(i, k) = d_tr_insc_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_insc05(i, k) = d_tr_insc_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_bcscav01(i, k) = d_tr_bcscav_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_bcscav02(i, k) = d_tr_bcscav_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_bcscav03(i, k) = d_tr_bcscav_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_bcscav04(i, k) = d_tr_bcscav_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_bcscav05(i, k) = d_tr_bcscav_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_evapls01(i, k) = d_tr_evapls_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_evapls02(i, k) = d_tr_evapls_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_evapls03(i, k) = d_tr_evapls_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_evapls04(i, k) = d_tr_evapls_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_evapls05(i, k) = d_tr_evapls_o(i, k, id_scdu)
-        ENDDO
-      ENDDO
-    ELSE ! correction pour fermeture de bilan, par FH dans les simus de Binta pour Habib
-      DO i = 1, klon
-        DO k = 1, klev
-          IF(id_prec>0)        d_tr_cv01(i, k) = d_tr_cv(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_cv02(i, k) = d_tr_cv(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_cv03(i, k) = d_tr_cv(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_cv04(i, k) = d_tr_cv(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_cv05(i, k) = d_tr_cv(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_trsp01(i, k) = d_tr_trsp(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_trsp02(i, k) = d_tr_trsp(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_trsp03(i, k) = d_tr_trsp(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_trsp04(i, k) = d_tr_trsp(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_trsp05(i, k) = d_tr_trsp(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_sscav01(i, k) = d_tr_sscav(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_sscav02(i, k) = d_tr_sscav(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_sscav03(i, k) = d_tr_sscav(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_sscav04(i, k) = d_tr_sscav(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_sscav05(i, k) = d_tr_sscav(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_sat01(i, k) = d_tr_sat(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_sat02(i, k) = d_tr_sat(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_sat03(i, k) = d_tr_sat(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_sat04(i, k) = d_tr_sat(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_sat05(i, k) = d_tr_sat(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_uscav01(i, k) = d_tr_uscav(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_uscav02(i, k) = d_tr_uscav(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_uscav03(i, k) = d_tr_uscav(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_uscav04(i, k) = d_tr_uscav(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_uscav05(i, k) = d_tr_uscav(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_insc01(i, k) = d_tr_insc(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_insc02(i, k) = d_tr_insc(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_insc03(i, k) = d_tr_insc(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_insc04(i, k) = d_tr_insc(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_insc05(i, k) = d_tr_insc(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_bcscav01(i, k) = d_tr_bcscav(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_bcscav02(i, k) = d_tr_bcscav(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_bcscav03(i, k) = d_tr_bcscav(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_bcscav04(i, k) = d_tr_bcscav(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_bcscav05(i, k) = d_tr_bcscav(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_evapls01(i, k) = d_tr_evapls(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_evapls02(i, k) = d_tr_evapls(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_evapls03(i, k) = d_tr_evapls(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_evapls04(i, k) = d_tr_evapls(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_evapls05(i, k) = d_tr_evapls(i, k, id_scdu) / pdtphys
-        ENDDO
-      ENDDO
-    ENDIF
-
-    IF(1==0) THEN  ! This "if" is as in original trunk
-      DO i = 1, klon
-        DO k = 1, klev
-          IF(id_prec>0)        d_tr_ls01(i, k) = d_tr_ls_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_ls02(i, k) = d_tr_ls_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_ls03(i, k) = d_tr_ls_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_ls04(i, k) = d_tr_ls_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_ls05(i, k) = d_tr_ls_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_dyn01(i, k) = d_tr_dyn_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_dyn02(i, k) = d_tr_dyn_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_dyn03(i, k) = d_tr_dyn_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_dyn04(i, k) = d_tr_dyn_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_dyn05(i, k) = d_tr_dyn_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_cl01(i, k) = d_tr_cl_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_cl02(i, k) = d_tr_cl_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_cl03(i, k) = d_tr_cl_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_cl04(i, k) = d_tr_cl_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_cl05(i, k) = d_tr_cl_o(i, k, id_scdu)
-          IF(id_prec>0)        d_tr_th01(i, k) = d_tr_th_o(i, k, id_prec)
-          IF(id_fine>0)        d_tr_th02(i, k) = d_tr_th_o(i, k, id_fine)
-          IF(id_coss>0)        d_tr_th03(i, k) = d_tr_th_o(i, k, id_coss)
-          IF(id_codu>0)        d_tr_th04(i, k) = d_tr_th_o(i, k, id_codu)
-          IF(id_scdu>0)        d_tr_th05(i, k) = d_tr_th_o(i, k, id_scdu)
-        ENDDO
-      ENDDO
-    ELSE
-      DO i = 1, klon
-        DO k = 1, klev
-          IF(id_prec>0)        d_tr_ls01(i, k) = d_tr_ls(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_ls02(i, k) = d_tr_ls(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_ls03(i, k) = d_tr_ls(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_ls04(i, k) = d_tr_ls(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_ls05(i, k) = d_tr_ls(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_dyn01(i, k) = d_tr_dyn(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_dyn02(i, k) = d_tr_dyn(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_dyn03(i, k) = d_tr_dyn(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_dyn04(i, k) = d_tr_dyn(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_dyn05(i, k) = d_tr_dyn(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_cl01(i, k) = d_tr_cl(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_cl02(i, k) = d_tr_cl(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_cl03(i, k) = d_tr_cl(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_cl04(i, k) = d_tr_cl(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_cl05(i, k) = d_tr_cl(i, k, id_scdu) / pdtphys
-          IF(id_prec>0)        d_tr_th01(i, k) = d_tr_th(i, k, id_prec) / pdtphys
-          IF(id_fine>0)        d_tr_th02(i, k) = d_tr_th(i, k, id_fine) / pdtphys
-          IF(id_coss>0)        d_tr_th03(i, k) = d_tr_th(i, k, id_coss) / pdtphys
-          IF(id_codu>0)        d_tr_th04(i, k) = d_tr_th(i, k, id_codu) / pdtphys
-          IF(id_scdu>0)        d_tr_th05(i, k) = d_tr_th(i, k, id_scdu) / pdtphys
-        ENDDO
-      ENDDO
-    ENDIF
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-
-      dife = clock_end - clock_start
-      ti_outs = dife * MAX(0, SIGN(1, dife))   &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_outs = tia_outs + REAL(ti_outs) / REAL(clock_rate)
-    ENDIF
-
-    IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT = clock_end)
-
-      dife = clock_end - clock_start_spla
-      ti_spla = dife * MAX(0, SIGN(1, dife)) &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-
-      tia_spla = tia_spla + REAL(ti_spla) / REAL(clock_rate)
-      print *, 'times for this timestep:timeproc,timeproc/time_pytracr_spl-'
-      print *, 'time spla', REAL(ti_spla) / REAL(clock_rate)                &
-              , REAL(ti_spla) / REAL(ti_spla)
-      print *, 'time init', REAL(ti_init) / REAL(clock_rate)                &
-              , REAL(ti_init) / REAL(ti_spla)
-      print *, 'time inittype', REAL(ti_inittype) / REAL(clock_rate)        &
-              , REAL(ti_inittype) / REAL(ti_spla)
-      print *, 'time inittwrite', REAL(ti_inittwrite) / REAL(clock_rate)    &
-              , REAL(ti_inittwrite) / REAL(ti_spla)
-      print *, 'time emis', REAL(ti_emis) / REAL(clock_rate)                &
-              , REAL(ti_emis) / REAL(ti_spla)
-      print *, 'time depo ', REAL(ti_depo) / REAL(clock_rate)               &
-              , REAL(ti_depo) / REAL(ti_spla)
-      print *, 'time cltr', REAL(ti_cltr) / REAL(clock_rate)                &
-              , REAL(ti_cltr) / REAL(ti_spla)
-      print *, 'time ther', REAL(ti_ther) / REAL(clock_rate)                &
-              , REAL(ti_ther) / REAL(ti_spla)
-      print *, 'time sedi', REAL(ti_sedi) / REAL(clock_rate)                &
-              , REAL(ti_sedi) / REAL(ti_spla)
-      print *, 'time gas to part', REAL(ti_gasp) / REAL(clock_rate)         &
-              , REAL(ti_gasp) / REAL(ti_spla)
-      print *, 'time AP wet', REAL(ti_wetap) / REAL(clock_rate)             &
-              , REAL(ti_wetap) / REAL(ti_spla)
-      print *, 'time convective', REAL(ti_cvltr) / REAL(clock_rate)         &
-              , REAL(ti_cvltr) / REAL(ti_spla)
-      print *, 'time NP lsc scav', REAL(ti_lscs) / REAL(clock_rate)         &
-              , REAL(ti_lscs) / REAL(ti_spla)
-      print *, 'time opt,brdn,etc', REAL(ti_brop) / REAL(clock_rate)        &
-              , REAL(ti_brop) / REAL(ti_spla)
-      print *, 'time outputs', REAL(ti_outs) / REAL(clock_rate)             &
-              , REAL(ti_outs) / REAL(ti_spla)
-
-      print *, '--time accumulated: time proc, time proc/time phytracr_spl--'
-      print *, 'time spla', tia_spla
-      print *, 'time init', tia_init, tia_init / tia_spla
-      print *, 'time inittype', tia_inittype, tia_inittype / tia_spla
-      print *, 'time inittwrite', tia_inittwrite, tia_inittwrite / tia_spla
-      print *, 'time emis', tia_emis, tia_emis / tia_spla
-      print *, 'time depo', tia_depo, tia_depo / tia_spla
-      print *, 'time cltr', tia_cltr, tia_cltr / tia_spla
-      print *, 'time ther', tia_ther, tia_ther / tia_spla
-      print *, 'time sedi', tia_sedi, tia_sedi / tia_spla
-      print *, 'time gas to part', tia_gasp, tia_gasp / tia_spla
-      print *, 'time AP wet', tia_wetap, tia_wetap / tia_spla
-      print *, 'time convective', tia_cvltr, tia_cvltr / tia_spla
-      print *, 'time NP lsc scav', tia_lscs, tia_lscs / tia_spla
-      print *, 'time opt,brdn,etc', tia_brop, tia_brop / tia_spla
-      print *, 'time outputs', tia_outs, tia_outs / tia_spla
-
-      dife = clock_end_outphytracr - clock_start_outphytracr
-      ti_nophytracr = dife * MAX(0, SIGN(1, dife))  &
-              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
-      tia_nophytracr = tia_nophytracr + REAL(ti_nophytracr) / REAL(clock_rate)
-      print *, 'Time outside phytracr; Time accum outside phytracr'
-      PRINT*, REAL(ti_nophytracr) / REAL(clock_rate), tia_nophytracr
-
-      clock_start_outphytracr = clock_end
-
-    ENDIF
-    print *, 'END PHYTRACR_SPL '
-    print *, 'lmt_so2ff_l FIN', MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
-
-    !      CALL abort_gcm('TEST1', 'OK1', 1)
-
-
-  END SUBROUTINE phytracr_spl
-
-  SUBROUTINE readregionsdims2_spl(nbreg, fileregions)
-
-    USE lmdz_grid_phy
-    USE lmdz_phys_para
-
-    IMPLICIT NONE
-    CHARACTER*800 fileregions
-    CHARACTER*800 auxstr
-    INTEGER nbreg
-
-    IF (is_mpi_root .AND. is_omp_root) THEN
-
-      OPEN (UNIT = 1, FILE = trim(adjustl(fileregions)))
-      READ(1, '(a)') auxstr
-      READ(1, '(i10)') nbreg
-      CLOSE(UNIT = 1)
-    ENDIF
-    CALL bcast(nbreg)
-
-  END SUBROUTINE readregionsdims2_spl
-
-  SUBROUTINE readregionsdims_spl(nbreg_ind, fileregionsdimsind, &
-          nbreg_dust, fileregionsdimsdust, &
-          nbreg_bb, fileregionsdimsbb)
-    USE lmdz_grid_phy
-    USE lmdz_phys_para
-
-    IMPLICIT NONE
-    CHARACTER*800 fileregionsdimsind
-    CHARACTER*800 fileregionsdimsdust
-    CHARACTER*800 fileregionsdimsbb
-    CHARACTER*800 auxstr
-    INTEGER nbreg_ind, nbreg_dust, nbreg_bb
-
-    IF (is_mpi_root .AND. is_omp_root) THEN
-
-      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsind)))
-      READ(1, '(a)') auxstr
-      READ(1, '(i10)') nbreg_ind
-      CLOSE(UNIT = 1)
-
-      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsdust)))
-      READ(1, '(a)') auxstr
-      READ(1, '(i10)') nbreg_dust
-      CLOSE(UNIT = 1)
-
-      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsbb)))
-      READ(1, '(a)') auxstr
-      READ(1, '(i10)') nbreg_bb
-      CLOSE(UNIT = 1)
-
-    ENDIF
-    CALL bcast(nbreg_ind)
-    CALL bcast(nbreg_dust)
-    CALL bcast(nbreg_bb)
-
-  END SUBROUTINE readregionsdims_spl
-
-  SUBROUTINE readregions_spl(iregion, filenameregion)
-    USE dimphy
-    USE lmdz_grid_phy
-    USE lmdz_phys_para
-
-    IMPLICIT NONE
-    CHARACTER*(*) filenameregion
-    INTEGER iregion(klon)
-    INTEGER iregion_glo(klon_glo)
-    INTEGER k
-
-    IF (is_mpi_root .AND. is_omp_root) THEN
-
-      print *, trim(adjustl(filenameregion))
-      OPEN(1, file = trim(adjustl(filenameregion)))
-      DO k = 1, klon_glo
-        READ(1, '(i10)') iregion_glo(k)
-      ENDDO
-      CLOSE(UNIT = 1)
-    ENDIF
-    CALL scatter(iregion_glo, iregion)
-
-  END SUBROUTINE readregions_spl
-
-  !! AS: SUBROUTINE readscaleparams_spl pas appellee
-  SUBROUTINE readscaleparams_spl(scale_param, nbreg, &
-          filescaleparams)
-    USE lmdz_grid_phy
-    USE lmdz_phys_para
-    IMPLICIT NONE
-
-    CHARACTER*800 filescaleparams
-    INTEGER nbreg
-    REAL scale_param(nbreg)
-    INTEGER k
-
-    IF (is_mpi_root .AND. is_omp_root) THEN
-      OPEN(1, file = trim(adjustl(filescaleparams)), form = 'unformatted')
-      DO k = 1, nbreg
-        read(1)  scale_param(k)
-      enddo
-      CLOSE(1)
-    ENDIF
-    CALL bcast(scale_param)
-    !      print *,'holaaaaaaaaaaaa'
-    !      print *,scale_param
-
-  END SUBROUTINE readscaleparams_spl
-
-  SUBROUTINE readscaleparamsnc_spl(scale_param_ind, &
-          nbreg_ind, paramname_ind, &
-          scale_param_ff, nbreg_ff, paramname_ff, &
-          scale_param_bb, nbreg_bb, paramname_bb, &
-          scale_param_dustacc, nbreg_dustacc, paramname_dustacc, &
-          scale_param_dustcoa, nbreg_dustcoa, paramname_dustcoa, &
-          scale_param_dustsco, nbreg_dustsco, paramname_dustsco, &
-          param_wstarBLperregion, nbreg_wstardustBL, paramname_wstarBL, &
-          param_wstarWAKEperregion, nbreg_wstardustWAKE, paramname_wstarWAKE, &
-          scale_param_ssacc, paramname_ssacc, &
-          scale_param_sscoa, paramname_sscoa, &
-          filescaleparams, julien, jH_phys, pdtphys, debutphy)
-    !      SUBROUTINE readscaleparamsnc_spl(scale_param, nbreg, &
-    !                                        filescaleparams,paramname,&
-    !                                        julien,jH_phys, pdtphys,debutphy)
-    USE lmdz_grid_phy
-    USE lmdz_phys_para
-    IMPLICIT NONE
-
-    CHARACTER*800 filescaleparams
-    CHARACTER*100 paramname_ind, paramname_ff, paramname_bb
-    CHARACTER*100 paramname_dustacc, paramname_dustcoa
-    CHARACTER*100 paramname_dustsco
-    CHARACTER*100 paramname_ssacc
-    CHARACTER*100 paramname_sscoa
-    CHARACTER*100 paramname_wstarBL
-    CHARACTER*100 paramname_wstarWAKE
-
-    INTEGER nbreg, iday
-    INTEGER nbreg_ind, nbreg_ff, nbreg_bb, nbreg_dustacc
-    INTEGER nbreg_dustcoa, nbreg_dustsco, nbreg_wstardustBL
-    INTEGER  nbreg_wstardustWAKE
-    INTEGER, PARAMETER :: nbreg_ssacc = 1
-    INTEGER, PARAMETER :: nbreg_sscoa = 1
-    REAL, PARAMETER :: sca_resol = 24. ! resolution of scalig params in hours
-    REAL scale_param_ind(nbreg_ind)
-    REAL scale_param_bb(nbreg_bb)
-    REAL scale_param_ff(nbreg_ff)
-    REAL scale_param_dustacc(nbreg_dustacc)
-    REAL scale_param_dustcoa(nbreg_dustcoa)
-    REAL scale_param_dustsco(nbreg_dustsco)
-    REAL param_wstarBLperregion(nbreg_wstardustBL)
-    REAL param_wstarWAKEperregion(nbreg_wstardustWAKE)
-    REAL scale_param_ssacc
-    REAL scale_param_ssacc_tmp(nbreg_ssacc)
-    REAL scale_param_sscoa
-    REAL scale_param_sscoa_tmp(nbreg_sscoa)
-
-    INTEGER k, step_sca, test_sca
-    REAL :: jH_phys, pdtphys
-    REAL, SAVE :: jH_sca, jH_ini
-    INTEGER julien
-    LOGICAL debutphy
-    SAVE step_sca, test_sca, iday
-    !$OMP THREADPRIVATE(step_sca,test_sca,iday)
-    !$OMP THREADPRIVATE(jH_sca,jH_ini)
-
-    IF (debutphy) THEN
-      iday = julien
-      step_sca = 1
-      test_sca = 0
-      jH_ini = jH_phys
-      jH_sca = jH_phys
-    ENDIF
-
-    IF (test_sca == 0) THEN
-      ! READ file!!
-      CALL read_scalenc(filescaleparams, paramname_ind, &
-              nbreg_ind, step_sca, &
-              scale_param_ind)
-      CALL read_scalenc(filescaleparams, paramname_bb, &
-              nbreg_bb, step_sca, &
-              scale_param_bb)
-      CALL read_scalenc(filescaleparams, paramname_ff, &
-              nbreg_ff, step_sca, &
-              scale_param_ff)
-      CALL read_scalenc(filescaleparams, paramname_dustacc, &
-              nbreg_dustacc, step_sca, &
-              scale_param_dustacc)
-      CALL read_scalenc(filescaleparams, paramname_dustcoa, &
-              nbreg_dustcoa, step_sca, &
-              scale_param_dustcoa)
-      CALL read_scalenc(filescaleparams, paramname_dustsco, &
-              nbreg_dustsco, step_sca, &
-              scale_param_dustsco)
-      CALL read_scalenc(filescaleparams, paramname_wstarBL, &
-              nbreg_wstardustBL, step_sca, &
-              param_wstarBLperregion)
-      CALL read_scalenc(filescaleparams, paramname_wstarWAKE, &
-              nbreg_wstardustWAKE, step_sca, &
-              param_wstarWAKEperregion)
-      CALL read_scalenc(filescaleparams, paramname_ssacc, &
-              nbreg_ssacc, step_sca, &
-              scale_param_ssacc_tmp)
-      CALL read_scalenc(filescaleparams, paramname_sscoa, &
-              nbreg_sscoa, step_sca, &
-              scale_param_sscoa_tmp)
-      scale_param_ssacc = scale_param_ssacc_tmp(1)
-      scale_param_sscoa = scale_param_sscoa_tmp(1)
-
-      !print *,'JEREADFILE',julien,jH_phys
-      step_sca = step_sca + 1
-      test_sca = 1
-    ENDIF
-
-    jH_sca = jH_sca + pdtphys / (24. * 3600.)
-    IF (jH_sca>(sca_resol) / 24.) THEN
-      test_sca = 0
-      jH_sca = jH_ini
-    ENDIF
-
-  END SUBROUTINE readscaleparamsnc_spl
-
-  SUBROUTINE read_scalenc(filescaleparams, paramname, nbreg, step_sca, &
-          scale_param)
-
-    USE lmdz_grid_phy
-    USE lmdz_phys_para
-    USE netcdf, ONLY: nf90_open, nf90_close, nf90_inq_varid, nf90_nowrite, nf90_noerr, nf90_get_var
-    IMPLICIT NONE
-
-    CHARACTER*800 filescaleparams
-    CHARACTER*100 paramname
-    INTEGER nbreg, step_sca
-    REAL scale_param(nbreg)
-    !local vars
-    INTEGER nid, ierr, nvarid
-    REAL rcode, auxreal
-    INTEGER start(4), count(4), status
-    !      local
-    CHARACTER*104 varname
-    CHARACTER*2 aux_2s
-    INTEGER i, j, ig
-    !$OMP MASTER
-    IF (is_mpi_root .AND. is_omp_root) THEN
-      ierr = nf90_open(trim(adjustl(filescaleparams)), nf90_nowrite, nid)
-      IF (ierr == nf90_noerr) THEN
-        DO i = 1, nbreg
-          WRITE(aux_2s, '(i2.2)') i
-          varname = trim(adjustl(paramname)) // aux_2s
-          print *, varname
-          ierr = nf90_inq_varid(nid, trim(adjustl(varname)), nvarid)
-          ierr = nf90_get_var(nid, nvarid, auxreal, [step_sca])
-          IF (ierr /= nf90_noerr) THEN
-            PRINT*, 'Pb de lecture pour modvalues'
-            print *, 'JE  scale_var, step_sca', trim(adjustl(varname)), step_sca
-            CALL HANDLE_ERR(ierr)
-            print *, 'error ierr= ', ierr
-            CALL exit(1)
-            CALL abort_gcm('read_scalenc', 'error reading variable', 1)
-          ENDIF
-
-          print *, auxreal
-          scale_param(i) = auxreal
-        enddo
-
-        ierr = nf90_close(nid)
-      else
-        print *, 'File ' // trim(adjustl(filescaleparams)) // ' not found'
-        print *, 'doing nothing...'
-      endif
-
-    ENDIF ! mpi_root
-    !$OMP END MASTER
-    !$OMP BARRIER
-    !      CALL scatter(var local _glo,var local) o algo asi
-    CALL bcast(scale_param)
-  END SUBROUTINE read_scalenc
-
-
-END MODULE
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/precuremission.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/precuremission.f90	(revision 5159)
+++ 	(revision )
@@ -1,266 +1,0 @@
-! Subroutine that calculates the emission of aerosols precursors
-SUBROUTINE precuremission(ftsol, u10m_ec, v10m_ec, &
-        pctsrf, u_seri, v_seri, paprs, pplay, cdragh, &
-        cdragm, t_seri, q_seri, tsol, fracso2emis, &
-        frach2sofso2, bateau, zdz, zalt, &
-        kminbc, kmaxbc, pdtphys, scale_param_bb, &
-        scale_param_ind, iregion_ind, iregion_bb, &
-        nbreg_ind, nbreg_bb, &
-        lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, &
-        lmt_so2ba, lmt_so2bb_l, lmt_so2bb_h, &
-        lmt_so2volc_cont, lmt_altvolc_cont, &
-        lmt_so2volc_expl, lmt_altvolc_expl, &
-        lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &
-        lmt_dms, id_prec, id_fine, &
-        flux_sparam_ind, flux_sparam_bb, &
-        source_tr, flux_tr, tr_seri)
-
-  USE dimphy
-  USE indice_sol_mod
-  USE infotrac
-  ! USE phytracr_spl_mod, ONLY: nbreg_dust, nbreg_ind, nbreg_bb
-  USE lmdz_yomcst
-
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
-  USE lmdz_paramet
-  IMPLICIT NONE
-
-
-  INCLUDE "chem.h"
-  INCLUDE "chem_spla.h"
-
-
-  !============================= INPUT ===================================
-  INTEGER :: kminbc, kmaxbc
-  REAL :: ftsol(klon, nbsrf)  ! temperature du sol par type
-  REAL :: tsol(klon)         ! temperature du sol moyenne
-  REAL :: t_seri(klon, klev)  ! temperature
-  REAL :: u_seri(klon, klev)  ! vent
-  REAL :: v_seri(klon, klev)  ! vent
-  REAL :: q_seri(klon, klev)  ! vapeur d eau kg/kg
-  REAL :: u10m_ec(klon), v10m_ec(klon)  ! vent a 10 metres
-  REAL :: pctsrf(klon, nbsrf)
-  REAL :: pdtphys  ! pas d'integration pour la physique (seconde)
-  REAL :: paprs(klon, klev + 1)  ! pression pour chaque inter-couche (en Pa)
-  REAL :: pplay(klon, klev)  ! pression pour le mileu de chaque couche (en Pa)
-  REAL :: cdragh(klon), cdragm(klon)
-  REAL :: fracso2emis        !--fraction so2 emis en so2
-  REAL :: frach2sofso2       !--fraction h2s from so2
-  REAL :: zdz(klon, klev)
-  LOGICAL :: edgar, bateau
-  INTEGER :: id_prec, id_fine
-
-  !------------------------- Scaling Parameters --------------------------
-
-  INTEGER :: nbreg_ind, nbreg_bb
-  INTEGER :: iregion_ind(klon)  !Defines regions for SO2, BC & OM
-  INTEGER :: iregion_bb(klon)  !Defines regions for SO2, BC & OM
-  REAL :: scale_param_bb(nbreg_bb)  !Scaling parameter for biomas burning
-  REAL :: scale_param_ind(nbreg_ind) !Scaling parameter for industrial emissions
-
-  !============================= OUTPUT ==================================
-
-  REAL :: source_tr(klon, nbtr)
-  REAL :: flux_tr(klon, nbtr)
-  REAL :: tr_seri(klon, klev, nbtr) ! traceur
-  REAL :: flux_sparam_ind(klon), flux_sparam_bb(klon)
-  !========================= LOCAL VARIABLES =============================
-  INTEGER :: i, k, kkk_cont(klon), kkk_expl(klon)
-  REAL :: zalt(klon, klev), zaltmid(klon, klev)
-  REAL :: zzdz
-  !------------------------- SULFUR emissions ----------------------------
-  REAL :: lmt_so2volc_cont(klon)  ! emissions so2 volcan (continuous)
-  REAL :: lmt_altvolc_cont(klon)  ! altitude  so2 volcan (continuous)
-  REAL :: lmt_so2volc_expl(klon)  ! emissions so2 volcan (explosive)
-  REAL :: lmt_altvolc_expl(klon)  ! altitude  so2 volcan (explosive)
-  REAL :: lmt_so2ff_l(klon)       ! emissions so2 fossil fuel (low)
-  REAL :: lmt_so2ff_h(klon)       ! emissions so2 fossil fuel (high)
-  REAL :: lmt_so2nff(klon)        ! emissions so2 non-fossil fuel
-  REAL :: lmt_so2bb_l(klon)       ! emissions de so2 biomass burning (low)
-  REAL :: lmt_so2bb_h(klon)       ! emissions de so2 biomass burning (high)
-  REAL :: lmt_so2ba(klon)         ! emissions de so2 bateau
-  REAL :: lmt_dms(klon)           ! emissions de dms
-  REAL :: lmt_dmsconc(klon)       ! concentration de dms oceanique
-  REAL :: lmt_dmsbio(klon)        ! emissions de dms bio
-  REAL :: lmt_h2sbio(klon)        ! emissions de h2s bio
-
-  EXTERNAL condsurfs, liss, nightingale
-  !=========================================================================
-  ! Modifications introduced by NHL
-  ! -Variables to save fluxes were introduced
-  ! -lmt_so2ba was multiplied by fracso2emis in line 117
-  ! -scale_param_bb was introduced in line 105
-  ! The last two modifications were errors existing in the original version
-  !=========================================================================
-  !=========================================================================
-  ! LOW LEVEL EMISSIONS
-  !=========================================================================
-
-  CALL nightingale(u_seri, v_seri, u10m_ec, v10m_ec, paprs, &
-          pplay, cdragh, cdragm, t_seri, q_seri, ftsol, &
-          tsol, pctsrf, lmt_dmsconc, lmt_dms)
-
-  IF (.NOT.bateau) THEN
-    DO i = 1, klon
-      lmt_so2ba(i) = 0.0
-    ENDDO
-  ENDIF
-
-  DO i = 1, klon
-    IF (iregion_ind(i)>0) THEN
-      IF(id_prec>0) source_tr(i, id_prec) = source_tr(i, id_prec) &
-              + fracso2emis &
-                      * scale_param_ind(iregion_ind(i)) * lmt_so2ff_l(i) * 1.e4 &
-              + scale_param_ind(iregion_ind(i)) * lmt_so2ff_l(i) * 1.e4 &
-                      * frach2sofso2            ! molec/m2/s
-
-      IF(id_fine>0) source_tr(i, id_fine) = &
-              source_tr(i, id_fine) + (1 - fracso2emis) &
-                      * scale_param_ind(iregion_ind(i)) * lmt_so2ff_l(i) &
-                      * 1.e4 * masse_ammsulfate / RNAVO  ! g/m2/s
-
-      IF(id_prec>0)   flux_tr(i, id_prec) = flux_tr(i, id_prec) + (&
-              scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
-                      lmt_so2ff_h(i)) &
-                      * frach2sofso2 &
-                      + scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
-                      lmt_so2ff_h(i)) &
-                      * fracso2emis &
-              ) * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
-
-      IF(id_fine>0)  flux_tr(i, id_fine) = &
-              flux_tr(i, id_fine) + (1 - fracso2emis) &
-                      * scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
-                      lmt_so2ff_h(i)) &
-                      * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
-
-      flux_sparam_ind(i) = flux_sparam_ind(i) + (1 - fracso2emis) &
-              * scale_param_ind(iregion_ind(i)) * (lmt_so2ff_l(i) + &
-              lmt_so2ff_h(i)) &
-              * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
-    ENDIF
-    IF (iregion_bb(i)>0) THEN
-      IF(id_prec>0) source_tr(i, id_prec) = &
-              source_tr(i, id_prec) + fracso2emis &
-                      * scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) &
-                      * (1. - pctsrf(i, is_oce)) * 1.e4
-
-      IF(id_fine>0)     source_tr(i, id_fine) = &
-              source_tr(i, id_fine) + (1 - fracso2emis) &
-                      * scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) * &
-                      (1. - pctsrf(i, is_oce)) * 1.e4 * &
-                      masse_ammsulfate / RNAVO  ! g/m2/s
-
-      IF(id_prec>0)     flux_tr(i, id_prec) = flux_tr(i, id_prec) + &
-              (scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) &
-                      + scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i)) &
-                      * (1. - pctsrf(i, is_oce)) * fracso2emis &
-                      * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
-
-      IF(id_fine>0) flux_tr(i, id_fine) = &
-              flux_tr(i, id_fine) + (1 - fracso2emis) &
-                      * (scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) &
-                              + scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i)) &
-                      * (1. - pctsrf(i, is_oce)) &
-                      * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
-
-      flux_sparam_bb(i) = &
-              scale_param_bb(iregion_bb(i)) * (lmt_so2bb_l(i) + &
-                      lmt_so2bb_h(i)) &
-                      * (1. - pctsrf(i, is_oce)) * fracso2emis &
-                      * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
-      flux_sparam_bb(i) = flux_sparam_bb(i) + (1 - fracso2emis) * &
-              (scale_param_bb(iregion_bb(i)) * lmt_so2bb_l(i) + &
-                      scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i)) &
-              * (1. - pctsrf(i, is_oce)) &
-              * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
-    ENDIF
-    IF(id_prec>0)   source_tr(i, id_prec) = source_tr(i, id_prec) &
-            + fracso2emis &
-                    * (lmt_so2ba(i) + lmt_so2nff(i)) * 1.e4 &
-            + (lmt_h2sbio(i) &
-                    + lmt_dms(i) + lmt_dmsbio(i)) * 1.e4            ! molec/m2/s
-
-    IF(id_fine>0)   source_tr(i, id_fine) = source_tr(i, id_fine) &
-            + (1 - fracso2emis) &
-                    * (lmt_so2ba(i) + lmt_so2nff(i)) * 1.e4 * &
-                    masse_ammsulfate / RNAVO  ! g/m2/s
-
-    IF(id_prec>0)   flux_tr(i, id_prec) = flux_tr(i, id_prec) &
-            + (lmt_h2sbio(i) &
-                    + lmt_so2volc_cont(i) + lmt_so2volc_expl(i) &
-                    + (lmt_so2ba(i) + lmt_so2nff(i)) * fracso2emis &
-                    + lmt_dms(i) + lmt_dmsbio(i)) &
-                    * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
-
-    IF(id_fine>0)   flux_tr(i, id_fine) = flux_tr(i, id_fine) &
-            + (1 - fracso2emis) &
-                    * (lmt_so2ba(i) + lmt_so2nff(i)) &
-                    * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
-
-    flux_sparam_ind(i) = flux_sparam_ind(i) + (1 - fracso2emis) &
-            * lmt_so2nff(i) &
-            * 1.e4 / RNAVO * masse_ammsulfate * 1.e3    ! mgS/m2/s
-
-  ENDDO
-
-  !========================================================================
-  ! HIGH LEVEL EMISSIONS
-  !========================================================================
-  !  Source de SO2 volcaniques
-  DO i = 1, klon
-    kkk_cont(i) = 1
-    kkk_expl(i) = 1
-  ENDDO
-  DO k = 1, klev - 1
-    DO i = 1, klon
-      zaltmid(i, k) = zalt(i, k) + zdz(i, k) / 2.
-      IF (zalt(i, k + 1)<lmt_altvolc_cont(i)) kkk_cont(i) = k + 1
-      IF (zalt(i, k + 1)<lmt_altvolc_expl(i)) kkk_expl(i) = k + 1
-    ENDDO
-  ENDDO
-  IF(id_prec>0) THEN
-    DO i = 1, klon
-      tr_seri(i, kkk_cont(i), id_prec) = tr_seri(i, kkk_cont(i), id_prec) + &
-              lmt_so2volc_cont(i) / zdz(i, kkk_cont(i)) / 100. * pdtphys
-      tr_seri(i, kkk_expl(i), id_prec) = tr_seri(i, kkk_expl(i), id_prec) + &
-              lmt_so2volc_expl(i) / zdz(i, kkk_expl(i)) / 100. * pdtphys
-    ENDDO
-  ENDIF
-  !  Sources hautes de SO2
-
-
-  !--only GEIA SO2 emissions has high emissions
-  !--unit: molec/cm2/s divided by layer height (in cm) multiplied by timestep
-
-  k = 2                             !introducing emissions in level 2
-  DO i = 1, klon
-
-    IF (iregion_bb(i)>0) THEN
-      IF(id_prec>0)   tr_seri(i, k, id_prec) = &
-              tr_seri(i, k, id_prec) + fracso2emis &
-                      * scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i) &
-                      / zdz(i, k) / 100. * pdtphys
-
-      IF(id_fine>0)     tr_seri(i, k, id_fine) = tr_seri(i, k, id_fine) &
-              + (1. - fracso2emis) &
-                      * scale_param_bb(iregion_bb(i)) * lmt_so2bb_h(i) &
-                      * masse_ammsulfate / RNAVO / zdz(i, k) / 100. * pdtphys   !g/cm3
-    ENDIF
-    IF (iregion_ind(i)>0) THEN
-      IF(id_prec>0)  tr_seri(i, k, id_prec) = &
-              tr_seri(i, k, id_prec) + (fracso2emis &
-                      * scale_param_ind(iregion_ind(i)) * lmt_so2ff_h(i) &
-                      + frach2sofso2 &
-                              * scale_param_ind(iregion_ind(i)) * lmt_so2ff_h(i)) &
-                      / zdz(i, k) / 100. * pdtphys
-
-      IF(id_fine>0)    tr_seri(i, k, id_fine) = tr_seri(i, k, id_fine) &
-              + (1. - fracso2emis) &
-                      * scale_param_ind(iregion_ind(i)) * lmt_so2ff_h(i) &
-                      * masse_ammsulfate / RNAVO / zdz(i, k) / 100. * pdtphys   !g/cm3
-    ENDIF
-
-  ENDDO
-
-END SUBROUTINE precuremission
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.f90	(revision 5159)
+++ 	(revision )
@@ -1,370 +1,0 @@
-! Routine to read the emissions of the different species
-
-SUBROUTINE read_newemissions(julien, jH_emi, edgar, flag_dms, &
-        debutphy, &
-        pdtphys, lafinphy, nbjour, pctsrf, &
-        t_seri, xlat, xlon, &
-        pmflxr, pmflxs, prfl, psfl, &
-        u10m_ec, v10m_ec, dust_ec, &
-        lmt_sea_salt, lmt_so2ff_l, &
-        lmt_so2ff_h, lmt_so2nff, lmt_so2ba, &
-        lmt_so2bb_l, lmt_so2bb_h, &
-        lmt_so2volc_cont, lmt_altvolc_cont, &
-        lmt_so2volc_expl, lmt_altvolc_expl, &
-        lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &
-        lmt_bcff, lmt_bcnff, lmt_bcbb_l, &
-        lmt_bcbb_h, lmt_bcba, lmt_omff, &
-        lmt_omnff, lmt_ombb_l, lmt_ombb_h, &
-        lmt_omnat, lmt_omba)
-
-  USE dimphy
-  USE indice_sol_mod
-  USE lmdz_grid_phy
-  USE lmdz_phys_para
-  USE lmdz_ssum_scopy, ONLY: scopy
-
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
-  USE lmdz_paramet
-  IMPLICIT NONE
-
-
-
-  INCLUDE 'chem.h'
-  INCLUDE 'chem_spla.h'
-
-  LOGICAL :: debutphy, lafinphy, edgar
-  INTEGER :: test_vent, test_day, step_vent, flag_dms, nbjour
-  INTEGER :: julien, i, iday
-  SAVE step_vent, test_vent, test_day, iday
-  !$OMP THREADPRIVATE(step_vent, test_vent, test_day, iday)
-  REAL :: pct_ocean(klon), pctsrf(klon, nbsrf)
-  REAL :: pdtphys  ! pas d'integration pour la physique (seconde)
-  REAL :: t_seri(klon, klev)  ! temperature
-
-  REAL :: xlat(klon)       ! latitudes pour chaque point
-  REAL :: xlon(klon)       ! longitudes pour chaque point
-
-
-  !   Emissions:
-  !   ---------
-
-  !---------------------------- SEA SALT & DUST emissions ------------------------
-  REAL :: lmt_sea_salt(klon, ss_bins) !Sea salt 0.03-8.0 um !NOT SAVED OK
-  REAL :: clyfac, avgdryrate, drying
-  ! je      REAL u10m_ec1(klon), v10m_ec1(klon), dust_ec1(klon)
-  ! je      REAL u10m_ec2(klon), v10m_ec2(klon), dust_ec2(klon)
-
-  REAL, SAVE, ALLOCATABLE :: u10m_ec1(:), v10m_ec1(:), dust_ec1(:)
-  REAL, SAVE, ALLOCATABLE :: u10m_ec2(:), v10m_ec2(:), dust_ec2(:)
-  !$OMP THREADPRIVATE(u10m_ec1, v10m_ec1, dust_ec1)
-  !$OMP THREADPRIVATE(u10m_ec2, v10m_ec2, dust_ec2)
-  ! as      REAL u10m_nc(iip1,jjp1), v10m_nc(iip1,jjp1)
-  REAL :: u10m_ec(klon), v10m_ec(klon), dust_ec(klon)
-  !      REAL cly(klon), wth(klon), zprecipinsoil(klon)
-  REAL, SAVE, ALLOCATABLE :: cly(:), wth(:), zprecipinsoil(:)
-  REAL :: cly_glo(klon_glo), wth_glo(klon_glo)
-  REAL :: zprecipinsoil_glo(klon_glo)
-  !$OMP THREADPRIVATE(cly,wth,zprecipinsoil)
-
-
-  ! je     SAVE u10m_ec2, v10m_ec2, dust_ec2
-  ! je      SAVE u10m_ec1, v10m_ec1, dust_ec1   ! Added on titane
-  ! je      SAVE cly, wth, zprecipinsoil        ! Added on titane
-  ! SAVE cly, wth, zprecipinsoil, u10m_ec2, v10m_ec2, dust_ec2
-  !------------------------- BLACK CARBON emissions ----------------------
-  REAL :: lmt_bcff(klon)       ! emissions de BC fossil fuels
-  REAL :: lmt_bcnff(klon)      ! emissions de BC non-fossil fuels
-  REAL :: lmt_bcbb_l(klon)     ! emissions de BC biomass basses
-  REAL :: lmt_bcbb_h(klon)     ! emissions de BC biomass hautes
-  REAL :: lmt_bcba(klon)       ! emissions de BC bateau
-  !------------------------ ORGANIC MATTER emissions ---------------------
-  REAL :: lmt_omff(klon)     ! emissions de OM fossil fuels
-  REAL :: lmt_omnff(klon)    ! emissions de OM non-fossil fuels
-  REAL :: lmt_ombb_l(klon)   ! emissions de OM biomass basses
-  REAL :: lmt_ombb_h(klon)   ! emissions de OM biomass hautes
-  REAL :: lmt_omnat(klon)    ! emissions de OM Natural
-  REAL :: lmt_omba(klon)     ! emissions de OM bateau
-  !------------------------- SULFUR emissions ----------------------------
-  REAL :: lmt_so2ff_l(klon)       ! emissions so2 fossil fuels (low)
-  REAL :: lmt_so2ff_h(klon)       ! emissions so2 fossil fuels (high)
-  REAL :: lmt_so2nff(klon)        ! emissions so2 non-fossil fuels
-  REAL :: lmt_so2bb_l(klon)       ! emissions de so2 biomass burning basse
-  REAL :: lmt_so2bb_h(klon)       ! emissions de so2 biomass burning hautes
-  REAL :: lmt_so2ba(klon)         ! emissions de so2 bateau
-  REAL :: lmt_so2volc_cont(klon)  ! emissions so2 volcan continuous
-  REAL :: lmt_altvolc_cont(klon)  ! altitude  so2 volcan continuous
-  REAL :: lmt_so2volc_expl(klon)  ! emissions so2 volcan explosive
-  REAL :: lmt_altvolc_expl(klon)  ! altitude  so2 volcan explosive
-  REAL :: lmt_dmsconc(klon)       ! concentration de dms oceanique
-  REAL :: lmt_dmsbio(klon)        ! emissions de dms bio
-  REAL :: lmt_h2sbio(klon)        ! emissions de h2s bio
-
-  REAL, SAVE, ALLOCATABLE :: lmt_dms(:)           ! emissions de dms
-  !$OMP THREADPRIVATE(lmt_dms)
-
-  !  Lessivage
-  !  ---------
-
-  REAL :: pmflxr(klon, klev + 1), pmflxs(klon, klev + 1) !--convection
-  REAL :: prfl(klon, klev + 1), psfl(klon, klev + 1)   !--large-scale
-  ! REAL pmflxr(klon,klev), pmflxs(klon,klev) !--convection
-  ! REAL prfl(klon,klev),   psfl(klon,klev)   !--large-scale
-
-  !  Variable interne
-  !  ----------------
-
-  INTEGER :: icount
-  REAL :: tau_1, tau_2
-  REAL :: max_flux, min_flux
-  INTRINSIC MIN, MAX
-
-  ! JE: Changes due to new pdtphys in new physics.
-  !  REAL windintime ! time in hours of the wind input files resolution
-  !  REAL dayemintime ! time in hours of the other emissions input files resolution
-  REAL :: jH_init ! shift in the hour (count as days) respecto to
-  ! realhour = (pdtphys*i)/3600/24 -days_elapsed
-  REAL :: jH_emi, jH_vent, jH_day
-  SAVE jH_init, jH_vent, jH_day
-  !$OMP THREADPRIVATE(jH_init,jH_vent,jH_day)
-  REAL, PARAMETER :: vent_resol = 6. ! resolution of winds in hours
-  REAL, PARAMETER :: day_resol = 24. ! resolution of daily emmis. in hours
-  ! INTEGER   test_day1
-  ! SAVE test_day1
-  ! REAL tau_1j,tau_2j
-  ! je
-  ! allocate if necessary
-  !
-
-  IF (.NOT. ALLOCATED(u10m_ec1)) ALLOCATE(u10m_ec1(klon))
-  IF (.NOT. ALLOCATED(v10m_ec1)) ALLOCATE(v10m_ec1(klon))
-  IF (.NOT. ALLOCATED(dust_ec1)) ALLOCATE(dust_ec1(klon))
-  IF (.NOT. ALLOCATED(u10m_ec2)) ALLOCATE(u10m_ec2(klon))
-  IF (.NOT. ALLOCATED(v10m_ec2)) ALLOCATE(v10m_ec2(klon))
-  IF (.NOT. ALLOCATED(dust_ec2)) ALLOCATE(dust_ec2(klon))
-  IF (.NOT. ALLOCATED(cly)) ALLOCATE(cly(klon))
-  IF (.NOT. ALLOCATED(wth)) ALLOCATE(wth(klon))
-  IF (.NOT. ALLOCATED(zprecipinsoil)) ALLOCATE(zprecipinsoil(klon))
-  IF (.NOT. ALLOCATED(lmt_dms)) ALLOCATE(lmt_dms(klon))
-  ! end je nov2013
-
-  !***********************************************************************
-  ! DUST EMISSIONS
-  !***********************************************************************
-
-  IF (debutphy) THEN
-    !---Fields are read only at the beginning of the period
-    !--reading wind and dust
-    iday = julien
-    step_vent = 1
-    test_vent = 0
-    test_day = 0
-    CALL read_vent(.TRUE., step_vent, nbjour, u10m_ec2, v10m_ec2)
-    print *, 'Read (debut) dust emissions: step_vent,julien,nbjour', &
-            step_vent, julien, nbjour
-    CALL read_dust(.TRUE., step_vent, nbjour, dust_ec2)
-    ! Threshold velocity map
-    !$OMP MASTER
-    IF (is_mpi_root .AND. is_omp_root) THEN
-      zprecipinsoil_glo(:) = 0.0
-      OPEN(51, file = 'wth.dat', status = 'unknown', form = 'formatted')
-      READ(51, '(G18.10)') (wth_glo(i), i = 1, klon_glo)
-      CLOSE(51)
-      ! Clay content
-      OPEN(52, file = 'cly.dat', status = 'unknown', form = 'formatted')
-      READ(52, '(G18.10)') (cly_glo(i), i = 1, klon_glo)
-      CLOSE(52)
-      OPEN(53, file = 'precipinsoil.dat', &
-              status = 'old', form = 'formatted', err = 999)
-      READ(53, '(G18.10)') (zprecipinsoil_glo(i), i = 1, klon_glo)
-      PRINT *, 'lecture precipinsoil.dat'
-      999   CONTINUE
-      CLOSE(53)
-    ENDIF
-    !$OMP END MASTER
-    !$OMP BARRIER
-    CALL scatter(wth_glo, wth)
-    CALL scatter(cly_glo, cly)
-    CALL scatter(zprecipinsoil_glo, zprecipinsoil)
-
-    !JE20140908<<        GOTO 1000
-    ! DO i=1, klon
-    !   zprecipinsoil(i)=0.0
-    ! ENDDO
-    ! 1000   CLOSE(53)
-    !JE20140908>>
-    jH_init = jH_emi
-    jH_vent = jH_emi
-    jH_day = jH_emi
-    ! test_day1=0
-    !JE end
-    !
-
-  ENDIF !--- debutphy
-
-  print *, 'READ_EMISSION: test_vent & test_day = ', test_vent, &
-          test_day
-  IF (test_vent==0) THEN    !--on lit toutes les 6 h
-    CALL SCOPY(klon, u10m_ec2, 1, u10m_ec1, 1)
-    CALL SCOPY(klon, v10m_ec2, 1, v10m_ec1, 1)
-    CALL SCOPY(klon, dust_ec2, 1, dust_ec1, 1)
-    step_vent = step_vent + 1
-    ! !PRINT *,'step_vent=', step_vent
-    CALL read_vent(.FALSE., step_vent, nbjour, u10m_ec2, v10m_ec2)
-    print *, 'Reading dust emissions: step_vent, julien, nbjour ', &
-            step_vent, julien, nbjour
-    ! !print *,'test_vent, julien = ',test_vent, julien
-    CALL read_dust(.FALSE., step_vent, nbjour, dust_ec2)
-
-  ENDIF !--test_vent
-
-  ! ubicacion original
-  !  test_vent=test_vent+1
-  !  IF (test_vent.EQ.(6*2)) test_vent=0 !on remet a zero ttes les 6 h
-
-  !JE      tau_2=FLOAT(test_vent)/12.
-  !JE      tau_1=1.-tau_2
-  tau_2 = (jH_vent - jH_init) * 24. / (vent_resol)
-  tau_1 = 1. - tau_2
-  ! PRINT*,'JEdec jHv,JHi,ventres',jH_vent,jH_init,vent_resol
-  ! PRINT*,'JEdec tau2,tau1',tau_2,tau_1
-  ! PRINT*,'JEdec step_vent',step_vent
-  DO i = 1, klon
-    ! PRINT*,'JE tau_2,tau_2j',tau_2,tau_2j
-    u10m_ec(i) = tau_1 * u10m_ec1(i) + tau_2 * u10m_ec2(i)
-    v10m_ec(i) = tau_1 * v10m_ec1(i) + tau_2 * v10m_ec2(i)
-    dust_ec(i) = tau_1 * dust_ec1(i) + tau_2 * dust_ec2(i)
-  ENDDO
-
-  !JE      IF (test_vent.EQ.(6*2)) THEN
-  !JE        PRINT *,'6 hrs interval reached'
-  !JE        print *,'day in read_emission, test_vent = ',julien, test_vent
-  !JE      ENDIF
-  !JE
-  !JE      test_vent=test_vent+1
-  !JE      IF (test_vent.EQ.(6*2)) test_vent=0 !on remet a zero ttes les 6 h
-  ! JE
-  jH_vent = jH_vent + pdtphys / (24. * 3600.)
-  test_vent = test_vent + 1
-  IF (jH_vent>(vent_resol) / 24.) THEN
-    test_vent = 0
-    jH_vent = jH_init
-  ENDIF
-  ! PRINT*,'JE test_vent,test_vent1,jH_vent ', test_vent,test_vent1
-  ! .     ,jH_vent
-  ! endJEi
-
-  avgdryrate = 300. / 365. * pdtphys / 86400.
-
-  DO i = 1, klon
-
-    IF (cly(i)<9990..AND.wth(i)<9990.) THEN
-      zprecipinsoil(i) = zprecipinsoil(i) + &
-              (pmflxr(i, 1) + pmflxs(i, 1) + prfl(i, 1) + psfl(i, 1)) * pdtphys
-
-      clyfac = MIN(16., cly(i) * 0.4 + 8.) ![mm] max amount of water hold in top soil
-      drying = avgdryrate * exp(0.03905491 * &
-              exp(0.17446 * (t_seri(i, 1) - 273.15))) ! [mm]
-      zprecipinsoil(i) = min(max(0., zprecipinsoil(i) - drying), clyfac) ! [mm]
-    ENDIF
-    ! zprecipinsoil(i)=0.0 ! Temporarely introduced to reproduce obelix result
-  ENDDO
-
-  ! print *,'cly = ',sum(cly),maxval(cly),minval(cly)
-  ! print *,'wth = ',sum(wth),maxval(wth),minval(wth)
-  ! print *,'t_seri = ',sum(t_seri),maxval(t_seri),minval(t_seri)
-  ! print *,'precipinsoil = ',sum(zprecipinsoil),maxval(zprecipinsoil)
-  ! .                      ,minval(zprecipinsoil)
-  icount = 0
-  DO i = 1, klon
-    IF (cly(i)>=9990..OR.wth(i)>=9990..OR. &
-            t_seri(i, 1)<=273.15.OR.zprecipinsoil(i)>1.e-8) THEN
-      dust_ec(i) = 0.0 ! commented out for test dustemtest
-      ! print *,'Dust emissions surpressed at grid = ',i
-      ! icount=icount+1
-    ENDIF
-  ENDDO
-
-  print *, 'Total N of grids with surpressed emission = ', icount
-  print *, 'dust_ec = ', SUM(dust_ec), MINVAL(dust_ec), &
-          MAXVAL(dust_ec)
-  !nhl Transitory scaling of desert dust emissions
-
-  !nhl      DO i=1, klon
-  !nhl         dust_ec(i)=dust_ec(i)/2.
-  !nhl      ENDDO
-
-  !-saving precipitation field to be read in next simulation
-
-  IF (lafinphy) THEN
-
-    CALL gather(zprecipinsoil, zprecipinsoil_glo)
-    !$OMP MASTER
-    IF (is_mpi_root .AND. is_omp_root) THEN
-
-      OPEN(53, file = 'newprecipinsoil.dat', &
-              status = 'unknown', form = 'formatted')
-      WRITE(53, '(G18.10)') (zprecipinsoil_glo(i), i = 1, klon_glo)
-      CLOSE(53)
-    ENDIF
-    !$OMP END MASTER
-    !$OMP BARRIER
-
-  ENDIF
-
-  !***********************************************************************
-  ! SEA SALT EMISSIONS
-  !***********************************************************************
-
-  DO i = 1, klon
-    pct_ocean(i) = pctsrf(i, is_oce)
-  ENDDO
-
-  print *, 'IS_OCE = ', is_oce
-  CALL seasalt(v10m_ec, u10m_ec, pct_ocean, lmt_sea_salt) !mgSeaSalt/cm2/s
-  ! print *,'SUM, MAX & MIN Sea Salt = ',SUM(lmt_sea_salt),
-  ! .               MAXVAL(lmt_sea_salt),MINVAL(lmt_sea_salt)
-
-  !***********************************************************************
-  ! SULFUR & CARBON EMISSIONS
-  !***********************************************************************
-  !
-
-  IF (test_day==0) THEN
-    print *, 'Computing SULFATE emissions for day : ', iday, julien, &
-            step_vent
-    CALL condsurfs_new(iday, edgar, flag_dms, &
-            lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, &
-            lmt_so2bb_l, lmt_so2bb_h, lmt_so2ba, &
-            lmt_so2volc_cont, lmt_altvolc_cont, &
-            lmt_so2volc_expl, lmt_altvolc_expl, &
-            lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc)
-    print *, 'Computing CARBON emissions for day : ', iday, julien, &
-            step_vent
-    CALL condsurfc_new(iday, &
-            lmt_bcff, lmt_bcnff, lmt_bcbb_l, lmt_bcbb_h, &
-            lmt_bcba, lmt_omff, lmt_omnff, lmt_ombb_l, &
-            lmt_ombb_h, lmt_omnat, lmt_omba)
-    print *, 'IDAY = ', iday
-    iday = iday + 1
-    print *, 'BCBB_L emissions :', SUM(lmt_bcbb_l), MAXVAL(lmt_bcbb_l) &
-            , MINVAL(lmt_bcbb_l)
-    print *, 'BCBB_H emissions :', SUM(lmt_bcbb_h), MAXVAL(lmt_bcbb_h) &
-            , MINVAL(lmt_bcbb_h)
-  ENDIF
-
-  !JE      test_day=test_day+1
-  !JE      IF (test_day.EQ.(24*2.)) THEN
-  !JE        test_day=0 !on remet a zero ttes les 24 h
-  !JE        print *,'LAST TIME STEP OF DAY ',julien
-  !JE      ENDIF
-
-  jH_day = jH_day + pdtphys / (24. * 3600.)
-  test_day = test_day + 1
-  IF (jH_day>(day_resol) / 24.) THEN
-    print *, 'LAST TIME STEP OF DAY ', julien
-    test_day = 0
-    jH_day = jH_init
-  ENDIF
-  ! PRINT*,'test_day,test_day1',test_day,test_day1
-
-END SUBROUTINE read_newemissions
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90	(revision 5160)
@@ -61,6 +61,6 @@
        IF (i==5) aux4s='latU'
        status = nf90_inq_varid (ncid, aux4s, rcode)
-!       print *,'stat,i',status,i,outcycle,aux4s
-!       print *,'ifclause',status.NE. nf90_noerr ,outcycle == .FALSE.
+!       PRINT *,'stat,i',status,i,outcycle,aux4s
+!       PRINT *,'ifclause',status.NE. nf90_noerr ,outcycle == .FALSE.
        IF ((.NOT.(status/= nf90_noerr) ).AND.( .NOT. outcycle )) THEN
          outcycle=.TRUE.
@@ -74,7 +74,7 @@
 
           status=nf90_get_var(ncid,varid,lats_glo,startj,endj)
-!      print *,latstr,varid,status,jjp1,rcode
+!      PRINT *,latstr,varid,status,jjp1,rcode
 !      IF (status .NE. nf90_noerr) PRINT*,'NOOOOOOO'
-!      print *,lats
+!      PRINT *,lats
 !stop
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.f90	(revision 5160)
@@ -54,8 +54,8 @@
 
 
-    ! print *,'beforebidcor u10m_nc', u10m_nc(1,jjp1)
-    ! print *,'beforebidcor v10m_nc', v10m_nc(1,jjp1)
+    ! PRINT *,'beforebidcor u10m_nc', u10m_nc(1,jjp1)
+    ! PRINT *,'beforebidcor v10m_nc', v10m_nc(1,jjp1)
 
-    !  print *,status
+    !  PRINT *,status
     ! CALL correctbid(iim,jjp1,u10m_nc)
     ! CALL correctbid(iim,jjp1,v10m_nc)
@@ -63,6 +63,6 @@
     CALL correctbid(nbp_lon, nbp_lat, v10m_nc_glo)
 
-    ! print *,'afterbidcor u10m_nc', u10m_nc(1,jjp1)
-    ! print *,'afterbidcor v10m_nc', v10m_nc(1,jjp1)
+    ! PRINT *,'afterbidcor u10m_nc', u10m_nc(1,jjp1)
+    ! PRINT *,'afterbidcor v10m_nc', v10m_nc(1,jjp1)
 
     !--upside down + physical grid
@@ -82,5 +82,5 @@
         v10m_ec_glo(ig) = v10m_nc_glo(i, nbp_lat + 1 - j)
         ig = ig + 1
-        ! print *,u10m_ec(ig) ,v10m_ec(ig)
+        ! PRINT *,u10m_ec(ig) ,v10m_ec(ig)
       ENDDO
     ENDDO
@@ -96,11 +96,11 @@
   CALL scatter(v10m_ec_glo, v10m_ec)
 
-  ! print *,'JE  tamagno viento ig= ', ig
-  ! print *,'READ_VENT U = ',SUM(u10m_ec),MINVAL(u10m_ec),
+  ! PRINT *,'JE  tamagno viento ig= ', ig
+  ! PRINT *,'READ_VENT U = ',SUM(u10m_ec),MINVAL(u10m_ec),
   ! .                                      MAXVAL(u10m_ec)
-  !  print *,'READ_VENT V = ',SUM(v10m_ec),MINVAL(v10m_ec),
+  !  PRINT *,'READ_VENT V = ',SUM(v10m_ec),MINVAL(v10m_ec),
   ! .                                      MAXVAL(v10m_ec)
-  !   print *,'u v 1 ', u10m_ec(1),v10m_ec(1)
-  !   print *,'u v klon ', u10m_ec(klon),v10m_ec(klon)
+  !   PRINT *,'u v 1 ', u10m_ec(1),v10m_ec(1)
+  !   PRINT *,'u v klon ', u10m_ec(klon),v10m_ec(klon)
 
 END SUBROUTINE read_vent
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/satellite_out_spla.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/satellite_out_spla.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/satellite_out_spla.F90	(revision 5160)
@@ -31,5 +31,5 @@
 !  DO i=1,klon
 !    IF ( masque_polder(i) .EQ. 1 ) THEN
-!        print *,'polder output point, lon:', rlon(i),', lat: ',rlat(i)
+!        PRINT *,'polder output point, lon:', rlon(i),', lat: ',rlat(i)
 !    ENDIF
 !  ENDDO
@@ -44,5 +44,5 @@
 !  DO i=1,klon
 !    IF ( masque_aqua(i) .EQ. 1 ) THEN
-!        print *,'aqua output point, lon:', rlon(i),', lat: ',rlat(i)
+!        PRINT *,'aqua output point, lon:', rlon(i),', lat: ',rlat(i)
 !    ENDIF
 !  ENDDO
@@ -56,5 +56,5 @@
 !  DO i=1,klon
 !    IF ( masque_terra(i) .EQ. 1 ) THEN
-!        print *,'terra output point, lon:', rlon(i),', lat: ',rlat(i)
+!        PRINT *,'terra output point, lon:', rlon(i),', lat: ',rlat(i)
 !    ENDIF
 !  ENDDO
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/seasalt.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/seasalt.f90	(revision 5159)
+++ 	(revision )
@@ -1,54 +1,0 @@
-! This SUBROUTINE estimateis Sea Salt emission fluxes over
-! Oceanic surfaces.
-
-SUBROUTINE seasalt(v_10m, u_10m, pct_ocean, lmt_sea_salt)
-
-  USE dimphy
-  USE lmdz_YOECUMF
-  USE lmdz_yomcst
-
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
-  IMPLICIT NONE
-  !
-
-  INCLUDE "chem.h"
-  INCLUDE "chem_spla.h"
-
-  INTEGER :: i, bin                 !local variables
-  REAL :: pct_ocean(klon)           !hfraction of Ocean in each grid
-  REAL :: v_10m(klon), u_10m(klon)  !V&H components of wind @10 m
-  REAL :: w_speed_10m(klon)         !wind speed at 10m from surface
-  REAL :: lmt_sea_salt(klon, ss_bins)!sea salt emission flux - mg/m2/s
-  REAL :: sea_salt_flux(ss_bins)    !sea salt emission flux per unit wind speed
-
-  REAL :: wind, ocean
-
-  !------Sea salt emission fluxes for each size bin calculated
-  !------based on on parameterisation of Gong et al. (1997).
-  !------Fluxes of sea salt for each size bin are given in mg/m^2/sec
-  !------at wind speed of 1 m/s at 10m height (at 80% RH).
-  !------Fluxes at various wind speeds (@10 m from sea
-  !------surfaces are estimated using relationship: F=flux*U_10^3.14
-
-  !nhl for size bin of 0.03-0.5 and 0.5-20
-  DATA sea_salt_flux/4.5E-09, 8.7E-7/
-
-  DO i = 1, klon
-    w_speed_10m(i) = (v_10m(i)**2.0 + u_10m(i)**2.0)**0.5
-  ENDDO
-
-  DO bin = 1, ss_bins
-    wind = 0.0
-    ocean = 0.0
-    DO i = 1, klon
-      lmt_sea_salt(i, bin) = sea_salt_flux(bin) * (w_speed_10m(i)**3.41) &
-              * pct_ocean(i) * 1.e-4 * 1.e-3                       !g/cm2/s
-      wind = wind + w_speed_10m(i)
-      ocean = ocean + pct_ocean(i)
-    ENDDO
-    ! print *,'Sea Salt flux = ',sea_salt_flux(bin)
-  ENDDO
-  ! print *,'SUM OF WIND = ',wind
-  ! print *,'SUM OF OCEAN SURFACE = ',ocean
-
-END SUBROUTINE seasalt
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.f90	(revision 5160)
@@ -12,10 +12,9 @@
   USE lmdz_YOECUMF
   USE lmdz_yomcst
-
-USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+
   IMPLICIT NONE
-  !
-
-  INCLUDE "chem.h"
 
   REAL :: RHcl(klon, klev)     ! humidite relative ciel clair
@@ -63,5 +62,4 @@
   DATA RH_tab/0., 10., 20., 30., 40., 50., 60., 70., 80., 85., 90., 95./
 
-
   DATA rho_ss/2160., 2160., 2160., 2160, 1451.6, 1367.9, &
           1302.9, 1243.2, 1182.7, 1149.5, 1111.6, 1063.1/
@@ -69,5 +67,4 @@
   DATA ss_growth_f/0.503, 0.503, 0.503, 0.503, 0.724, 0.782, &
           0.838, 0.905, 1.000, 1.072, 1.188, 1.447/
-
 
   mmd_ss = 12.7   !dia -um at 80% for bin 0.5-20 um but 90% of real mmd
@@ -117,6 +114,4 @@
   !--------- for Sea Salt -------------------
 
-
-
   IF(id_coss>0) THEN
     DO k = 1, klev
@@ -201,5 +196,4 @@
   !--------- For dust ------------------
 
-
   IF(id_codu>0) THEN
     DO k = 1, klev
@@ -220,5 +214,4 @@
         ENDIF
 
-
         v_dep_dust(i, k) = v_sed
         sed_flux(i, k) = tr_seri(i, k, id_codu) * v_sed !g/cm3.m/sec
@@ -268,5 +261,4 @@
   !--------- For scoarse  dust ------------------
 
-
   IF(id_scdu>0) THEN
     DO k = 1, klev
@@ -287,5 +279,4 @@
         ENDIF
 
-
         v_dep_dustsco(i, k) = v_sed
         sed_flux(i, k) = tr_seri(i, k, id_scdu) * v_sed !g/cm3.m/sec
@@ -320,6 +311,4 @@
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-
-
     DO i = 1, klon
       sed_dustsco(i) = sed_flux(i, 1) * 1.e6 * 1.e3    !--unit mg/m2/s
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/trconvect.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/trconvect.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/trconvect.f90	(revision 5160)
@@ -11,8 +11,10 @@
 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
   USE lmdz_paramet
+USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
   IMPLICIT NONE
 
 
-  INCLUDE "chem.h"
+
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/config_ocean_skin_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/config_ocean_skin_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/config_ocean_skin_m.F90	(revision 5160)
@@ -51,5 +51,5 @@
 #else
     WRITE(unit = *, nml = config_ocean_skin_nml)
-    print *, "Enter namelist config_ocean_skin_nml."
+    PRINT *, "Enter namelist config_ocean_skin_nml."
     read(unit = *, nml = config_ocean_skin_nml)
     WRITE(unit = *, nml = config_ocean_skin_nml)
@@ -74,5 +74,5 @@
        rain_effect = .TRUE.
     case default
-       print *, "config_ocean_skin: bad value for flag_ocean_skin."
+       PRINT *, "config_ocean_skin: bad value for flag_ocean_skin."
        stop 1
     end select
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5160)
@@ -134,5 +134,5 @@
     !--reading emission files
     CALL nf95_open(nc_fname, nf90_nowrite, ncid_in)
-    IF(flag_verbose_strataer) print *, "Open file ", nc_fname
+    IF(flag_verbose_strataer) PRINT *, "Open file ", nc_fname
     
     CALL nf95_inq_varid(ncid_in, "LEV", varid)
@@ -162,26 +162,26 @@
     CALL nf95_inq_varid(ncid_in, "OCS", varid)
     ncerr = nf90_get_var(ncid_in, varid, OCS_clim_in)
-    IF(flag_verbose_strataer) print *,'code erreur OCS=', ncerr, varid
+    IF(flag_verbose_strataer) PRINT *,'code erreur OCS=', ncerr, varid
 
     CALL nf95_inq_varid(ncid_in, "SO2", varid)
     ncerr = nf90_get_var(ncid_in, varid, SO2_clim_in)
-    IF(flag_verbose_strataer) print *,'code erreur SO2=', ncerr, varid
+    IF(flag_verbose_strataer) PRINT *,'code erreur SO2=', ncerr, varid
 
     CALL nf95_inq_varid(ncid_in, "OCS_LIFET", varid)
     ncerr = nf90_get_var(ncid_in, varid, OCS_lifetime_in)
-    IF(flag_verbose_strataer) print *,'code erreur OCS_lifetime_in=', ncerr, varid
+    IF(flag_verbose_strataer) PRINT *,'code erreur OCS_lifetime_in=', ncerr, varid
 
     CALL nf95_inq_varid(ncid_in, "SO2_LIFET", varid)
     ncerr = nf90_get_var(ncid_in, varid, SO2_lifetime_in)
-    IF(flag_verbose_strataer) print *,'code erreur SO2_lifetime_in=', ncerr, varid
+    IF(flag_verbose_strataer) PRINT *,'code erreur SO2_lifetime_in=', ncerr, varid
     
     IF(flag_newclim_file) THEN
        CALL nf95_inq_varid(ncid_in, "O3", varid)
        ncerr = nf90_get_var(ncid_in, varid, O3_clim_in)
-       IF(flag_verbose_strataer) print *,'code erreur O3=', ncerr, varid
+       IF(flag_verbose_strataer) PRINT *,'code erreur O3=', ncerr, varid
        
        CALL nf95_inq_varid(ncid_in, "H2SO4_LIFET", varid)
        ncerr = nf90_get_var(ncid_in, varid, H2SO4_lifetime_in)
-       IF(flag_verbose_strataer) print *,'code erreur H2SO4_lifetime_in=', ncerr, varid
+       IF(flag_verbose_strataer) PRINT *,'code erreur H2SO4_lifetime_in=', ncerr, varid
     ENDIF
     
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5160)
@@ -86,5 +86,5 @@
      IF (is_mpi_root.AND.is_omp_root) THEN
         
-        print *,'In stratH2O_methox read file: ch4r_annual_lmdz.nc'
+        PRINT *,'In stratH2O_methox read file: ch4r_annual_lmdz.nc'
         
         !--reading strat. H2O source (CH4 oxidation) files
@@ -111,5 +111,5 @@
         CALL nf95_inq_varid(ncid_in, "CH4RVMR", varid)
         ncerr = nf90_get_var(ncid_in, varid, CH4RVMR_in)
-        print *,'code erreur CH4RVMR=', ncerr, varid
+        PRINT *,'code erreur CH4RVMR=', ncerr, varid
         
         CALL nf95_close(ncid_in)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/add_phys_tend_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/add_phys_tend_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/add_phys_tend_mod.F90	(revision 5160)
@@ -198,9 +198,9 @@
     debug_level = 10
     IF (first) THEN
-      print *, "TestJLD rcpv, rcw, rcs", rcpv, rcw, rcs
+      PRINT *, "TestJLD rcpv, rcw, rcs", rcpv, rcw, rcs
       first = .FALSE.
     ENDIF
 
-    !  print *,'add_phys_tend: paprs ',paprs
+    !  PRINT *,'add_phys_tend: paprs ',paprs
     ! When in diagnostic mode, save initial values of out variables
     IF (diag_mode == 1) THEN
@@ -565,9 +565,9 @@
     debug_level = 10
     IF (first) THEN
-      print *, "TestJLD rcpv, rcw, rcs", rcpv, rcw, rcs
+      PRINT *, "TestJLD rcpv, rcw, rcs", rcpv, rcw, rcs
       first = .FALSE.
     ENDIF
 
-    !  print *,'add_phys_tend: paprs ',paprs
+    !  PRINT *,'add_phys_tend: paprs ',paprs
     !======================================================================
     ! Diagnostics for energy conservation tests
@@ -631,7 +631,7 @@
       d_ek_col(:) = (zek_col(:, 2) - zek_col(:, 1)) / phys_tstep
 
-      print *, 'zdu ', zdu
-      print *, 'zdv ', zdv
-      print *, 'd_ek_col, zek_col(2), zek_col(1) ', d_ek_col(1), zek_col(1, 2), zek_col(1, 1)
+      PRINT *, 'zdu ', zdu
+      PRINT *, 'zdv ', zdv
+      PRINT *, 'd_ek_col, zek_col(2), zek_col(1) ', d_ek_col(1), zek_col(1, 2), zek_col(1, 1)
 
       d_h_dair_col(:) = (zh_dair_col(:, 2) - zh_dair_col(:, 1)) / phys_tstep
@@ -753,5 +753,5 @@
     bilh_ok = 0
 
-    !!print *,'prt_level:',prt_level,' fl_ebil:',fl_ebil,' fl_cor_ebil:',fl_cor_ebil
+    !!PRINT *,'prt_level:',prt_level,' fl_ebil:',fl_ebil,' fl_cor_ebil:',fl_cor_ebil
     IF ((fl_ebil > 0) .AND. (klon == 1)) THEN
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_th.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_th.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_th.F90	(revision 5160)
@@ -160,5 +160,5 @@
                       proba_notrig(i)=proba_notrig(i)* &
                          (1.-exp(-strig(i)/s2(i)))**(n2(i)*dtime/tau_trig(i))
-                      !        print *, 'proba_notrig(i) ',proba_notrig(i)
+                      !        PRINT *, 'proba_notrig(i) ',proba_notrig(i)
                       IF (random_notrig(i) >= proba_notrig(i)) THEN
                          ale_bl_trig(i)=ale_bl_stat(i)
@@ -181,5 +181,5 @@
                       proba_notrig(i)=proba_notrig(i)* &
                          (1.-exp(-strig(i)/s2(i)))**(n2(i)*dtime/tau_trig(i))
-                      !        print *, 'proba_notrig(i) ',proba_notrig(i)
+                      !        PRINT *, 'proba_notrig(i) ',proba_notrig(i)
                       IF (random_notrig(i) >= proba_notrig(i)) THEN
                          ale_bl_trig(i)=Ale_bl(i)
@@ -329,5 +329,5 @@
                 endif
              enddo
-!    print *,'In order to run with iflag_coupl=2, you have to comment out the following stop '
+!    PRINT *,'In order to run with iflag_coupl=2, you have to comment out the following stop '
 !             STOP
              abort_message='In order to run with iflag_coupl=2, you have to comment out the following abort'
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_wk.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_wk.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_wk.F90	(revision 5160)
@@ -49,5 +49,5 @@
     ALLOCATE (cellrad(klon))
     !  Compute pseudo grid-cell radius cellrad, such that pi*cellrad^2=cell_area
-    print *, 'alpale_wk: cell_area(1) ', cell_area(1)
+    PRINT *, 'alpale_wk: cell_area(1) ', cell_area(1)
     cellrad(:) = sqrt(cell_area(:) / rpi)
     first = .FALSE.
@@ -55,5 +55,5 @@
 
   !  Compute wake radius
-  !!  print *,'alpale_wk: sigmaw(1), wdens(1) ', sigmaw(1), wdens(1)
+  !!  PRINT *,'alpale_wk: sigmaw(1), wdens(1) ', sigmaw(1), wdens(1)
   DO i = 1, klon
     IF (zoccur(i) >= 1) THEN
@@ -65,5 +65,5 @@
 
   !  Compute probability that the grid-cell is intersected by a gust front
-  !!  print *,'alpale_wk: wkrad(1), cellrad(1) ', wkrad(1), cellrad(1)
+  !!  PRINT *,'alpale_wk: wkrad(1), cellrad(1) ', wkrad(1), cellrad(1)
   !!  proba_gf(:) = exp(-wdens(:)*rpi*max(wkrad(:)-cellrad(:),0.)**2) - &   ! Formules
   !!                exp(-wdens(:)*rpi*(wkrad(:)+cellrad(:))**2)             ! fausses !
@@ -74,7 +74,7 @@
   !  Compute Fip conditionned on the presence of some gust front within the
   !  grid-cell
-  !!  print *,'alpale_wk: proba_gf(1), fip(1), ', proba_gf(1), fip(1)
+  !!  PRINT *,'alpale_wk: proba_gf(1), fip(1), ', proba_gf(1), fip(1)
   fip_cond(:) = fip(:) / proba_gf(:)
-  !!    print *,'alpale_wk: wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1) ', &
+  !!    PRINT *,'alpale_wk: wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1) ', &
   !!                        wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90	(revision 5160)
@@ -34,5 +34,5 @@
   time_radian=(time+15.)*2.*pi / year_len
 
-  IF (prt_level >= 1) print *, 'time_radian time', time_radian, time
+  IF (prt_level >= 1) PRINT *, 'time_radian time', time_radian, time
 
   lat(:)=180.*lat_radian(:)/pi !lat(:)=lat_radian(:)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_REGDYN.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_REGDYN.h	(revision 5159)
+++ 	(revision )
@@ -1,22 +1,0 @@
-
-! $Header$
-
-! calculs statistiques distribution nuage ftion du regime dynamique
-
-! Ce calcul doit etre fait a partir de valeurs mensuelles ??
-      CALL histo_o500_pctau(nbregdyn,pct_ocean,o500,fq_isccp, &
-     histoW,nhistoW)
-
-! nhistoWt = somme de toutes les nhistoW
-      DO nreg=1, nbregdyn
-       DO k = 1, kmaxm1
-        DO l = 1, lmaxm1
-         DO iw = 1, iwmax
-          nhistoWt(k,l,iw,nreg)=nhistoWt(k,l,iw,nreg)+&
-         nhistoW(k,l,iw,nreg)
-         ENDDO
-        ENDDO
-       ENDDO
-      ENDDO
-
-!IM 190504 END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calwake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calwake.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calwake.F90	(revision 5160)
@@ -106,5 +106,5 @@
 
   IF (prt_level >= 10) THEN
-    print *, '-> calwake, wake_s, awake_s, wgen input ', wake_s(1), awake_s(1), wgen(1)
+    PRINT *, '-> calwake, wake_s, awake_s, wgen input ', wake_s(1), awake_s(1), wgen(1)
   ENDIF
 
@@ -319,5 +319,5 @@
   !>jyg
   IF (prt_level >= 10) THEN
-    print *, 'calwake ->, wake_s, awake_s ', wake_s(1), awake_s(1)
+    PRINT *, 'calwake ->, wake_s, awake_s ', wake_s(1), awake_s(1)
   ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/chem.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/chem.h	(revision 5159)
+++ 	(revision )
@@ -1,14 +1,0 @@
-
-! $Header$
-
-      INTEGER idms, iso2, iso4, ih2s, idmso, imsa, ih2o2
-      PARAMETER (idms=1, iso2=2, iso4=3)
-      PARAMETER (ih2s=4, idmso=5, imsa=6, ih2o2=7)
-
-      REAL n_avogadro, masse_s, masse_so4, rho_water, rho_ice
-      PARAMETER (n_avogadro=6.02E23)                  !--molec mol-1
-      PARAMETER (masse_s=32.0)                        !--g mol-1
-      PARAMETER (masse_so4=96.0)                      !--g mol-1
-      PARAMETER (rho_water=1000.0)                    !--kg m-3
-      PARAMETER (rho_ice=500.0)                       !--kg m-3
-
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/convect3.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/convect3.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/convect3.F90	(revision 5160)
@@ -470,10 +470,10 @@
   buoy(icb) = buoybase
 
-  ! sb3d      print *,'buoybase,tvp_tv,tvpbase,tvbase,pbase,plcl'
+  ! sb3d      PRINT *,'buoybase,tvp_tv,tvpbase,tvbase,pbase,plcl'
   ! sb3d     $,        buoybase,tvp(icb)-tv(icb),tvpbase,tvbase,pbase,plcl
-  ! sb3d      print *,'TVP ',(tvp(i),i=1,nl)
-  ! sb3d      print *,'TV ',(tv(i),i=1,nl)
-  ! sb3d      print *, 'P ',(p(i),i=1,nl)
-  ! sb3d      print *,'ICB ',icb
+  ! sb3d      PRINT *,'TVP ',(tvp(i),i=1,nl)
+  ! sb3d      PRINT *,'TV ',(tv(i),i=1,nl)
+  ! sb3d      PRINT *, 'P ',(p(i),i=1,nl)
+  ! sb3d      PRINT *,'ICB ',icb
   ! test sb:
   ! @      WRITE(*,*) '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'
@@ -623,5 +623,5 @@
     dlnp = deltap / p(i - 1)
     ! jyg2
-    ! sb3d         print *,'buoy,dlnp,dcape,cape',buoy(i-1),dlnp,dcape,cape
+    ! sb3d         PRINT *,'buoy,dlnp,dcape,cape',buoy(i-1),dlnp,dcape,cape
     ! test sb:
     ! @       WRITE(*,*) '############################################'
@@ -640,5 +640,5 @@
       dtmin = amin1(dtmin, buoy(j))
     END DO
-    ! sb3d     print *, 'DTMIN, BETA, ALPHA, SIG = ',DTMIN,BETA,ALPHA,SIG(I)
+    ! sb3d     PRINT *, 'DTMIN, BETA, ALPHA, SIG = ',DTMIN,BETA,ALPHA,SIG(I)
     sig(i) = beta * sig(i) + alpha * dtmin * abs(dtmin)
     sig(i) = amax1(sig(i), 0.0)
@@ -668,10 +668,10 @@
   sig(icb - 1) = sig(icb)
   ! jyg1
-  ! sb3d      print *, 'Cloud base, c. top, CAPE',ICB,INB,cape
-  ! sb3d      print *, 'SIG ',(sig(i),i=1,inb)
-  ! sb3d      print *, 'W ',(w0(i),i=1,inb)
-  ! sb3d      print *, 'M ',(m(i), i=1,inb)
-  ! sb3d      print *, 'Dt1 ',(tvp(i)-tv(i),i=1,inb)
-  ! sb3d      print *, 'Dt_vrai ',(buoy(i),i=1,inb)
+  ! sb3d      PRINT *, 'Cloud base, c. top, CAPE',ICB,INB,cape
+  ! sb3d      PRINT *, 'SIG ',(sig(i),i=1,inb)
+  ! sb3d      PRINT *, 'W ',(w0(i),i=1,inb)
+  ! sb3d      PRINT *, 'M ',(m(i), i=1,inb)
+  ! sb3d      PRINT *, 'Dt1 ',(tvp(i)-tv(i),i=1,inb)
+  ! sb3d      PRINT *, 'Dt_vrai ',(buoy(i),i=1,inb)
   ! jyg2
 
@@ -910,5 +910,5 @@
     pr2 = max(0., min(1., pr2))
     sigt = sigp(i) * pr1 + pr2
-    ! sb3d         print *,'i,sigt,pr1,pr2', i,sigt,pr1,pr2
+    ! sb3d         PRINT *,'i,sigt,pr1,pr2', i,sigt,pr1,pr2
     ! jyg2
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/array_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/array_lib.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/array_lib.F90	(revision 5160)
@@ -144,5 +144,5 @@
     iloc = infind(xsort,xxarr(i),dist=d)
     if (d > tol) then
-      print *, 'interpolation error'
+      PRINT *, 'interpolation error'
       stop
     endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/atmos_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/atmos_lib.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/atmos_lib.F90	(revision 5160)
@@ -128,5 +128,5 @@
          
   case default
-    print *, 'Must enter a profile type'
+    PRINT *, 'Must enter a profile type'
     stop
     
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90	(revision 5160)
@@ -97,5 +97,5 @@
         vu = (1/(0.2714 + 0.00057145*Np*rho_a*1E-6))**2 ! units of Nt = Np*rhoa = #/cm^3
     else
-        print *, 'Error: Must specify a value for Np in each volume', &
+        PRINT *, 'Error: Must specify a value for Np in each volume', &
              ' with Morrison/Martin Scheme.'
             stop    
@@ -111,5 +111,5 @@
       ! vu isn't specified
       
-      print *, 'Error: Must specify a value for vu for Modified Gamma distribution'
+      PRINT *, 'Error: Must specify a value for vu for Modified Gamma distribution'
       stop    
       
@@ -130,5 +130,5 @@
                 local_Np = p1 ! total number concentration / pa --- units kg^-1
             else
-            print *, 'Error: Must specify Np or default value ', &
+            PRINT *, 'Error: Must specify Np or default value ', &
                  '(p1=Dm [um] or p2=Np [1/kg]) for ', &
                  'Modified Gamma distribution'
@@ -169,5 +169,5 @@
     else
     
-    print *, 'Error: Must specify Np or default value ', &
+    PRINT *, 'Error: Must specify Np or default value ', &
          '(p1=No or p2=lambda) for Exponential distribution'
         stop
@@ -191,5 +191,5 @@
     if(Np>0) then
     
-        print *, 'Variable Np not supported for ', &
+        PRINT *, 'Variable Np not supported for ', &
          'Power Law distribution'
         stop
@@ -205,5 +205,5 @@
     
         if(Np>0) then
-        print *, 'Variable Np not supported for ', &
+        PRINT *, 'Variable Np not supported for ', &
          'Monodispersed distribution'
         stop
@@ -225,5 +225,5 @@
             log_sigma_g = local_p3 
         else
-            print *, 'Error: Must specify a value for sigma_g ', &
+            PRINT *, 'Error: Must specify a value for sigma_g ', &
              'when using a Log-Normal distribution'
             stop
@@ -244,5 +244,5 @@
                 local_Np=p1
             else
-                print *, 'Error: Must specify Np or default value ', &
+                PRINT *, 'Error: Must specify Np or default value ', &
                  '(p2=Rg or p1=Np) for Log-Normal distribution'
             endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_read_otputkeys.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_read_otputkeys.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_read_otputkeys.F90	(revision 5160)
@@ -649,6 +649,6 @@
     
   if (i /= N_OUT_LIST) then
-     print *, 'COSP_IO: wrong number of output diagnostics'
-     print *, i,N_OUT_LIST
+     PRINT *, 'COSP_IO: wrong number of output diagnostics'
+     PRINT *, i,N_OUT_LIST
      stop
   endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90	(revision 5160)
@@ -127,5 +127,5 @@
         vu = (1/(0.2714 + 0.00057145*Np*rho_a*1E-6))**2.0 ! units of Nt = Np*rhoa = #/cm^3
     else
-        print *, 'Error: Must specify a value for Np in each volume', &
+        PRINT *, 'Error: Must specify a value for Np in each volume', &
              ' with Morrison/Martin Scheme.'
             stop    
@@ -141,5 +141,5 @@
       ! vu isn't specified
       
-      print *, 'Error: Must specify a value for vu for Modified Gamma distribution'
+      PRINT *, 'Error: Must specify a value for vu for Modified Gamma distribution'
       stop    
       
@@ -185,5 +185,5 @@
       else
       
-        print *, 'Error:  No default value for Dm or Np provided!  '
+        PRINT *, 'Error:  No default value for Dm or Np provided!  '
         stop
         
@@ -255,9 +255,9 @@
   
     if(Re>0) then
-        print *, 'Variable Re not supported for ', &
+        PRINT *, 'Variable Re not supported for ', &
          'Power-Law distribution'
     stop
     elseif(Np>0) then
-        print *, 'Variable Np not supported for ', &
+        PRINT *, 'Variable Np not supported for ', &
          'Power-Law distribution'
     stop
@@ -319,5 +319,5 @@
       enddo
 
-    ! print *,'test=',ahp,bhp,ahp/(rho_a*Q),D(100),N(100),bpm,dmin_mm,dmax_mm
+    ! PRINT *,'test=',ahp,bhp,ahp/(rho_a*Q),D(100),N(100),bpm,dmin_mm,dmax_mm
 
 ! ---------------------------------------------------------!
@@ -388,5 +388,5 @@
     else
 
-      print *, 'Error: Must specify a value for sigma_g'
+      PRINT *, 'Error: Must specify a value for sigma_g'
       stop
     
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/lidar_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/lidar_simulator.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/lidar_simulator.F90	(revision 5160)
@@ -248,5 +248,5 @@
 
       if ( npart .ne. 4 ) then
-        print *,'Error in lidar_simulator, npart should be 4, not',npart
+        PRINT *,'Error in lidar_simulator, npart should be 4, not',npart
         stop
       endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/math_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/math_lib.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/math_lib.F90	(revision 5160)
@@ -152,5 +152,5 @@
     path_integral = sumo
   endif 
-  ! print *, sumo
+  ! PRINT *, sumo
 
   return
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90	(revision 5160)
@@ -141,9 +141,9 @@
   if ((.not. gbx%use_reff) .and. (reff_zero)) then ! No Reff in radar. Default in lidar
         gbx%Reff = DEFAULT_LIDAR_REFF
-        print *, '---------- COSP WARNING ------------'
-        print *, ''
-        print *, 'Using default Reff in lidar simulations'
-        print *, ''
-        print *, '----------------------------------'
+        PRINT *, '---------- COSP WARNING ------------'
+        PRINT *, ''
+        PRINT *, 'Using default Reff in lidar simulations'
+        PRINT *, ''
+        PRINT *, '----------------------------------'
   endif
   
@@ -153,19 +153,19 @@
   if (Ncolumns == 1) then
      if (gbx%use_precipitation_fluxes) then
-        print *, '---------- COSP ERROR ------------'
-        print *, ''
-        print *, 'Use of precipitation fluxes not supported in CRM mode (Ncolumns=1)'
-        print *, ''
-        print *, '----------------------------------'
+        PRINT *, '---------- COSP ERROR ------------'
+        PRINT *, ''
+        PRINT *, 'Use of precipitation fluxes not supported in CRM mode (Ncolumns=1)'
+        PRINT *, ''
+        PRINT *, '----------------------------------'
         stop
      endif
      if ((maxval(gbx%dtau_c) > 0.0).or.(maxval(gbx%dem_c) > 0.0)) then
-        print *, '---------- COSP ERROR ------------'
-        print *, ''
-        print *, ' dtau_c > 0.0 or dem_c > 0.0. In CRM mode (Ncolumns=1), '
-        print *, ' the optical depth (emmisivity) of all clouds must be '
-        print *, ' passed through dtau_s (dem_s)'
-        print *, ''
-        print *, '----------------------------------'
+        PRINT *, '---------- COSP ERROR ------------'
+        PRINT *, ''
+        PRINT *, ' dtau_c > 0.0 or dem_c > 0.0. In CRM mode (Ncolumns=1), '
+        PRINT *, ' the optical depth (emmisivity) of all clouds must be '
+        PRINT *, ' passed through dtau_s (dem_s)'
+        PRINT *, ''
+        PRINT *, '----------------------------------'
         stop
      endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_simulator.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_simulator.F90	(revision 5160)
@@ -90,5 +90,5 @@
 !   enddo
 !   enddo
-!  if (inconsistent)  print *, '%%%% COSP_SIMULATOR: inconsistency in mr_hydro and Reff'
+!  if (inconsistent)  PRINT *, '%%%% COSP_SIMULATOR: inconsistency in mr_hydro and Reff'
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_types.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_types.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_types.F90	(revision 5160)
@@ -1400,22 +1400,22 @@
     type(cosp_gridbox),intent(in) :: x
 
-    print *, '%%%%----- Information on COSP_GRIDBOX ------'
+    PRINT *, '%%%%----- Information on COSP_GRIDBOX ------'
     ! Scalars and dimensions
-    print *,  x%Npoints
-    print *,  x%Nlevels
-    print *,  x%Ncolumns
-    print *,  x%Nhydro
-    print *,  x%Nprmts_max_hydro
-    print *,  x%Naero
-    print *,  x%Nprmts_max_aero
-    print *,  x%Npoints_it
+    PRINT *,  x%Npoints
+    PRINT *,  x%Nlevels
+    PRINT *,  x%Ncolumns
+    PRINT *,  x%Nhydro
+    PRINT *,  x%Nprmts_max_hydro
+    PRINT *,  x%Naero
+    PRINT *,  x%Nprmts_max_aero
+    PRINT *,  x%Npoints_it
     
     ! Time [days]
-    print *,  x%time
+    PRINT *,  x%time
     
     ! Radar ancillary info
-    print *,  x%radar_freq, &
+    PRINT *,  x%radar_freq, &
             x%k2
-    print *,  x%surface_radar, &
+    PRINT *,  x%surface_radar, &
               x%use_mie_tables, &
               x%use_gas_abs, &
@@ -1423,77 +1423,77 @@
               x%melt_lay
 
-!               print *,  'shape(x%): ',shape(x%)
+!               PRINT *,  'shape(x%): ',shape(x%)
  
 !     type(class_param) ::  hp  ! structure used by radar simulator to store Ze and N scaling constants and other information
 !     type(mie)::  mt           ! structure used by radar simulator to store mie LUT information
-    print *,  x%nsizes
+    PRINT *,  x%nsizes
     
     ! Lidar
-    print *,  x%lidar_ice_type
+    PRINT *,  x%lidar_ice_type
     
     ! Radar
-    print *,  x%use_precipitation_fluxes
-    print *,  x%use_reff
+    PRINT *,  x%use_precipitation_fluxes
+    PRINT *,  x%use_reff
     
     ! Geolocation (Npoints)
-    print *,  'shape(x%longitude): ',shape(x%longitude)
-    print *,  'shape(x%latitude): ',shape(x%latitude)
+    PRINT *,  'shape(x%longitude): ',shape(x%longitude)
+    PRINT *,  'shape(x%latitude): ',shape(x%latitude)
     ! Gridbox information (Npoints,Nlevels)
-    print *,  'shape(x%zlev): ',shape(x%zlev)
-    print *,  'shape(x%zlev_half): ',shape(x%zlev_half)
-    print *,  'shape(x%dlev): ',shape(x%dlev)
-    print *,  'shape(x%p): ',shape(x%p)
-    print *,  'shape(x%ph): ',shape(x%ph)
-    print *,  'shape(x%T): ',shape(x%T)
-    print *,  'shape(x%q): ',shape(x%q)
-    print *,  'shape(x%sh): ',shape(x%sh)
-    print *,  'shape(x%dtau_s): ',shape(x%dtau_s)
-    print *,  'shape(x%dtau_c): ',shape(x%dtau_c)
-    print *,  'shape(x%dem_s): ',shape(x%dem_s)
-    print *,  'shape(x%dem_c): ',shape(x%dem_c)
-    print *,  'shape(x%mr_ozone): ',shape(x%mr_ozone)
+    PRINT *,  'shape(x%zlev): ',shape(x%zlev)
+    PRINT *,  'shape(x%zlev_half): ',shape(x%zlev_half)
+    PRINT *,  'shape(x%dlev): ',shape(x%dlev)
+    PRINT *,  'shape(x%p): ',shape(x%p)
+    PRINT *,  'shape(x%ph): ',shape(x%ph)
+    PRINT *,  'shape(x%T): ',shape(x%T)
+    PRINT *,  'shape(x%q): ',shape(x%q)
+    PRINT *,  'shape(x%sh): ',shape(x%sh)
+    PRINT *,  'shape(x%dtau_s): ',shape(x%dtau_s)
+    PRINT *,  'shape(x%dtau_c): ',shape(x%dtau_c)
+    PRINT *,  'shape(x%dem_s): ',shape(x%dem_s)
+    PRINT *,  'shape(x%dem_c): ',shape(x%dem_c)
+    PRINT *,  'shape(x%mr_ozone): ',shape(x%mr_ozone)
 
     ! Point information (Npoints)
-    print *,  'shape(x%land): ',shape(x%land)
-    print *,  'shape(x%psfc): ',shape(x%psfc)
-    print *,  'shape(x%sunlit): ',shape(x%sunlit)
-    print *,  'shape(x%skt): ',shape(x%skt)
-    print *,  'shape(x%u_wind): ',shape(x%u_wind)
-    print *,  'shape(x%v_wind): ',shape(x%v_wind)
+    PRINT *,  'shape(x%land): ',shape(x%land)
+    PRINT *,  'shape(x%psfc): ',shape(x%psfc)
+    PRINT *,  'shape(x%sunlit): ',shape(x%sunlit)
+    PRINT *,  'shape(x%skt): ',shape(x%skt)
+    PRINT *,  'shape(x%u_wind): ',shape(x%u_wind)
+    PRINT *,  'shape(x%v_wind): ',shape(x%v_wind)
 
     ! TOTAL and CONV cloud fraction for SCOPS
-    print *,  'shape(x%tca): ',shape(x%tca)
-    print *,  'shape(x%cca): ',shape(x%cca)
+    PRINT *,  'shape(x%tca): ',shape(x%tca)
+    PRINT *,  'shape(x%cca): ',shape(x%cca)
     ! Precipitation fluxes on model levels
-    print *,  'shape(x%rain_ls): ',shape(x%rain_ls)
-    print *,  'shape(x%rain_cv): ',shape(x%rain_cv)
-    print *,  'shape(x%snow_ls): ',shape(x%snow_ls)
-    print *,  'shape(x%snow_cv): ',shape(x%snow_cv)
-    print *,  'shape(x%grpl_ls): ',shape(x%grpl_ls)
+    PRINT *,  'shape(x%rain_ls): ',shape(x%rain_ls)
+    PRINT *,  'shape(x%rain_cv): ',shape(x%rain_cv)
+    PRINT *,  'shape(x%snow_ls): ',shape(x%snow_ls)
+    PRINT *,  'shape(x%snow_cv): ',shape(x%snow_cv)
+    PRINT *,  'shape(x%grpl_ls): ',shape(x%grpl_ls)
     ! Hydrometeors concentration and distribution parameters
-    print *,  'shape(x%mr_hydro): ',shape(x%mr_hydro)
-    print *,  'shape(x%dist_prmts_hydro): ',shape(x%dist_prmts_hydro)
+    PRINT *,  'shape(x%mr_hydro): ',shape(x%mr_hydro)
+    PRINT *,  'shape(x%dist_prmts_hydro): ',shape(x%dist_prmts_hydro)
     ! Effective radius [m]. (Npoints,Nlevels,Nhydro)
-    print *,  'shape(x%Reff): ',shape(x%Reff)
-    print *,  'shape(x%Np): ',shape(x%Np)       ! added by roj with Quickbeam V3
+    PRINT *,  'shape(x%Reff): ',shape(x%Reff)
+    PRINT *,  'shape(x%Np): ',shape(x%Np)       ! added by roj with Quickbeam V3
     ! Aerosols concentration and distribution parameters
-    print *,  'shape(x%conc_aero): ',shape(x%conc_aero)
-    print *,  'shape(x%dist_type_aero): ',shape(x%dist_type_aero)
-    print *,  'shape(x%dist_prmts_aero): ',shape(x%dist_prmts_aero)
+    PRINT *,  'shape(x%conc_aero): ',shape(x%conc_aero)
+    PRINT *,  'shape(x%dist_type_aero): ',shape(x%dist_type_aero)
+    PRINT *,  'shape(x%dist_prmts_aero): ',shape(x%dist_prmts_aero)
     ! ISCCP simulator inputs
-    print *, x%isccp_top_height
-    print *, x%isccp_top_height_direction
-    print *, x%isccp_overlap
-    print *, x%isccp_emsfc_lw
+    PRINT *, x%isccp_top_height
+    PRINT *, x%isccp_top_height_direction
+    PRINT *, x%isccp_overlap
+    PRINT *, x%isccp_emsfc_lw
   
     ! RTTOV inputs/options
-    print *, x%plat
-    print *, x%sat
-    print *, x%inst
-    print *, x%Nchan
-    print *,  'shape(x%Ichan): ',x%Ichan
-    print *,  'shape(x%Surfem): ',x%Surfem
-    print *, x%ZenAng
-    print *, x%co2,x%ch4,x%n2o,x%co
+    PRINT *, x%plat
+    PRINT *, x%sat
+    PRINT *, x%inst
+    PRINT *, x%Nchan
+    PRINT *,  'shape(x%Ichan): ',x%Ichan
+    PRINT *,  'shape(x%Surfem): ',x%Surfem
+    PRINT *, x%ZenAng
+    PRINT *, x%co2,x%ch4,x%n2o,x%co
                 
 END SUBROUTINE COSP_GRIDBOX_PRINT
@@ -1502,20 +1502,20 @@
     type(cosp_misr),intent(in) :: x
 
-    print *, '%%%%----- Information on COSP_MISR ------'
+    PRINT *, '%%%%----- Information on COSP_MISR ------'
                 
      ! Dimensions
-    print *, x%Npoints
-    print *, x%Ntau
-    print *, x%Nlevels
+    PRINT *, x%Npoints
+    PRINT *, x%Ntau
+    PRINT *, x%Nlevels
 
      ! --- (npoints,ntau,nlevels)
      !  the fraction of the model grid box covered by each of the MISR cloud types
-     print *,  'shape(x%fq_MISR): ',shape(x%fq_MISR)
+     PRINT *,  'shape(x%fq_MISR): ',shape(x%fq_MISR)
      
      ! --- (npoints)
-     print *,  'shape(x%MISR_meanztop): ',shape(x%MISR_meanztop)
-     print *,  'shape(x%MISR_cldarea): ',shape(x%MISR_cldarea)
+     PRINT *,  'shape(x%MISR_meanztop): ',shape(x%MISR_meanztop)
+     PRINT *,  'shape(x%MISR_cldarea): ',shape(x%MISR_cldarea)
      ! --- (npoints,nlevels)
-     print *,  'shape(x%MISR_dist_model_layertops): ',shape(x%MISR_dist_model_layertops)
+     PRINT *,  'shape(x%MISR_dist_model_layertops): ',shape(x%MISR_dist_model_layertops)
     
 END SUBROUTINE COSP_MISR_PRINT
@@ -1524,20 +1524,20 @@
     type(cosp_isccp),intent(in) :: x
             
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-
-    print *, '%%%%----- Information on COSP_ISCCP ------'
-    
-     print *, 'shape(x%fq_isccp): ',shape(x%fq_isccp)
-     print *, 'shape(x%totalcldarea): ',shape(x%totalcldarea)
-     print *, 'shape(x%meantb): ',shape(x%meantb)
-     print *, 'shape(x%meantbclr): ',shape(x%meantbclr)
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+
+    PRINT *, '%%%%----- Information on COSP_ISCCP ------'
+    
+     PRINT *, 'shape(x%fq_isccp): ',shape(x%fq_isccp)
+     PRINT *, 'shape(x%totalcldarea): ',shape(x%totalcldarea)
+     PRINT *, 'shape(x%meantb): ',shape(x%meantb)
+     PRINT *, 'shape(x%meantbclr): ',shape(x%meantbclr)
      
-     print *, 'shape(x%meanptop): ',shape(x%meanptop)
-     print *, 'shape(x%meantaucld): ',shape(x%meantaucld)
-     print *, 'shape(x%meanalbedocld): ',shape(x%meanalbedocld)
-     print *, 'shape(x%boxtau): ',shape(x%boxtau)
-     print *, 'shape(x%boxptop): ',shape(x%boxptop)
+     PRINT *, 'shape(x%meanptop): ',shape(x%meanptop)
+     PRINT *, 'shape(x%meantaucld): ',shape(x%meantaucld)
+     PRINT *, 'shape(x%meanalbedocld): ',shape(x%meanalbedocld)
+     PRINT *, 'shape(x%boxtau): ',shape(x%boxtau)
+     PRINT *, 'shape(x%boxptop): ',shape(x%boxptop)
 END SUBROUTINE COSP_ISCCP_PRINT
 
@@ -1545,19 +1545,19 @@
     type(cosp_vgrid),intent(in) :: x
             
-    print *, '%%%%----- Information on COSP_VGRID ------'
-    print *, x%use_vgrid
-    print *, x%csat_vgrid
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-    print *, x%Nlvgrid
+    PRINT *, '%%%%----- Information on COSP_VGRID ------'
+    PRINT *, x%use_vgrid
+    PRINT *, x%csat_vgrid
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+    PRINT *, x%Nlvgrid
     ! Array with dimensions (Nlvgrid)
-    print *, 'shape(x%z): ',shape(x%z)
-    print *, 'shape(x%zl): ',shape(x%zl)
-    print *, 'shape(x%zu): ',shape(x%zu)
+    PRINT *, 'shape(x%z): ',shape(x%z)
+    PRINT *, 'shape(x%zl): ',shape(x%zl)
+    PRINT *, 'shape(x%zu): ',shape(x%zu)
     ! Array with dimensions (Nlevels)
-    print *, 'shape(x%mz): ',shape(x%mz)
-    print *, 'shape(x%mzl): ',shape(x%mzl)
-    print *, 'shape(x%mzu): ',shape(x%mzu)
+    PRINT *, 'shape(x%mz): ',shape(x%mz)
+    PRINT *, 'shape(x%mzl): ',shape(x%mzl)
+    PRINT *, 'shape(x%mzu): ',shape(x%mzu)
 END SUBROUTINE COSP_VGRID_PRINT
 
@@ -1565,18 +1565,18 @@
     type(cosp_sglidar),intent(in) :: x
             
-    print *, '%%%%----- Information on COSP_SGLIDAR ------'
+    PRINT *, '%%%%----- Information on COSP_SGLIDAR ------'
     ! Dimensions
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-    print *, x%Nhydro
-    print *, x%Nrefl
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+    PRINT *, x%Nhydro
+    PRINT *, x%Nrefl
     ! Arrays with dimensions (Npoints,Nlevels)
-    print *, 'shape(x%beta_mol): ',shape(x%beta_mol)
+    PRINT *, 'shape(x%beta_mol): ',shape(x%beta_mol)
     ! Arrays with dimensions (Npoints,Ncolumns,Nlevels)
-    print *, 'shape(x%beta_tot): ',shape(x%beta_tot)
-    print *, 'shape(x%tau_tot): ',shape(x%tau_tot)
+    PRINT *, 'shape(x%beta_tot): ',shape(x%beta_tot)
+    PRINT *, 'shape(x%tau_tot): ',shape(x%tau_tot)
     ! Arrays with dimensions (Npoints,Ncolumns,Nrefl)
-    print *, 'shape(x%refl): ',shape(x%refl)
+    PRINT *, 'shape(x%refl): ',shape(x%refl)
 END SUBROUTINE COSP_SGLIDAR_PRINT
 
@@ -1584,14 +1584,14 @@
     type(cosp_sgradar),intent(in) :: x
             
-    print *, '%%%%----- Information on COSP_SGRADAR ------'
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-    print *, x%Nhydro
+    PRINT *, '%%%%----- Information on COSP_SGRADAR ------'
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+    PRINT *, x%Nhydro
     ! output vertical levels: spaceborne radar -> from TOA to SURFACE
     ! Arrays with dimensions (Npoints,Nlevels)
-    print *, 'shape(x%att_gas): ', shape(x%att_gas)
+    PRINT *, 'shape(x%att_gas): ', shape(x%att_gas)
     ! Arrays with dimensions (Npoints,Ncolumns,Nlevels)
-    print *, 'shape(x%Ze_tot): ', shape(x%Ze_tot)
+    PRINT *, 'shape(x%Ze_tot): ', shape(x%Ze_tot)
 END SUBROUTINE COSP_SGRADAR_PRINT
 
@@ -1599,12 +1599,12 @@
     type(cosp_radarstats),intent(in) :: x
             
-    print *, '%%%%----- Information on COSP_SGRADAR ------'
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-    print *, x%Nhydro
-    print *, 'shape(x%cfad_ze): ',shape(x%cfad_ze)
-    print *, 'shape(x%radar_lidar_tcc): ',shape(x%radar_lidar_tcc)
-    print *, 'shape(x%lidar_only_freq_cloud): ',shape(x%lidar_only_freq_cloud)
+    PRINT *, '%%%%----- Information on COSP_SGRADAR ------'
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+    PRINT *, x%Nhydro
+    PRINT *, 'shape(x%cfad_ze): ',shape(x%cfad_ze)
+    PRINT *, 'shape(x%radar_lidar_tcc): ',shape(x%radar_lidar_tcc)
+    PRINT *, 'shape(x%lidar_only_freq_cloud): ',shape(x%lidar_only_freq_cloud)
 END SUBROUTINE COSP_RADARSTATS_PRINT
 
@@ -1612,36 +1612,36 @@
     type(cosp_lidarstats),intent(in) :: x
             
-    print *, '%%%%----- Information on COSP_SGLIDAR ------'
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-    print *, x%Nhydro
-    print *, x%Nrefl
+    PRINT *, '%%%%----- Information on COSP_SGLIDAR ------'
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+    PRINT *, x%Nhydro
+    PRINT *, x%Nrefl
     
     ! Arrays with dimensions (SR_BINS)
-    print *, 'shape(x%srbval): ',shape(x%srbval)
+    PRINT *, 'shape(x%srbval): ',shape(x%srbval)
     ! Arrays with dimensions (Npoints,SR_BINS,Nlevels)
-    print *, 'shape(x%cfad_sr): ',shape(x%cfad_sr)
+    PRINT *, 'shape(x%cfad_sr): ',shape(x%cfad_sr)
 !    ! Arrays with dimensions (Npoints,Ncolumns,Nlevels) !TIBO
-!    print *, 'shape(x%profSR): ',shape(x%profSR)        !TIBO
+!    PRINT *, 'shape(x%profSR): ',shape(x%profSR)        !TIBO
     ! Arrays with dimensions (Npoints,Nlevels,Ncolumns) !TIBO2
-    print *, 'shape(x%profSR): ',shape(x%profSR)        !TIBO2
+    PRINT *, 'shape(x%profSR): ',shape(x%profSR)        !TIBO2
     ! Arrays with dimensions (Npoints,Nlevels)
-    print *, 'shape(x%lidarcld): ',shape(x%lidarcld)
-    print *, 'shape(x%proftemp): ',shape(x%proftemp)    !TIBO
+    PRINT *, 'shape(x%lidarcld): ',shape(x%lidarcld)
+    PRINT *, 'shape(x%proftemp): ',shape(x%proftemp)    !TIBO
     ! Arrays with dimensions (Npoints,LIDAR_NCAT)
-    print *, 'shape(x%cldlayer): ',shape(x%cldlayer)
+    PRINT *, 'shape(x%cldlayer): ',shape(x%cldlayer)
     ! Arrays with dimensions (Npoints,LIDAR_NTYPE)            !OPAQ
-    print *, 'shape(x%cldtype): ',shape(x%cldtype)            !OPAQ
+    PRINT *, 'shape(x%cldtype): ',shape(x%cldtype)            !OPAQ
     ! Arrays with dimensions (Npoints,PARASOL_NREFL)
-    print *, 'shape(x%parasolrefl): ',shape(x%parasolrefl)
+    PRINT *, 'shape(x%parasolrefl): ',shape(x%parasolrefl)
      ! Arrays with dimensions (Npoints,Nlevels,Nphase)
-    print *, 'shape(x%lidarcldphase): ',shape(x%lidarcldphase)
+    PRINT *, 'shape(x%lidarcldphase): ',shape(x%lidarcldphase)
      ! Arrays with dimensions (Npoints,Nlevels,LIDAR_NTYPE+1) !OPAQ
-    print *, 'shape(x%lidarcldtype): ',shape(x%lidarcldtype)  !OPAQ
+    PRINT *, 'shape(x%lidarcldtype): ',shape(x%lidarcldtype)  !OPAQ
      ! Arrays with dimensions (Npoints,LIDAR_NCAT,Nphase)
-    print *, 'shape(x%cldlayerphase): ',shape(x%cldlayerphase)
+    PRINT *, 'shape(x%cldlayerphase): ',shape(x%cldlayerphase)
      ! Arrays with dimensions (Npoints,Ntemps,Nphase)
-    print *, 'shape(x%lidarcldphase): ',shape(x%lidarcldtmp)
+    PRINT *, 'shape(x%lidarcldphase): ',shape(x%lidarcldtmp)
 
 END SUBROUTINE COSP_LIDARSTATS_PRINT
@@ -1650,12 +1650,12 @@
     type(cosp_subgrid),intent(in) :: x
             
-    print *, '%%%%----- Information on COSP_SUBGRID ------'
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-    print *, x%Nhydro
-    
-    print *, 'shape(x%prec_frac): ',shape(x%prec_frac)
-    print *, 'shape(x%frac_out): ',shape(x%frac_out)
+    PRINT *, '%%%%----- Information on COSP_SUBGRID ------'
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+    PRINT *, x%Nhydro
+    
+    PRINT *, 'shape(x%prec_frac): ',shape(x%prec_frac)
+    PRINT *, 'shape(x%frac_out): ',shape(x%frac_out)
 END SUBROUTINE COSP_SUBGRID_PRINT
 
@@ -1663,13 +1663,13 @@
     type(cosp_sghydro),intent(in) :: x
             
-    print *, '%%%%----- Information on COSP_SGHYDRO ------'
-    print *, x%Npoints
-    print *, x%Ncolumns
-    print *, x%Nlevels
-    print *, x%Nhydro
-    
-    print *, 'shape(x%mr_hydro): ',shape(x%mr_hydro)
-    print *, 'shape(x%Reff): ',shape(x%Reff)
-    print *, 'shape(x%Np): ',shape(x%Np)         ! added by roj with Quickbeam V3
+    PRINT *, '%%%%----- Information on COSP_SGHYDRO ------'
+    PRINT *, x%Npoints
+    PRINT *, x%Ncolumns
+    PRINT *, x%Nlevels
+    PRINT *, x%Nhydro
+    
+    PRINT *, 'shape(x%mr_hydro): ',shape(x%mr_hydro)
+    PRINT *, 'shape(x%Reff): ',shape(x%Reff)
+    PRINT *, 'shape(x%Np): ',shape(x%Np)         ! added by roj with Quickbeam V3
 END SUBROUTINE COSP_SGHYDRO_PRINT
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_utils.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_utils.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_utils.F90	(revision 5160)
@@ -273,6 +273,6 @@
     endif    
     
-    if (l_min) print *,'----- WARNING: '//trim(pro_name)//': minimum value of '//trim(vname)//' set to: ',min_val
-    if (l_max) print *,'----- WARNING: '//trim(pro_name)//': maximum value of '//trim(vname)//' set to: ',max_val
+    if (l_min) PRINT *,'----- WARNING: '//trim(pro_name)//': minimum value of '//trim(vname)//' set to: ',min_val
+    if (l_max) PRINT *,'----- WARNING: '//trim(pro_name)//': maximum value of '//trim(vname)//' set to: ',max_val
   END SUBROUTINE COSP_CHECK_INPUT_1D
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -308,6 +308,6 @@
     endif    
     
-    if (l_min) print *,'----- WARNING: '//trim(pro_name)//': minimum value of '//trim(vname)//' set to: ',min_val
-    if (l_max) print *,'----- WARNING: '//trim(pro_name)//': maximum value of '//trim(vname)//' set to: ',max_val
+    if (l_min) PRINT *,'----- WARNING: '//trim(pro_name)//': minimum value of '//trim(vname)//' set to: ',min_val
+    if (l_max) PRINT *,'----- WARNING: '//trim(pro_name)//': maximum value of '//trim(vname)//' set to: ',max_val
   END SUBROUTINE COSP_CHECK_INPUT_2D
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -343,6 +343,6 @@
     endif    
     
-    if (l_min) print *,'----- WARNING: '//trim(pro_name)//': minimum value of '//trim(vname)//' set to: ',min_val
-    if (l_max) print *,'----- WARNING: '//trim(pro_name)//': maximum value of '//trim(vname)//' set to: ',max_val
+    if (l_min) PRINT *,'----- WARNING: '//trim(pro_name)//': minimum value of '//trim(vname)//' set to: ',min_val
+    if (l_max) PRINT *,'----- WARNING: '//trim(pro_name)//': maximum value of '//trim(vname)//' set to: ',max_val
   END SUBROUTINE COSP_CHECK_INPUT_3D
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90	(revision 5160)
@@ -372,5 +372,5 @@
 
       if ( Ncat .ne. 4 ) then
-         print *,'Error in lmd_ipsl_stats.cosp_cldfrac, Ncat must be 4, not',Ncat
+         PRINT *,'Error in lmd_ipsl_stats.cosp_cldfrac, Ncat must be 4, not',Ncat
          stop
       endif
@@ -918,5 +918,5 @@
              enddo
              checkcldlayerphase2=cldlayer(i,iz)-checkcldlayerphase
-             if( (checkcldlayerphase2.gt.0.01).or.(checkcldlayerphase2.lt.-0.01) ) print *, checkcldlayerphase,cldlayer(i,iz)
+             if( (checkcldlayerphase2.gt.0.01).or.(checkcldlayerphase2.lt.-0.01) ) PRINT *, checkcldlayerphase,cldlayer(i,iz)
 
           endif
@@ -962,6 +962,6 @@
 
     if(checktemp.NE.lidarcldtemp(i,itemp,1))then
-      print *, i,itemp
-      print *, lidarcldtemp(i,itemp,1:4)
+      PRINT *, i,itemp
+      PRINT *, lidarcldtemp(i,itemp,1:4)
     endif
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90	(revision 5160)
@@ -512,5 +512,5 @@
   alam=3E5/freq
   if((alam < wlmin) .or. (alam > wlmax)) then
-    print *, 'm_ice: wavelength out of bounds'
+    PRINT *, 'm_ice: wavelength out of bounds'
     stop
   endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/phys_cosp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/phys_cosp.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/phys_cosp.F90	(revision 5160)
@@ -223,5 +223,5 @@
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ! AI mars 2017
-!        print *, 'Allocating memory for gridbox type...'
+!        PRINT *, 'Allocating memory for gridbox type...'
 
 ! Surafce emissivity
@@ -240,5 +240,5 @@
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-!        print *, 'Populating input structure...'
+!        PRINT *, 'Populating input structure...'
         gbx%longitude = lon
         gbx%latitude = lat
@@ -324,5 +324,5 @@
         ! Define new vertical grid
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!        print *, 'Defining new vertical grid...'
+!        PRINT *, 'Defining new vertical grid...'
         call construct_cosp_vgrid(gbx,Nlr,use_vgrid,csat_vgrid,vgrid)
 
@@ -330,5 +330,5 @@
        ! Allocate memory for other types
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!        print *, 'Allocating memory for other types...'
+!        PRINT *, 'Allocating memory for other types...'
         call construct_cosp_subgrid(Npoints, Ncolumns, Nlevels, sgx)
         call construct_cosp_sgradar(cfg,Npoints,Ncolumns,Nlevels,N_HYDRO,sgradar)
@@ -347,5 +347,5 @@
 
       !$OMP MASTER
-!        print *, ' Open outpts files and define axis'
+!        PRINT *, ' Open outpts files and define axis'
         call cosp_output_open(Nlevlmdz, Ncolumns, presnivs, dtime, freq_cosp, &
                               ok_mensuelCOSP, ok_journeCOSP, ok_hfCOSP, ok_all_xml, &
@@ -358,5 +358,5 @@
         ! Call simulator
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!        print *, 'Calling simulator...'
+!        PRINT *, 'Calling simulator...'
 !! AI 
 !        call cosp(overlap,Ncolumns,cfg,vgrid,gbx,sgx,sgradar,sglidar,isccp,misr,stradar,stlidar)
@@ -371,5 +371,5 @@
 !!!!!!!!!!!!!!!!!! Ecreture des sorties Cosp !!!!!!!!!!!!!!r!!!!!!:!!!!!
 
-!       print *, 'Calling write output'
+!       PRINT *, 'Calling write output'
      if (.NOT. debut_cosp) call cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, missing_val, &
                                cfg, gbx, vgrid, sglidar, sgradar, stlidar, stradar, & 
@@ -379,5 +379,5 @@
         ! Deallocate memory in derived types
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!        print *, 'Deallocating memory...'
+!        PRINT *, 'Deallocating memory...'
         call free_cosp_gridbox(gbx)
         call free_cosp_subgrid(sgx)
@@ -397,5 +397,5 @@
   ! Time in s. Only for testing purposes
 !  call system_clock(t1,count_rate,count_max)
-!  print *,(t1-t0)*1.0/count_rate
+!  PRINT *,(t1-t0)*1.0/count_rate
     if (debut_cosp) then 
       debut_cosp=.false.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90	(revision 5160)
@@ -213,5 +213,5 @@
           else
             if (Np_matrix(tp,pr,k)>0) then
-               print *, 'Warning: Re and Np set for the same ', &
+               PRINT *, 'Warning: Re and Np set for the same ', &
                         'volume & hydrometeor type.  Np is being ignored.'
             endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_read_otputkeys.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_read_otputkeys.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/cosp_read_otputkeys.F90	(revision 5160)
@@ -658,6 +658,6 @@
     
   if (i.gt.78) then
-     print *, 'COSP_IO: wrong number of output diagnostics'
-     print *, i,78
+     PRINT *, 'COSP_IO: wrong number of output diagnostics'
+     PRINT *, i,78
      stop
   endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/lidar_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/lidar_simulator.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/lidar_simulator.F90	(revision 5160)
@@ -959,5 +959,5 @@
              enddo
              checkcldlayerphase2 = cldlayer(i,iz)-checkcldlayerphase
-             if((checkcldlayerphase2 .gt. 0.01) .or. (checkcldlayerphase2 .lt. -0.01) ) print *, checkcldlayerphase,cldlayer(i,iz)
+             if((checkcldlayerphase2 .gt. 0.01) .or. (checkcldlayerphase2 .lt. -0.01) ) PRINT *, checkcldlayerphase,cldlayer(i,iz)
           endif
        enddo
@@ -998,6 +998,6 @@
           checktemp=lidarcldtemp(i,itemp,2)+lidarcldtemp(i,itemp,3)+lidarcldtemp(i,itemp,4)
           !if(checktemp .NE. lidarcldtemp(i,itemp,1))then
-          !   print *, i,itemp
-          !   print *, lidarcldtemp(i,itemp,1:4)
+          !   PRINT *, i,itemp
+          !   PRINT *, lidarcldtemp(i,itemp,1:4)
           !endif
           
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/phys_cosp2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/phys_cosp2.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp2/phys_cosp2.F90	(revision 5160)
@@ -286,5 +286,5 @@
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ! AI mars 2017
-!        print *, 'Allocating memory for gridbox type...'
+!        PRINT *, 'Allocating memory for gridbox type...'
 
 ! Surafce emissivity
@@ -303,5 +303,5 @@
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-!        print *, 'Populating input structure...'
+!        PRINT *, 'Populating input structure...'
         gbx%longitude = lon
         gbx%latitude = lat
@@ -387,5 +387,5 @@
         ! Define new vertical grid
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!        print *, 'Defining new vertical grid...'
+!        PRINT *, 'Defining new vertical grid...'
         call construct_cosp_vgrid(gbx,Nlr,use_vgrid,csat_vgrid,vgrid)
         print*,'Nlvgrid,use_vgrid,csat_vgrid ',Nlr,use_vgrid,csat_vgrid
@@ -394,5 +394,5 @@
        ! Allocate memory for other types
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!        print *, 'Allocating memory for other types...'
+!        PRINT *, 'Allocating memory for other types...'
         call construct_cosp_subgrid(Npoints, Ncolumns, Nlevels, sgx)
         if (cfg%Lradar_sim) call construct_cosp_sgradar(Npoints,Ncolumns,Nlevels,N_HYDRO,sgradar) 
@@ -409,5 +409,5 @@
     if (debut_cosp) then
       !$OMP MASTER
-        print *, ' Open outpts files and define axis'
+        PRINT *, ' Open outpts files and define axis'
         call cosp_output_open(Nlevlmdz, Ncolumns, presnivs, dtime, freq_cosp, &
                               ok_mensuelCOSP, ok_journeCOSP, ok_hfCOSP, ok_all_xml, &
@@ -428,5 +428,5 @@
 !!!!!!!!!!!!!!!!!! Ecreture des sorties Cosp !!!!!!!!!!!!!!r!!!!!!:!!!!!
 
-       print *, 'Calling write output'
+       PRINT *, 'Calling write output'
         call cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, missing_val, &
                                cfg, gbx, vgrid, sglidar, sgradar, stlidar, stradar, & 
@@ -435,11 +435,11 @@
         ! Deallocate memory in derived types
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-      print *, 'Deallocating memory...'
+      PRINT *, 'Deallocating memory...'
      call free_cosp_gridbox(gbx)
-      print *, 'free_cosp_gridbox'
+      PRINT *, 'free_cosp_gridbox'
      call free_cosp_subgrid(sgx)
-      print *, 'ffree_cosp_subgrid'
+      PRINT *, 'ffree_cosp_subgrid'
      call free_cosp_vgrid(vgrid)
-      print *, 'free_cosp_vgrid'
+      PRINT *, 'free_cosp_vgrid'
      if (cfg%Lradar_sim) call free_cosp_sgradar(sgradar)
      if (cfg%Lradar_sim) call free_cosp_radarstats(stradar)
@@ -450,9 +450,9 @@
      if (cfg%Lmodis_sim) call free_cosp_modis(modis)
      if (cfg%Lrttov_sim) call free_cosp_rttov(rttov)
-     print *, 'End phys_cosp2'
+     PRINT *, 'End phys_cosp2'
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   ! Time in s. Only for testing purposes
 !  call system_clock(t1,count_rate,count_max)
-!  print *,(t1-t0)*1.0/count_rate
+!  PRINT *,(t1-t0)*1.0/count_rate
  
 end subroutine phys_cosp2
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90	(revision 5160)
@@ -1070,5 +1070,5 @@
              enddo
              checkcldlayerphase2 = cldlayer(i,iz)-checkcldlayerphase
-             if((checkcldlayerphase2 .gt. 0.01) .or. (checkcldlayerphase2 .lt. -0.01) ) print *, checkcldlayerphase,cldlayer(i,iz)
+             if((checkcldlayerphase2 .gt. 0.01) .or. (checkcldlayerphase2 .lt. -0.01) ) PRINT *, checkcldlayerphase,cldlayer(i,iz)
           endif
        enddo
@@ -1109,6 +1109,6 @@
           checktemp=lidarcldtemp(i,itemp,2)+lidarcldtemp(i,itemp,3)+lidarcldtemp(i,itemp,4)
           !if(checktemp .NE. lidarcldtemp(i,itemp,1))then
-          !   print *, i,itemp
-          !   print *, lidarcldtemp(i,itemp,1:4)
+          !   PRINT *, i,itemp
+          !   PRINT *, lidarcldtemp(i,itemp,1:4)
           !endif
           
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90	(revision 5160)
@@ -527,5 +527,5 @@
       !$OMP MASTER
 
-        print *, ' Open outpts files and define axis'
+        PRINT *, ' Open outpts files and define axis'
         call lmdz_cosp_output_open(Nlevlmdz, Ncolumns, presnivs, dtime, freq_cosp,       &
                                    ok_mensuelCOSP, ok_journeCOSP, ok_hfCOSP, ok_all_xml, &
@@ -553,5 +553,5 @@
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-       print *, 'Calling write output'
+       PRINT *, 'Calling write output'
         call lmdz_cosp_output_write(Nlevlmdz, Npoints, Ncolumns, itap, dtime, freq_COSP, &
                                     missing_val, cfg, niv_sorties, cospOUT)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_read_outputkeys.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_read_outputkeys.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_read_outputkeys.F90	(revision 5160)
@@ -897,6 +897,6 @@
 
   if (i.gt.107) then
-     print *, 'COSP_IO: wrong number of output diagnostics'
-     print *, i,107
+     PRINT *, 'COSP_IO: wrong number of output diagnostics'
+     PRINT *, i,107
      stop
   endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_buoy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_buoy.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_buoy.F90	(revision 5160)
@@ -44,5 +44,5 @@
 
 
-  ! print *,' Ale+cin ',ale(1)+cin(1)
+  ! PRINT *,' Ale+cin ',ale(1)+cin(1)
   ! --------------------------------------------------------------
   ! Recompute buoyancies
@@ -102,5 +102,5 @@
       IF (ale(il)+cin(il)>0. .AND. ok(il)) THEN
         IF (k>icb(il) .AND. k<=inb(il)) THEN
-          ! c         print *,'k,p(il,k),plcl(il)-200. ',
+          ! c         PRINT *,'k,p(il,k),plcl(il)-200. ',
           ! k,p(il,k),plcl(il)-200.
           IF (p(il,k)>plcl(il)-200.) THEN
@@ -116,5 +116,5 @@
   END DO
 
-  ! print *,' ==cv3_buoy== bll(1),bmx(1),icb(1),kmx(1) '
+  ! PRINT *,' ==cv3_buoy== bll(1),bmx(1),icb(1),kmx(1) '
   ! $       ,bll(1),bmx(1),icb(1),kmx(1)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_enthalpmix.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_enthalpmix.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_enthalpmix.F90	(revision 5160)
@@ -61,5 +61,5 @@
 
 
-  !!  print *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
+  !!  PRINT *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
   plim2p(:) = min(plim2(:), plim1(:) - dpmin)
   j1(:) = nd
@@ -102,5 +102,5 @@
   END DO
 
-  !!  print *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
+  !!  PRINT *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
 
   DO j = 1, nd
@@ -115,5 +115,5 @@
         dpw(i) = dpw(i) + wi(i, j)
 
-        !!  print *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
+        !!  PRINT *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
 
       END IF
@@ -142,5 +142,5 @@
 
 
-  !!  print *,'cv3_vertmix, rdcp ', rdcp  !jyg
+  !!  PRINT *,'cv3_vertmix, rdcp ', rdcp  !jyg
 
   DO j = 1, nd
@@ -205,5 +205,5 @@
   END DO
 
-  !!  print *,' cv3_vertmix->'  !jyg
+  !!  PRINT *,' cv3_vertmix->'  !jyg
 
 END SUBROUTINE cv3_enthalpmix
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_estatmix.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_estatmix.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_estatmix.F90	(revision 5160)
@@ -65,5 +65,5 @@
 
 
-!!  print *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
+!!  PRINT *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
   plim2p(:) = min(plim2(:),plim1(:)-dpmin)
   j1(:)=nd
@@ -103,5 +103,5 @@
   END DO
 
-!!  print *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
+!!  PRINT *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
 
   DO j = 1, nd
@@ -116,5 +116,5 @@
         dpw(i) = dpw(i) + wi(i, j)
 
-!!  print *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
+!!  PRINT *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
 
       END IF
@@ -143,5 +143,5 @@
 
 
-!!  print *,'cv3_vertmix, rdcp ', rdcp  !jyg
+!!  PRINT *,'cv3_vertmix, rdcp ', rdcp  !jyg
 
   DO i = 1, len
@@ -192,5 +192,5 @@
   END DO
 
-!!  print *,' cv3_vertmix->'  !jyg
+!!  PRINT *,' cv3_vertmix->'  !jyg
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90	(revision 5160)
@@ -201,6 +201,6 @@
   INTEGER il
 
-  !    print *,'cv3_incrcount : noconv_stop ',noconv_stop
-  !    print *,'cv3_incrcount in, sig(1,nd) ',sig(1,nd)
+  !    PRINT *,'cv3_incrcount : noconv_stop ',noconv_stop
+  !    PRINT *,'cv3_incrcount in, sig(1,nd) ',sig(1,nd)
   IF(ok_convstop) THEN
     DO il = 1, len
@@ -214,5 +214,5 @@
     END DO
   ENDIF  ! (ok_convstop)
-  !    print *,'cv3_incrcount out, sig(1,nd) ',sig(1,nd)
+  !    PRINT *,'cv3_incrcount out, sig(1,nd) ',sig(1,nd)
 
 END SUBROUTINE cv3_incrcount
@@ -277,5 +277,5 @@
               (p(i, k - 1) - p(i, k)) / ph(i, k)        !convect3
 
-      ! c        print *,' gz(',k,')',gz(i,k),' tvx',tvx,' tvy ',tvy
+      ! c        PRINT *,' gz(',k,')',gz(i,k),' tvx',tvx,' tvy ',tvy
 
       ! ori         gz(i,k)=gz(i,k-1)+hrd*(tv(i,k-1)+tv(i,k))
@@ -534,5 +534,5 @@
   ENDIF
   IF (prt_level >= 10) THEN
-    print *, 'cv3_feed : iflag(1), pfeed(1), plcl(1), wghti(1,k) ', &
+    PRINT *, 'cv3_feed : iflag(1), pfeed(1), plcl(1), wghti(1,k) ', &
             iflag(1), pfeed(1), plcl(1), (wghti(1, k), k = 1, 10)
   ENDIF
@@ -1207,5 +1207,5 @@
 
   IF (prt_level >= 10) THEN
-    print *, 'cv3_undilute2.0. icvflag_Tpa, t(1,k), q(1,k), qs(1,k) ', &
+    PRINT *, 'cv3_undilute2.0. icvflag_Tpa, t(1,k), q(1,k), qs(1,k) ', &
             icvflag_Tpa, (k, t(1, k), q(1, k), qs(1, k), k = 1, nl)
   ENDIF
@@ -1378,6 +1378,6 @@
             ENDIF ! (tg .gt. Tx)
 
-            !!     print *,' j, k, Um, U, Ux, aa, bb, discr, dd, ddelta ', j, k, Um, U, Ux, aa, bb, discr, dd, ddelta
-            !!     print *,' j, k, ah0(i), ahg, tg, qg, tp(i,k), ff ', j, k, ah0(i), ahg, tg, qg, tp(i,k), ff
+            !!     PRINT *,' j, k, Um, U, Ux, aa, bb, discr, dd, ddelta ', j, k, Um, U, Ux, aa, bb, discr, dd, ddelta
+            !!     PRINT *,' j, k, ah0(i), ahg, tg, qg, tp(i,k), ff ', j, k, ah0(i), ahg, tg, qg, tp(i,k), ff
           END IF ! (k>=(icbs(i)+1))
         END DO ! i = 1, ncum
@@ -1439,5 +1439,5 @@
             Tp(i, k) = tg + (ah0(i) - ahg) / &
                     (cpd + (cl - cpd) * qta(i, k - 1) + (lv(i, k) + frac(i, k) * lf(i, k)) * dqgdT)
-            !!   print *,'undilute2 iterations k, Tp(i,k), ah0(i), ahg ', &
+            !!   PRINT *,'undilute2 iterations k, Tp(i,k), ah0(i), ahg ', &
             !!                                 k, Tp(i,k), ah0(i), ahg
           END IF ! (k>=(icbs(i)+1))
@@ -1736,5 +1736,5 @@
   !   =========================================================================
   IF (prt_level >= 10) THEN
-    print *, 'cv3_undilute2.1. tp(1,k), tvp(1,k) ', &
+    PRINT *, 'cv3_undilute2.1. tp(1,k), tvp(1,k) ', &
             (k, tp(1, k), tvp(1, k), k = 1, nl)
   ENDIF
@@ -2755,5 +2755,5 @@
 
   ! ------------------------------------------------------
-  IF (prt_level >= 10) print *, ' ->cv3_unsat, iflag(1) ', iflag(1)
+  IF (prt_level >= 10) PRINT *, ' ->cv3_unsat, iflag(1) ', iflag(1)
 
   smallestreal = tiny(smallestreal)
@@ -3040,5 +3040,5 @@
         !    water(il,i)=revap*revap
         !    prec(il,i)=revap*revap
-        !!        print *,' i,b6,c6,revap,evap(il,i),water(il,i),wdtrain(il) ', &
+        !!        PRINT *,' i,b6,c6,revap,evap(il,i),water(il,i),wdtrain(il) ', &
         !!                 i,b6,c6,revap,evap(il,i),water(il,i),wdtrain(il)
         !!---end jyg---
@@ -3062,7 +3062,7 @@
           b6 = bfac * 50. * sigd(il) * (ph(il, i) - ph(il, i + 1)) * sigt * afac1
           c6 = prec(il, i + 1) + 0.5 * bfac * wdtrain(il)
-          ! print *,'bfac,sigd(il),sigt,afac1 ',bfac,sigd(il),sigt,afac1
-          ! print *,'prec(il,i+1),wdtrain(il) ',prec(il,i+1),wdtrain(il)
-          ! print *,'b6,c6,b6*b6+4.*c6 ',b6,c6,b6*b6+4.*c6
+          ! PRINT *,'bfac,sigd(il),sigt,afac1 ',bfac,sigd(il),sigt,afac1
+          ! PRINT *,'prec(il,i+1),wdtrain(il) ',prec(il,i+1),wdtrain(il)
+          ! PRINT *,'b6,c6,b6*b6+4.*c6 ',b6,c6,b6*b6+4.*c6
           IF (c6>b6 * b6 + 1.E-20) THEN
             revap = 2. * c6 / (b6 + sqrt(b6 * b6 + 4. * c6))
@@ -3086,5 +3086,5 @@
           !JYG---   Dans tous les cas, evaporation = [tt ce qui entre dans la couche i]
           ! moins [tt ce qui sort de la couche i]
-          ! print *, 'evap avec ice'
+          ! PRINT *, 'evap avec ice'
           evap(il, i) = (wdtrain(il) + sigd(il) * wt(il, i) * (prec(il, i + 1) - prec(il, i))) / &
                   (sigd(il) * (ph(il, i) - ph(il, i + 1)) * 100.)
@@ -3150,5 +3150,5 @@
             water(il, i) = 0.
           END IF
-          ! print *, 'evap sans ice'
+          ! PRINT *, 'evap sans ice'
           evap(il, i) = (wdtrain(il) + sigd(il) * wt(il, i) * (water(il, i + 1) - water(il, i))) / &
                   (sigd(il) * (ph(il, i) - ph(il, i + 1)) * 100.)
@@ -4054,5 +4054,5 @@
     !-----------------------------------------------------------
 
-    !!   print *,'yield, i, amp1, ad', i, amp1(1), ad(1)
+    !!   PRINT *,'yield, i, amp1, ad', i, amp1(1), ad(1)
 
     DO il = 1, ncum
@@ -4511,5 +4511,5 @@
 
   IF (prt_level >= 5) THEN
-    print *, ' CV3_YIELD : alpha_qpos ', alpha_qpos(1)
+    PRINT *, ' CV3_YIELD : alpha_qpos ', alpha_qpos(1)
   ENDIF
 
@@ -4678,5 +4678,5 @@
             END IF
           END IF
-          ! c        print *,'cbmf',il,i,k,cbmf(il),wghti(il,k)
+          ! c        PRINT *,'cbmf',il,i,k,cbmf(il),wghti(il,k)
         END DO
       END DO
@@ -4691,5 +4691,5 @@
             dnwd(il, i) = dnwd(il, i) + dn1(il, k, i)
           END IF
-          ! c         print *,'upwd',il,i,k,inb(il),upwd(il,i),m(il,k),up1(il,k,i)
+          ! c         PRINT *,'upwd',il,i,k,inb(il),upwd(il,i),m(il,k),up1(il,k,i)
         END DO
       END DO
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p1_closure.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p1_closure.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p1_closure.F90	(revision 5160)
@@ -95,5 +95,5 @@
   CHARACTER (LEN=80) :: abort_message
 
-  ! print *,' -> cv3p1_closure, Ale ',ale(1)
+  ! PRINT *,' -> cv3p1_closure, Ale ',ale(1)
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p2_closure.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p2_closure.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p2_closure.F90	(revision 5160)
@@ -107,5 +107,5 @@
 !$OMP THREADPRIVATE(igout)
 
- IF (prt_level>=20) print *,' -> cv3p2_closure, Ale ',ale(igout)
+ IF (prt_level>=20) PRINT *,' -> cv3p2_closure, Ale ',ale(igout)
 
 
@@ -507,6 +507,6 @@
 
   IF (prt_level >= 20) THEN
-    print *,'cv3p2_closure: dtmin ', (k, dtmin(igout,k), k=1,nl)
-    print *,'cv3p2_closure: dtminmax ', dtminmax(igout)
+    PRINT *,'cv3p2_closure: dtmin ', (k, dtmin(igout,k), k=1,nl)
+    PRINT *,'cv3p2_closure: dtminmax ', dtminmax(igout)
   ENDIF
 
@@ -838,5 +838,5 @@
 
   IF (prt_level >= 10) THEN
-   print *,'cv3p2_closure: iflag ',iflag(igout)
+   PRINT *,'cv3p2_closure: iflag ',iflag(igout)
   ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p_mixing.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p_mixing.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p_mixing.F90	(revision 5160)
@@ -222,5 +222,5 @@
           ELSE IF (j > i) THEN
             IF (prt_level >= 10) THEN
-              print *,'cv3p_mixing i, j, Sij given by the no-precip eq. ', i, j, Sij(il,i,j)
+              PRINT *,'cv3p_mixing i, j, Sij given by the no-precip eq. ', i, j, Sij(il,i,j)
             ENDIF
           END IF ! new
@@ -235,7 +235,7 @@
 !jygdebug<
     IF (prt_level >= 10) THEN
-      print *,'cv3p_mixing i, nent(i), icb, inb ',i, nent(igout,i), icb(igout), inb(igout)
+      PRINT *,'cv3p_mixing i, nent(i), icb, inb ',i, nent(igout,i), icb(igout), inb(igout)
       IF (nent(igout,i) > 0) THEN
-        print *,'i,(j,Sij(i,j),j=icb-1,inb) ',i,(j,Sij(igout,i,j),j=icb(igout)-1,inb(igout))
+        PRINT *,'i,(j,Sij(i,j),j=icb-1,inb) ',i,(j,Sij(igout,i,j),j=icb(igout)-1,inb(igout))
       ENDIF
     ENDIF
@@ -550,5 +550,5 @@
             END IF
 
-! print *,h(il,j)-hent(il,i,j),LV(il,j)*rs(il,j)/(cpd*rrv*t(il,j)*
+! PRINT *,h(il,j)-hent(il,i,j),LV(il,j)*rs(il,j)/(cpd*rrv*t(il,j)*
 ! :         t(il,j))
 
@@ -567,5 +567,5 @@
 !IM 301008 end
 
-! print *,'mix : i,j,hent(il,i,j),Sigij(il,i,j) ',
+! PRINT *,'mix : i,j,hent(il,i,j),Sigij(il,i,j) ',
 ! :               i,j,hent(il,i,j),Sigij(il,i,j)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv_driver.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv_driver.F90	(revision 5160)
@@ -354,5 +354,5 @@
   ! --- SET CONSTANTS AND PARAMETERS
   ! -------------------------------------------------------------------
-  ! print *, '-> cv_driver'      !jyg
+  ! PRINT *, '-> cv_driver'      !jyg
   ! -- set simulation flags:
   ! (common cvflag)
@@ -680,5 +680,5 @@
   END IF ! ncum>0
 
-  ! print *, 'fin cv_driver ->'      !jyg
+  ! PRINT *, 'fin cv_driver ->'      !jyg
 
 END SUBROUTINE cv_driver
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cva_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cva_driver.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cva_driver.F90	(revision 5160)
@@ -556,6 +556,6 @@
 
 
-! print *, 't1, t1_wake ',(k,t1(1,k),t1_wake(1,k),k=1,nd)
-! print *, 'q1, q1_wake ',(k,q1(1,k),q1_wake(1,k),k=1,nd)
+! PRINT *, 't1, t1_wake ',(k,t1(1,k),t1_wake(1,k),k=1,nd)
+! PRINT *, 'q1, q1_wake ',(k,q1(1,k),q1_wake(1,k),k=1,nd)
 
 ! -------------------------------------------------------------------
@@ -775,5 +775,5 @@
   END IF
 
-! print *, 'cv3_feed-> iflag1, plcl1 ',iflag1(1),plcl1(1)
+! PRINT *, 'cv3_feed-> iflag1, plcl1 ',iflag1(1),plcl1(1)
 
 ! --------------------------------------------------------------------
@@ -804,5 +804,5 @@
 ! -------------------------------------------------------------------
 
-! print *,' avant triggering, iflag_con ',iflag_con
+! PRINT *,' avant triggering, iflag_con ',iflag_con
 
   IF (iflag_con==3) THEN
@@ -1035,5 +1035,5 @@
     END IF
 
-! print *,'cv_closure-> cape ',cape(1)
+! PRINT *,'cv_closure-> cape ',cape(1)
 
 ! -------------------------------------------------------------------
@@ -1128,6 +1128,6 @@
     END IF !(debut) THEN
 
-! print *,'cv_unsat-> mp ',mp
-! print *,'cv_unsat-> water ',water
+! PRINT *,'cv_unsat-> mp ',mp
+! PRINT *,'cv_unsat-> water ',water
 ! -------------------------------------------------------------------
 ! --- YIELD
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr.F90	(revision 5160)
@@ -692,5 +692,5 @@
 !        ENDDO
 !      ENDDO
-!       IF(it.EQ.3) print *,'it',it,'conserv ',conserv,'conservMA ',conservMA
+!       IF(it.EQ.3) PRINT *,'it',it,'conserv ',conserv,'conservMA ',conservMA
 
 END SUBROUTINE cvltr
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_noscav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_noscav.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_noscav.F90	(revision 5160)
@@ -143,6 +143,6 @@
   END DO
 
-!!  print *,'it, qfeed(1,it), x(1,1,it) ', it, qfeed(1,it), x(1,1,it)  !jyg
-!!  print *,'wght_cvfd ', (j, wght_cvfd(1,j), j=1,5)                     !jyg
+!!  PRINT *,'it, qfeed(1,it), x(1,1,it) ', it, qfeed(1,it), x(1,1,it)  !jyg
+!!  PRINT *,'wght_cvfd ', (j, wght_cvfd(1,j), j=1,5)                     !jyg
 
   DO k=1,klev
@@ -197,5 +197,5 @@
         ENDDO
       ENDDO
-!!      print *,'it',it,'cvltr_noscav conserv, smfd, smfu, smfa, smfp ',conserv,  &
+!!      PRINT *,'it',it,'cvltr_noscav conserv, smfd, smfu, smfa, smfp ',conserv,  &
 !!               smfd, smfu, smfa, smfp
      
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_scav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_scav.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_scav.F90	(revision 5160)
@@ -17,4 +17,6 @@
   USE lmdz_YOECUMF
   USE lmdz_yomcst
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
 
   IMPLICIT NONE 
@@ -24,6 +26,4 @@
   ! modifiee par R Pilon : lessivage des traceurs / KE
   !=====================================================================
-
-  include "chem.h"
 
   ! Entree
@@ -704,5 +704,5 @@
   !        ENDDO
   !      ENDDO
-  !       IF(it.EQ.3) print *,'it',it,'conserv ',conserv,'conservMA ',conservMA
+  !       IF(it.EQ.3) PRINT *,'it',it,'conserv ',conserv,'conservMA ',conservMA
 
 END SUBROUTINE cvltr_scav
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_spl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_spl.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_spl.F90	(revision 5160)
@@ -17,4 +17,6 @@
   USE lmdz_YOECUMF
   USE lmdz_yomcst
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
 
   IMPLICIT NONE 
@@ -24,6 +26,4 @@
 ! modifiee par R Pilon : lessivage des traceurs / KE
 !=====================================================================
-
-  include "chem.h"
 
 ! Entree
@@ -309,5 +309,5 @@
 ! JE SPLA: Calc of ccntrAA_coef,ccntrENV_coef, coefcoli for SPLA aerosols and
 ! precursors. From SPLA code inscav_spl.F 
-!print *,'Using SPLA values for cvltr_spl ccntr and coefcoli params'
+!PRINT *,'Using SPLA values for cvltr_spl ccntr and coefcoli params'
 
 
@@ -837,5 +837,5 @@
 !        ENDDO
 !      ENDDO
-!       IF(it.EQ.3) print *,'it',it,'conserv ',conserv,'conservMA ',conservMA
+!       IF(it.EQ.3) PRINT *,'it',it,'conserv ',conserv,'conservMA ',conservMA
 
 END SUBROUTINE cvltr_spl
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltrorig.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltrorig.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltrorig.F90	(revision 5160)
@@ -163,5 +163,5 @@
 !        ENDDO
 !      ENDDO
-!      print *,'it',it,'cvltrorig conserv',conserv
+!      PRINT *,'it',it,'cvltrorig conserv',conserv
      
 END SUBROUTINE cvltrorig
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_interp_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 5160)
@@ -171,5 +171,5 @@
            tend_rayo=1
            dt_cooling(l) = dtrad_mod_cas(l)
-!          print *,'dt_cooling=',dt_cooling(l)
+!          PRINT *,'dt_cooling=',dt_cooling(l)
         else
            dt_cooling(l) = 0.0
@@ -181,9 +181,9 @@
        fsens=-1.*sens_prof_cas
        flat=-1.*lat_prof_cas
-       print *,'1D_interp: sens,flat',fsens,flat
+       PRINT *,'1D_interp: sens,flat',fsens,flat
       ENDIF
 
       IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
-       print *,'ust=',ust
+       PRINT *,'ust=',ust
       ENDIF
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_read_forc_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 5160)
@@ -45,5 +45,5 @@
 
       DO l = 1, nlev_cas
-      print *,'apres 1ere interp: plev_cas, plev_prof_cas=',l,plev_cas(l,1),plev_prof_cas(l)
+      PRINT *,'apres 1ere interp: plev_cas, plev_prof_cas=',l,plev_cas(l,1),plev_prof_cas(l)
       enddo
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_1dutils.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_1dutils.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_1dutils.f90	(revision 5160)
@@ -1349,6 +1349,6 @@
       ENDDO
     ENDDO
-    print *, 't_targ', t_targ
-    print *, 'rh_targ', rh_targ
+    PRINT *, 't_targ', t_targ
+    PRINT *, 'rh_targ', rh_targ
 
   END SUBROUTINE nudge_rht_init
@@ -1380,6 +1380,6 @@
       ENDDO
     ENDDO
-    print *, 'u_targ', u_targ
-    print *, 'v_targ', v_targ
+    PRINT *, 'u_targ', u_targ
+    PRINT *, 'v_targ', v_targ
 
     RETURN
@@ -1423,9 +1423,9 @@
     REAL zx_qs, rh, tnew, d_rh, rhnew
 
-    print *, 'dtime, tau ', dtime, tau
-    print *, 't_targ', t_targ
-    print *, 'rh_targ', rh_targ
-    print *, 'temp ', t
-    print *, 'hum ', q
+    PRINT *, 'dtime, tau ', dtime, tau
+    PRINT *, 't_targ', t_targ
+    PRINT *, 'rh_targ', rh_targ
+    PRINT *, 'temp ', t
+    PRINT *, 'hum ', q
 
     DO k = 1, klev
@@ -1459,5 +1459,5 @@
           rhnew = (q(i, k) + d_q(i, k) * dtime) / zx_qs
 
-          print *, ' k,d_t,rh,d_rh,rhnew,d_q ', &
+          PRINT *, ' k,d_t,rh,d_rh,rhnew,d_q ', &
                   k, d_t(i, k), rh, d_rh, rhnew, d_q(i, k)
         ENDIF
@@ -1501,9 +1501,9 @@
     INTEGER k, i
 
-    !print *,'dtime, tau ',dtime,tau
-    !print *, 'u_targ',u_targ
-    !print *, 'v_targ',v_targ
-    !print *,'zonal velocity ',u
-    !print *,'meridional velocity ',v
+    !PRINT *,'dtime, tau ',dtime,tau
+    !PRINT *, 'u_targ',u_targ
+    !PRINT *, 'v_targ',v_targ
+    !PRINT *,'zonal velocity ',u
+    !PRINT *,'meridional velocity ',v
     DO k = 1, klev
       DO i = 1, klon
@@ -1514,5 +1514,5 @@
         d_v(i, k) = d_v(i, k) + 1. / tau * (v_targ(i, k) - v(i, k))
 
-        !           print *,' k,u,d_u,v,d_v ',    &
+        !           PRINT *,' k,u,d_u,v,d_v ',    &
         !                     k,u(i,k),d_u(i,k),v(i,k),d_v(i,k)
         !           ENDIF
@@ -1584,8 +1584,8 @@
 
     !       do l = 1, llm
-    !       print *,'debut interp2, play=',l,play(l)
+    !       PRINT *,'debut interp2, play=',l,play(l)
     !       enddo
     !      do l = 1, nlev_cas
-    !      print *,'debut interp2, plev_prof_cas=',l,play(l),plev_prof_cas(l)
+    !      PRINT *,'debut interp2, plev_prof_cas=',l,play(l),plev_prof_cas(l)
     !      enddo
 
@@ -1594,5 +1594,5 @@
       IF (play(l)>=plev_prof_cas(nlev_cas)) THEN
         mxcalc = l
-        !        print *,'debut interp2, mxcalc=',mxcalc
+        !        PRINT *,'debut interp2, mxcalc=',mxcalc
         k1 = 0
         k2 = 0
@@ -1650,5 +1650,5 @@
           k1 = 1
           k2 = 2
-          print *, 'interp2_vert, k1,k2=', plev_prof_cas(k1), plev_prof_cas(k2)
+          PRINT *, 'interp2_vert, k1,k2=', plev_prof_cas(k1), plev_prof_cas(k2)
           frac1 = (play(l) - plev_prof_cas(k2)) / (plev_prof_cas(k1) - plev_prof_cas(k2))
           frac2 = (play(l) - plev_prof_cas(k1)) / (plev_prof_cas(k1) - plev_prof_cas(k2))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_1dconv.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_1dconv.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_1dconv.f90	(revision 5160)
@@ -176,6 +176,6 @@
       IF (Turb_fcg) icomp1 = icomp1 + nblvlm * 2
       icompt = icomp1 * pas
-      print *, 'imp_fcg,ts_fcg,Turb_fcg,pas,nblvlm,icompt'
-      print *, imp_fcg, ts_fcg, Turb_fcg, pas, nblvlm, icompt
+      PRINT *, 'imp_fcg,ts_fcg,Turb_fcg,pas,nblvlm,icompt'
+      PRINT *, imp_fcg, ts_fcg, Turb_fcg, pas, nblvlm, icompt
       PRINT*, 'le pas pas est:', pas
       !*** on va chercher les nouveaux champs after dans toga.dat     ***
@@ -282,13 +282,13 @@
     endif ! temps.ge.pasmax
 
-    print *, ' time,timebef,timeaft', time, timebef, timeaft
-    print *, ' ht,htbef,htaft,hthturb,hthturbbef,hthturbaft'
+    PRINT *, ' time,timebef,timeaft', time, timebef, timeaft
+    PRINT *, ' ht,htbef,htaft,hthturb,hthturbbef,hthturbaft'
     DO j = 1, klev
-      print *, j, ht(j), htbef(j), htaft(j), &
+      PRINT *, j, ht(j), htbef(j), htaft(j), &
               &             hthturb(j), hthturbbef(j), hthturbaft(j)
     enddo
-    print *, ' hq,hqbef,hqaft,hqturb,hqturbbef,hqturbaft'
+    PRINT *, ' hq,hqbef,hqaft,hqturb,hqturbbef,hqturbaft'
     DO j = 1, klev
-      print *, j, hq(j), hqbef(j), hqaft(j), &
+      PRINT *, j, hq(j), hqbef(j), hqaft(j), &
               &             hqturb(j), hqturbbef(j), hqturbaft(j)
     enddo
@@ -363,6 +363,6 @@
             &, hu_mes, hv_mes, hthturb_mes, hqturb_mes              &
             &, ts_fcg, ts_subr, imp_fcg, Turb_fcg)
-    print *, 'get_uvd : rdgrads ->'
-    print *, tp_fcg
+    PRINT *, 'get_uvd : rdgrads ->'
+    PRINT *, tp_fcg
 
     ! following commented out because we have temperature already in ARM case
@@ -621,5 +621,5 @@
       icomp = icomp + 1
       read(itape, rec = icomp)z(k)
-      print *, 'icomp,k,z(k) ', icomp, k, z(k)
+      PRINT *, 'icomp,k,z(k) ', icomp, k, z(k)
     enddo
     DO k = 1, nl
@@ -643,5 +643,5 @@
       enddo
     endif
-    print *, ' apres lecture hthtur, hqtur'
+    PRINT *, ' apres lecture hthtur, hqtur'
 
     IF(imp_fcg) THEN
@@ -667,5 +667,5 @@
     endif
 
-    print *, ' rdgrads ->'
+    PRINT *, ' rdgrads ->'
 
     RETURN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_lmdz1d.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_lmdz1d.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_lmdz1d.F90	(revision 5160)
@@ -520,5 +520,5 @@
       fnday = -nday / float(day_step)
     endif
-    print *, 'fnday=', fnday
+    PRINT *, 'fnday=', fnday
     !     start_time doit etre en FRACTION DE JOUR
     start_time = time_ini / 24.
@@ -600,5 +600,5 @@
     ! Print out the actual date of the beginning of the simulation :
     CALL ju2ymds(daytime, year_print, month_print, day_print, sec_print)
-    print *, ' Time of beginning : ', &
+    PRINT *, ' Time of beginning : ', &
             year_print, month_print, day_print, sec_print
 
@@ -664,5 +664,5 @@
       fsens = -wtsurf * rcpd * rho(1)
       flat = -wqsurf * rlvtt * rho(1)
-      print *, 'Flux: ok_flux wtsurf wqsurf', ok_flux_surf, wtsurf, wqsurf
+      PRINT *, 'Flux: ok_flux wtsurf wqsurf', ok_flux_surf, wtsurf, wqsurf
     ENDIF
     PRINT*, 'Flux sol ', fsens, flat
@@ -679,5 +679,5 @@
     IF (ok_old_disvert) THEN
       CALL disvert0(pa, preff, ap, bp, dpres, presnivs, nivsigs, nivsig)
-      print *, 'On utilise disvert0'
+      PRINT *, 'On utilise disvert0'
       aps(1:llm) = 0.5 * (ap(1:llm) + ap(2:llm + 1))
       bps(1:llm) = 0.5 * (bp(1:llm) + bp(2:llm + 1))
@@ -686,5 +686,5 @@
     ELSE
       CALL disvert()
-      print *, 'On utilise disvert'
+      PRINT *, 'On utilise disvert'
       !       Nouvelle version disvert permettant d imposer ap,bp (modif L.Guez) MPL 18092012
       !       Dans ce cas, on lit ap,bp dans le fichier hybrid.txt
@@ -703,5 +703,5 @@
         IF (trouve_700 .AND. play(l)<=70000) THEN
           llm700 = l
-          print *, 'llm700,play=', llm700, play(l) / 100.
+          PRINT *, 'llm700,play=', llm700, play(l) / 100.
           trouve_700 = .FALSE.
         endif
@@ -791,5 +791,5 @@
                 fder = 0.
                 snsrf(1, :) = snowmass ! masse de neige des sous surface
-        print *, 'snsrf', snsrf
+        PRINT *, 'snsrf', snsrf
         qsurfsrf(1, :) = qsurf ! humidite de l'air des sous surface
         fevap = 0.
@@ -997,5 +997,5 @@
         ! Print out the actual date of the beginning of the simulation :
         CALL ju2ymds(daytime, an, mois, jour, heure)
-                print *, ' Time of beginning : y m d h', an, mois, jour, heure / 3600.
+                PRINT *, ' Time of beginning : y m d h', an, mois, jour, heure / 3600.
 
                 day = int(daytime)
@@ -1082,5 +1082,5 @@
                 !---------------------------------------------------------------------
                 IF (prt_level>=1) THEN
-                print *, ' avant physiq : -------- day time ', day, time
+                PRINT *, ' avant physiq : -------- day time ', day, time
                 WRITE(*, *) 'firstcall,lastcall,phis', &
                 firstcall, lastcall, phis
@@ -1174,5 +1174,5 @@
                 fcoriolis, xlat, mxcalc
 
-                !       print *,'u-ug=',u-ug
+                !       PRINT *,'u-ug=',u-ug
 
                 !!!!!!!!!!!!!!!!!!!!!!!!
@@ -1184,5 +1184,5 @@
                 sfdt = sin(0.5 * fcoriolis * timestep)
                 cfdt = cos(0.5 * fcoriolis * timestep)
-        !       print *,'fcoriolis,sfdt,cfdt,timestep',fcoriolis,sfdt,cfdt,timestep
+        !       PRINT *,'fcoriolis,sfdt,cfdt,timestep',fcoriolis,sfdt,cfdt,timestep
 
         du_age(1:mxcalc) = -2. * sfdt / timestep * &
@@ -1265,5 +1265,5 @@
 
                 IF (prt_level>=3) THEN
-                print *, &
+                PRINT *, &
                 'physiq-> temp(1),dt_phys(1),d_t_adv(1),dt_cooling(1) ', &
                 temp(1), dt_phys(1), d_t_adv(1), dt_cooling(1)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_scm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_scm.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_scm.F90	(revision 5160)
@@ -347,5 +347,5 @@
       fnday = -nday / float(day_step)
     endif
-    print *, 'fnday=', fnday
+    PRINT *, 'fnday=', fnday
     !     start_time doit etre en FRACTION DE JOUR
     start_time = time_ini / 24.
@@ -372,5 +372,5 @@
     ! Print out the actual date of the beginning of the simulation :
     CALL ju2ymds(daytime, year_print, month_print, day_print, sec_print)
-    print *, ' Time of beginning : ', &
+    PRINT *, ' Time of beginning : ', &
             year_print, month_print, day_print, sec_print
 
@@ -429,5 +429,5 @@
       fsens = -wtsurf * rcpd * rho(1)
       flat = -wqsurf * rlvtt * rho(1)
-      print *, 'Flux: ok_flux wtsurf wqsurf', ok_flux_surf, wtsurf, wqsurf
+      PRINT *, 'Flux: ok_flux wtsurf wqsurf', ok_flux_surf, wtsurf, wqsurf
     ENDIF
     PRINT*, 'Flux sol ', fsens, flat
@@ -440,5 +440,5 @@
     IF (ok_old_disvert) THEN
       CALL disvert0(pa, preff, ap, bp, dpres, presnivs, nivsigs, nivsig)
-      print *, 'On utilise disvert0'
+      PRINT *, 'On utilise disvert0'
       aps(1:llm) = 0.5 * (ap(1:llm) + ap(2:llm + 1))
       bps(1:llm) = 0.5 * (bp(1:llm) + bp(2:llm + 1))
@@ -447,5 +447,5 @@
     ELSE
       CALL disvert()
-      print *, 'On utilise disvert'
+      PRINT *, 'On utilise disvert'
       !       Nouvelle version disvert permettant d imposer ap,bp (modif L.Guez) MPL 18092012
       !       Dans ce cas, on lit ap,bp dans le fichier hybrid.txt
@@ -464,5 +464,5 @@
         IF (trouve_700 .AND. play(l)<=70000) THEN
           llm700 = l
-          print *, 'llm700,play=', llm700, play(l) / 100.
+          PRINT *, 'llm700,play=', llm700, play(l) / 100.
           trouve_700 = .FALSE.
         endif
@@ -750,5 +750,5 @@
                 ! Print out the actual date of the beginning of the simulation :
                 CALL ju2ymds(daytime, an, mois, jour, heure)
-        print *, ' Time of beginning : y m d h', an, mois,jour, heure/3600.
+        PRINT *, ' Time of beginning : y m d h', an, mois,jour, heure/3600.
 
         day = int(daytime)
@@ -844,5 +844,5 @@
                 !---------------------------------------------------------------------
                 IF (prt_level>=1) THEN
-                print *, ' avant physiq : -------- day time ', day, time
+                PRINT *, ' avant physiq : -------- day time ', day, time
                         WRITE(*, *) 'firstcall,lastcall,phis', &
                 firstcall, lastcall, phis
@@ -1019,5 +1019,5 @@
 
                 IF (prt_level>=3) THEN
-                print *, &
+                PRINT *, &
                 'physiq-> temp(1),dt_phys(1),d_t_adv(1),dt_cooling(1) ', &
                 temp(1), dt_phys(1), d_t_adv(1), dt_cooling(1)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90	(revision 5160)
@@ -892,9 +892,9 @@
     !       endif
     timeit = (day - day_ju_ini_cas) * 86400
-    print *, 'day=', day
-    print *, 'day_ju_ini_cas=', day_ju_ini_cas
-    print *, 'pdt_cas=', pdt_cas
-    print *, 'timeit=', timeit
-    print *, 'nt_cas=', nt_cas
+    PRINT *, 'day=', day
+    PRINT *, 'day_ju_ini_cas=', day_ju_ini_cas
+    PRINT *, 'pdt_cas=', pdt_cas
+    PRINT *, 'timeit=', timeit
+    PRINT *, 'nt_cas=', nt_cas
 
     ! Determine the closest observation times:
@@ -912,8 +912,8 @@
     time_cas1 = (it_cas1 - 1) * pdt_cas
     time_cas2 = (it_cas2 - 1) * pdt_cas
-    print *, 'it_cas1=', it_cas1
-    print *, 'it_cas2=', it_cas2
-    print *, 'time_cas1=', time_cas1
-    print *, 'time_cas2=', time_cas2
+    PRINT *, 'it_cas1=', it_cas1
+    PRINT *, 'it_cas2=', it_cas2
+    PRINT *, 'time_cas1=', time_cas1
+    PRINT *, 'time_cas2=', time_cas2
 
     IF (it_cas1 > nt_cas) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 5160)
@@ -363,5 +363,5 @@
     ierr = nf90_inq_varid(nid, 'time', timeid)
     IF(ierr/=nf90_noerr) THEN
-      print *, 'Variable time manquante dans cas.nc:'
+      PRINT *, 'Variable time manquante dans cas.nc:'
       ierr = nf90_noerr
     else
@@ -369,5 +369,5 @@
       ierr = nf90_get_var(nid, timeid, time_val)
       IF(ierr/=nf90_noerr) THEN
-        print *, 'Pb a la lecture de time cas.nc: '
+        PRINT *, 'Pb a la lecture de time cas.nc: '
       endif
     endif
@@ -562,27 +562,27 @@
 
     DO i = 1, nbvar3d
-      print *, 'Dans read_cas2, on va lire ', nid, i, name_var(i)
+      PRINT *, 'Dans read_cas2, on va lire ', nid, i, name_var(i)
     enddo
     DO i = 1, nbvar3d
       ierr = nf90_inq_varid(nid, name_var(i), var3didin(i))
-      print *, 'ierr=', i, ierr, name_var(i), var3didin(i)
+      PRINT *, 'ierr=', i, ierr, name_var(i), var3didin(i)
       IF(ierr/=nf90_noerr) THEN
-        print *, 'Variable manquante dans cas.nc:', name_var(i)
+        PRINT *, 'Variable manquante dans cas.nc:', name_var(i)
       endif
     enddo
     DO i = 1, nbvar3d
-      print *, 'Dans read_cas2, on va lire ', var3didin(i), name_var(i)
+      PRINT *, 'Dans read_cas2, on va lire ', var3didin(i), name_var(i)
       IF(i<=35) THEN
         ierr = nf90_get_var(nid, var3didin(i), resul, count = [1, 1, nlevel, ntime])
-        print *, 'Dans read_cas2, on a lu ', ierr, var3didin(i), name_var(i)
+        PRINT *, 'Dans read_cas2, on a lu ', ierr, var3didin(i), name_var(i)
         IF(ierr/=nf90_noerr) THEN
-          print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+          PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
           stop "getvarup"
         endif
       else
-        print *, 'Dans read_cas2, on a lu ', ierr, var3didin(i), name_var(i)
+        PRINT *, 'Dans read_cas2, on a lu ', ierr, var3didin(i), name_var(i)
         ierr = nf90_get_var(nid, var3didin(i), resul1, count = [1, 1, ntime])
         IF(ierr/=nf90_noerr) THEN
-          print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+          PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
           stop "getvarup"
         endif
@@ -686,5 +686,5 @@
       ierr = nf90_inq_varid(nid, name_var(i), var3didin(i))
       IF(ierr/=nf90_noerr) THEN
-        print *, 'Variable manquante dans cas.nc:', i, name_var(i)
+        PRINT *, 'Variable manquante dans cas.nc:', i, name_var(i)
         ierr = nf90_noerr
         missing_var(i) = 1
@@ -693,7 +693,7 @@
         IF(i<=4) then     ! Lecture des coord pression en (nlevelp1,lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), apbp, count = [1, 1, nlevel + 1])
-          print *, 'read2_cas(apbp), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(apbp), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -701,7 +701,7 @@
         else IF(i>4.AND.i<=45) then   ! Lecture des variables en (time,nlevel,lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), resul, count = [1, 1, nlevel, ntime])
-          print *, 'read2_cas(resul), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(resul), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -709,7 +709,7 @@
         ELSE IF (i>45.AND.i<=51) then   ! Lecture des variables en (time,lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), resul2, count = [1, 1, ntime])
-          print *, 'read2_cas(resul2), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(resul2), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -717,7 +717,7 @@
         else     ! Lecture des constantes (lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), resul3)
-          print *, 'read2_cas(resul3), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(resul3), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -858,5 +858,5 @@
       ierr = nf90_inq_varid(nid, name_var(i), var3didin(i))
       IF(ierr/=nf90_noerr) THEN
-        print *, 'Variable manquante dans cas.nc:', i, name_var(i)
+        PRINT *, 'Variable manquante dans cas.nc:', i, name_var(i)
         ierr = nf90_noerr
         missing_var(i) = 1
@@ -865,7 +865,7 @@
         IF(i<=4) then     ! Lecture des coord pression en (nlevelp1,lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), apbp)
-          print *, 'read2_cas(apbp), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(apbp), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -873,7 +873,7 @@
         else IF(i>4.AND.i<=12) then   ! Lecture des variables en (time,nlevel,lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), resul1)
-          print *, 'read2_cas(resul1), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(resul1), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -882,7 +882,7 @@
         else IF(i>12.AND.i<=54) then   ! Lecture des variables en (time,nlevel,lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), resul)
-          print *, 'read2_cas(resul), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(resul), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -891,7 +891,7 @@
         ELSE IF (i>54.AND.i<=65) then   ! Lecture des variables en (time,lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), resul2)
-          print *, 'read2_cas(resul2), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(resul2), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -900,7 +900,7 @@
         else     ! Lecture des constantes (lat,lon)
           ierr = nf90_get_var(nid, var3didin(i), resul3)
-          print *, 'read2_cas(resul3), on a lu ', i, name_var(i)
+          PRINT *, 'read2_cas(resul3), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -1107,9 +1107,9 @@
     !       endif
     timeit = (day - day_ju_ini_cas) * 86400
-    !print *,'day=',day
-    !print *,'day_ju_ini_cas=',day_ju_ini_cas
-    !print *,'pdt_cas=',pdt_cas
-    !print *,'timeit=',timeit
-    !print *,'nt_cas=',nt_cas
+    !PRINT *,'day=',day
+    !PRINT *,'day_ju_ini_cas=',day_ju_ini_cas
+    !PRINT *,'pdt_cas=',pdt_cas
+    !PRINT *,'timeit=',timeit
+    !PRINT *,'nt_cas=',nt_cas
 
     ! Determine the closest observation times:
@@ -1127,5 +1127,5 @@
     time_cas1 = (it_cas1 - 1) * pdt_cas
     time_cas2 = (it_cas2 - 1) * pdt_cas
-    !print *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2
+    !PRINT *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2
 
     IF (it_cas1 > nt_cas) THEN
@@ -1319,9 +1319,9 @@
     !       endif
     timeit = (day - day_ju_ini_cas) * 86400
-    !print *,'day=',day
-    !print *,'day_ju_ini_cas=',day_ju_ini_cas
-    !print *,'pdt_cas=',pdt_cas
-    !print *,'timeit=',timeit
-    !print *,'nt_cas=',nt_cas
+    !PRINT *,'day=',day
+    !PRINT *,'day_ju_ini_cas=',day_ju_ini_cas
+    !PRINT *,'pdt_cas=',pdt_cas
+    !PRINT *,'timeit=',timeit
+    !PRINT *,'nt_cas=',nt_cas
 
     ! Determine the closest observation times:
@@ -1339,6 +1339,6 @@
     time_cas1 = (it_cas1 - 1) * pdt_cas
     time_cas2 = (it_cas2 - 1) * pdt_cas
-    !print *,'timeit,pdt_cas,nt_cas=',timeit,pdt_cas,nt_cas
-    !print *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2
+    !PRINT *,'timeit,pdt_cas,nt_cas=',timeit,pdt_cas,nt_cas
+    !PRINT *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2
 
     IF (it_cas1 > nt_cas) THEN
@@ -1372,5 +1372,5 @@
       t_prof_cas(k) = t_cas(k, it_cas2)                                 &
               - frac * (t_cas(k, it_cas2) - t_cas(k, it_cas1))
-      !print *,'k,frac,plev_cas1,plev_cas2=',k,frac,plev_cas(k,it_cas1),plev_cas(k,it_cas2)
+      !PRINT *,'k,frac,plev_cas1,plev_cas2=',k,frac,plev_cas(k,it_cas1),plev_cas(k,it_cas2)
       theta_prof_cas(k) = theta_cas(k, it_cas2)                         &
               - frac * (theta_cas(k, it_cas2) - theta_cas(k, it_cas1))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 5160)
@@ -140,5 +140,5 @@
     ierr = nf90_inq_varid(nid, 'time', timeid)
     IF(ierr/=nf90_noerr) THEN
-      print *, 'Variable time manquante dans cas.nc:'
+      PRINT *, 'Variable time manquante dans cas.nc:'
       ierr = nf90_noerr
     else
@@ -146,5 +146,5 @@
       ierr = nf90_get_var(nid, timeid, time_val)
       IF(ierr/=nf90_noerr) THEN
-        print *, 'A Pb a la lecture de time cas.nc: '
+        PRINT *, 'A Pb a la lecture de time cas.nc: '
       endif
     endif
@@ -425,5 +425,5 @@
       PRINT*, 'name_var(i)', name_var(i), var3didin(i)
       IF(ierr/=nf90_noerr) THEN
-        print *, 'Variable manquante dans cas.nc:', i, name_var(i)
+        PRINT *, 'Variable manquante dans cas.nc:', i, name_var(i)
         ierr = nf90_noerr
         missing_var(i) = 1
@@ -448,7 +448,7 @@
         IF(i<=4) THEN
           ierr = nf90_get_var(nid, var3didin(i), apbp)
-          print *, 'read_SCM(apbp), on a lu ', i, name_var(i)
+          PRINT *, 'read_SCM(apbp), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'B Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'B Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -459,7 +459,7 @@
         else IF(i>4.AND.i<=12) THEN
           ierr = nf90_get_var(nid, var3didin(i), resul1)
-          print *, 'read_SCM(resul1), on a lu ', i, name_var(i)
+          PRINT *, 'read_SCM(resul1), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'C Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'C Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -472,7 +472,7 @@
         else IF(i>12.AND.i<=61) THEN
           ierr = nf90_get_var(nid, var3didin(i), resul)
-          print *, 'read_SCM(resul), on a lu ', i, name_var(i)
+          PRINT *, 'read_SCM(resul), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'D Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'D Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -484,7 +484,7 @@
         ELSE IF (i>62.AND.i<=75) THEN
           ierr = nf90_get_var(nid, var3didin(i), resul2)
-          print *, 'read_SCM(resul2), on a lu ', i, name_var(i)
+          PRINT *, 'read_SCM(resul2), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'E Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'E Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -496,7 +496,7 @@
         else
           ierr = nf90_get_var(nid, var3didin(i), resul3)
-          print *, 'read_SCM(resul3), on a lu ', i, name_var(i)
+          PRINT *, 'read_SCM(resul3), on a lu ', i, name_var(i)
           IF(ierr/=nf90_noerr) THEN
-            print *, 'F Pb a la lecture de cas.nc: ', name_var(i)
+            PRINT *, 'F Pb a la lecture de cas.nc: ', name_var(i)
             stop "getvarup"
           endif
@@ -748,9 +748,9 @@
     !       endif
     timeit = (day - day_ju_ini_cas) * 86400
-    print *, 'day=', day
-    print *, 'day_ju_ini_cas=', day_ju_ini_cas
-    print *, 'pdt_cas=', pdt_cas
-    print *, 'timeit=', timeit
-    print *, 'nt_cas=', nt_cas
+    PRINT *, 'day=', day
+    PRINT *, 'day_ju_ini_cas=', day_ju_ini_cas
+    PRINT *, 'pdt_cas=', pdt_cas
+    PRINT *, 'timeit=', timeit
+    PRINT *, 'nt_cas=', nt_cas
 
     ! Determine the closest observation times:
@@ -768,6 +768,6 @@
     time_cas1 = (it_cas1 - 1) * pdt_cas
     time_cas2 = (it_cas2 - 1) * pdt_cas
-    !     print *,'timeit,pdt_cas,nt_cas=',timeit,pdt_cas,nt_cas
-    !     print *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2
+    !     PRINT *,'timeit,pdt_cas,nt_cas=',timeit,pdt_cas,nt_cas
+    !     PRINT *,'it_cas1,it_cas2,time_cas1,time_cas2=',it_cas1,it_cas2,time_cas1,time_cas2
 
     IF (it_cas1 > nt_cas) THEN
@@ -805,5 +805,5 @@
       t_prof_cas(k) = t_cas(k, it_cas2)                                 &
               - frac * (t_cas(k, it_cas2) - t_cas(k, it_cas1))
-      !print *,'k,frac,plev_cas1,plev_cas2=',k,frac,plev_cas(k,it_cas1),plev_cas(k,it_cas2)
+      !PRINT *,'k,frac,plev_cas1,plev_cas2=',k,frac,plev_cas(k,it_cas1),plev_cas(k,it_cas2)
       theta_prof_cas(k) = theta_cas(k, it_cas2)                         &
               - frac * (theta_cas(k, it_cas2) - theta_cas(k, it_cas1))
@@ -976,5 +976,5 @@
       IF (play(l)>=plev_prof_cas(nlev_cas)) THEN
         mxcalc = l
-        !        print *,'debut interp2, mxcalc=',mxcalc
+        !        PRINT *,'debut interp2, mxcalc=',mxcalc
         k1 = 0
         k2 = 0
@@ -1044,5 +1044,5 @@
           k1 = 1
           k2 = 2
-          print *, 'interp2_vert, k1,k2=', plev_prof_cas(k1), plev_prof_cas(k2)
+          PRINT *, 'interp2_vert, k1,k2=', plev_prof_cas(k1), plev_prof_cas(k2)
           frac1 = (play(l) - plev_prof_cas(k2)) / (plev_prof_cas(k1) - plev_prof_cas(k2))
           frac2 = (play(l) - plev_prof_cas(k1)) / (plev_prof_cas(k1) - plev_prof_cas(k2))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 5160)
@@ -89,5 +89,5 @@
       read(21,'(a)')
       read(21,223) iy, im, id, ih, ts_sandu(ip)
-      print *,'ts=',iy,im,id,ih,ip,ts_sandu(ip)
+      PRINT *,'ts=',iy,im,id,ih,ip,ts_sandu(ip)
       enddo
       close(21)
@@ -130,5 +130,5 @@
      &ug_astex(ip),vg_astex(ip),ufa_astex(ip),vfa_astex(ip)
       ts_astex(ip)=ts_astex(ip)+273.15
-      print *,'ts=',iy,im,id,ih,ip,div_astex(ip),ts_astex(ip),             &
+      PRINT *,'ts=',iy,im,id,ih,ip,div_astex(ip),ts_astex(ip),             &
      &ug_astex(ip),vg_astex(ip),ufa_astex(ip),vg_astex(ip)
       enddo
@@ -643,5 +643,5 @@
 
        DO l = 1,llm
-!      print *,'t_mod(l),thl_mod(l),q_mod(l),u_mod(l),v_mod(l) ',
+!      PRINT *,'t_mod(l),thl_mod(l),q_mod(l),u_mod(l),v_mod(l) ',
 !    $        l,t_mod(l),thl_mod(l),q_mod(l),u_mod(l),v_mod(l)
        enddo
@@ -763,5 +763,5 @@
 
        DO l = 1,llm
-!      print *,'t_mod(l),thl_mod(l),qv_mod(l),u_mod(l),v_mod(l) ',
+!      PRINT *,'t_mod(l),thl_mod(l),qv_mod(l),u_mod(l),v_mod(l) ',
 !    $        l,t_mod(l),thl_mod(l),qv_mod(l),u_mod(l),v_mod(l)
        enddo
@@ -985,6 +985,6 @@
        time_sandu1=(it_sandu1-1)*dt_sandu
        time_sandu2=(it_sandu2-1)*dt_sandu
-       print *,'timeit day day_ini_sandu',timeit,day,day_ini_sandu
-       print *,'it_sandu1,it_sandu2,time_sandu1,time_sandu2',              &
+       PRINT *,'timeit day day_ini_sandu',timeit,day,day_ini_sandu
+       PRINT *,'it_sandu1,it_sandu2,time_sandu1,time_sandu2',              &
      &          it_sandu1,it_sandu2,time_sandu1,time_sandu2
 
@@ -1037,5 +1037,5 @@
       read(21,223) iy, im, id, ih, in, sens(ip),flat(ip),                  &
      &             adv_theta(ip),rad_theta(ip),adv_qt(ip)
-      print *,'forcages=',iy,im,id,ih,in, sens(ip),flat(ip),               &
+      PRINT *,'forcages=',iy,im,id,ih,in, sens(ip),flat(ip),               &
      &             adv_theta(ip),rad_theta(ip),adv_qt(ip)
       enddo
@@ -1159,5 +1159,5 @@
 
 !       do l = 1,llm
-!       print *,'t_mod(l),q_mod(l),ht_mod(l),hq_mod(l) ',
+!       PRINT *,'t_mod(l),q_mod(l),ht_mod(l),hq_mod(l) ',
 !     $        l,t_mod(l),q_mod(l),ht_mod(l),hq_mod(l)
 !       enddo
@@ -1319,5 +1319,5 @@
 
 !       do l = 1,llm
-!       print *,'t_mod_cas(l),q_mod_cas(l),ht_mod_cas(l),hq_mod_cas(l) ',
+!       PRINT *,'t_mod_cas(l),q_mod_cas(l),ht_mod_cas(l),hq_mod_cas(l) ',
 !     $        l,t_mod_cas(l),q_mod_cas(l),ht_mod_cas(l),hq_mod_cas(l)
 !       enddo
@@ -1441,5 +1441,5 @@
 
 !       do l = 1,llm
-!       print *,'t_mod(l),q_mod(l),ht_mod(l),hq_mod(l) ',
+!       PRINT *,'t_mod(l),q_mod(l),ht_mod(l),hq_mod(l) ',
 !     $        l,t_mod(l),q_mod(l),ht_mod(l),hq_mod(l)
 !       enddo
@@ -1504,6 +1504,6 @@
        time_astex1=(it_astex1-1)*dt_astex
        time_astex2=(it_astex2-1)*dt_astex
-       print *,'timeit day day_ini_astex',timeit,day,day_ini_astex
-       print *,'it_astex1,it_astex2,time_astex1,time_astex2',              &
+       PRINT *,'timeit day day_ini_astex',timeit,day,day_ini_astex
+       PRINT *,'it_astex1,it_astex2,time_astex1,time_astex2',              &
      &          it_astex1,it_astex2,time_astex1,time_astex2
 
@@ -1726,7 +1726,7 @@
         IF (forcing_type.EQ.7) THEN
 ! Check that initial day of the simulation consistent with Dice period:
-       print *,'annee_ref=',annee_ref
-       print *,'day1=',day1
-       print *,'day_ini_dice=',day_ini_dice
+       PRINT *,'annee_ref=',annee_ref
+       PRINT *,'day1=',day1
+       PRINT *,'day_ini_dice=',day_ini_dice
        IF (annee_ref.NE.1999) THEN
         PRINT*,'Pour Dice, annee_ref doit etre 1999'
@@ -1835,7 +1835,7 @@
 ! Check that initial day of the simulation consistent with gabls4 period:
        IF (forcing_type.EQ.8 ) THEN
-       print *,'annee_ref=',annee_ref
-       print *,'day1=',day1
-       print *,'day_ini_gabls4=',day_ini_gabls4
+       PRINT *,'annee_ref=',annee_ref
+       PRINT *,'day1=',day1
+       PRINT *,'day_ini_gabls4=',day_ini_gabls4
        IF (annee_ref.NE.2009) THEN
         PRINT*,'Pour gabls4, annee_ref doit etre 2009'
@@ -1856,6 +1856,6 @@
 
       timeit=(day-day_ini_gabls4)*86400
-       print *,'day,day_ini_gabls4=',day,day_ini_gabls4
-       print *,'nt_gabls4,dt,timeit=',nt_gabls4,dt_gabls4,timeit
+       PRINT *,'day,day_ini_gabls4=',day,day_ini_gabls4
+       PRINT *,'nt_gabls4,dt,timeit=',nt_gabls4,dt_gabls4,timeit
 
 ! Determine the closest observation times:
@@ -1931,6 +1931,6 @@
        time_armcu1=(it_armcu1-1)*dt_armcu
        time_armcu2=(it_armcu2-1)*dt_armcu
-       print *,'timeit day day_ini_armcu',timeit,day,day_ini_armcu
-       print *,'it_armcu1,it_armcu2,time_armcu1,time_armcu2',              &
+       PRINT *,'timeit day day_ini_armcu',timeit,day,day_ini_armcu
+       PRINT *,'it_armcu1,it_armcu2,time_armcu1,time_armcu2',              &
      &          it_armcu1,it_armcu2,time_armcu1,time_armcu2
 
@@ -2001,6 +2001,6 @@
         read (ilesfile,*) kmax2
         IF (kmax .NE. kmax2) THEN
-          print *, 'fichiers prof.inp et lscale.inp incompatibles :'
-          print *, 'nbre de niveaux : ',kmax,' et ',kmax2
+          PRINT *, 'fichiers prof.inp et lscale.inp incompatibles :'
+          PRINT *, 'nbre de niveaux : ',kmax,' et ',kmax2
           stop 'lecture profiles'
         endif
@@ -2011,6 +2011,6 @@
         DO k=1,kmax
           IF (height(k) .NE. height1(k)) THEN
-            print *, 'fichiers prof.inp et lscale.inp incompatibles :'
-            print *, 'les niveaux different : ',k,height1(k), height(k)
+            PRINT *, 'fichiers prof.inp et lscale.inp incompatibles :'
+            PRINT *, 'les niveaux different : ',k,height1(k), height(k)
             stop
           endif
@@ -2027,6 +2027,6 @@
         endif
         IF (kmax .NE. kmax2) THEN
-          print *, 'fichiers prof.inp et lscale.inp incompatibles :'
-          print *, 'nbre de niveaux : ',kmax,' et ',kmax2
+          PRINT *, 'fichiers prof.inp et lscale.inp incompatibles :'
+          PRINT *, 'nbre de niveaux : ',kmax,' et ',kmax2
           stop 'lecture profiles'
         endif
@@ -2128,8 +2128,8 @@
        IF(nlev_max.EQ.19) THEN
        open (ilesfile,file='prof.inp.19',status='old',iostat=ierr)
-       print *,'On ouvre prof.inp.19'
+       PRINT *,'On ouvre prof.inp.19'
        ELSE
        open (ilesfile,file='prof.inp.40',status='old',iostat=ierr)
-       print *,'On ouvre prof.inp.40'
+       PRINT *,'On ouvre prof.inp.40'
        ENDIF
         IF (ierr /= 0) stop 'ERROR:Prof.inp does not exist'
@@ -2144,9 +2144,9 @@
        IF(nlev_max.EQ.19) THEN
        open (ifile,file='proh.inp.19',status='old',iostat=ierr)
-       print *,'On ouvre proh.inp.19'
+       PRINT *,'On ouvre proh.inp.19'
        IF (ierr /= 0) stop 'ERROR:Proh.inp.19 does not exist'
        ELSE
        open (ifile,file='proh.inp.40',status='old',iostat=ierr)
-       print *,'On ouvre proh.inp.40'
+       PRINT *,'On ouvre proh.inp.40'
        IF (ierr /= 0) stop 'ERROR:Proh.inp.40 does not exist'
        ENDIF
@@ -2939,5 +2939,5 @@
            vg(k,:)=vg_i(nlevel+1-k,:)
            pf(k)=pf_i(nlevel+1-k)
-           print *,'pf=',pf(k)
+           PRINT *,'pf=',pf(k)
            th(k)=th_i(nlevel+1-k)
            t(k)=t_i(nlevel+1-k)
@@ -2993,5 +2993,5 @@
       read (11, '(f10.4)') sw_dn_toa
       sza=cos(za/180.*RPI)
-      print *,'nlev,tsfc,sza,sw_dn_toa,RPI',nlev,tsfc,sza,sw_dn_toa,RPI
+      PRINT *,'nlev,tsfc,sza,sw_dn_toa,RPI',nlev,tsfc,sza,sw_dn_toa,RPI
       close(11)
 
@@ -3088,5 +3088,5 @@
       DO il=1,39
          plev(il)=play(il)+(play(il+1)-play(il))/2.
-         print *,'il p t ovap oz=',il,plev(il),temp(il),ovap(il),oz(il)
+         PRINT *,'il p t ovap oz=',il,plev(il),temp(il),ovap(il),oz(il)
       enddo
       plev(41)=101300.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_interp_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_interp_cases.h	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_interp_cases.h	(revision 5160)
@@ -22,5 +22,5 @@
      &               Tp_fcg_gcssold,Turb_fcg_gcssold)
        IF (prt_level.ge.1) THEN
-         print *,' get_uvd -> hqturb_gcssold ',it,hqturb_gcssold
+         PRINT *,' get_uvd -> hqturb_gcssold ',it,hqturb_gcssold
        endif
 ! large-scale forcing :
@@ -108,5 +108,5 @@
      &             ,omega_profd)
 !     do l = 1, llm
-!     print *,'llm l omega_profd',llm,l,omega_profd(l)
+!     PRINT *,'llm l omega_profd',llm,l,omega_profd(l)
 !     enddo
 ! EV tg instead of ts_cur
@@ -120,5 +120,5 @@
      &         ,ht_mod,hq_mod,hu_mod,hv_mod,w_mod,omega_mod,mxcalc)
 !     do l = 1, llm
-!      print *,'llm l omega_mod',llm,l,omega_mod(l)
+!      PRINT *,'llm l omega_mod',llm,l,omega_mod(l)
 !     enddo
 
@@ -168,5 +168,5 @@
       ust=ustar_prof
       tg=tg_prof
-      print *,'ust= ',ust
+      PRINT *,'ust= ',ust
       DO l = 1, llm
        ug(l)= ug_profd
@@ -453,5 +453,5 @@
          d_q_adv(l,1) = adv_qt_prof/1000./3600.
          d_q_adv(l,2) = 0.0
-!        print *,'INF1000: phi dth dq1 dq2',
+!        PRINT *,'INF1000: phi dth dq1 dq2',
 !    :  phi(l)/RG,d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
        ELSEIF ((phi(l)/RG).GE.1000.AND.(phi(l)/RG).lt.3000) THEN
@@ -461,5 +461,5 @@
          d_q_adv(l,1) = adv_qt_prof*fact/1000./3600.
          d_q_adv(l,2) = 0.0
-!        print *,'SUP1000: phi fact dth dq1 dq2',
+!        PRINT *,'SUP1000: phi fact dth dq1 dq2',
 !    :  phi(l)/RG,fact,d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
        ELSE
@@ -467,9 +467,9 @@
          d_q_adv(l,1) = 0.0
          d_q_adv(l,2) = 0.0
-!        print *,'SUP3000: phi dth dq1 dq2',
+!        PRINT *,'SUP3000: phi dth dq1 dq2',
 !    :  phi(l)/RG,d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
        ENDIF
       dt_cooling(l) = 0.0  
-!     print *,'Interp armcu: phi dth dq1 dq2',
+!     PRINT *,'Interp armcu: phi dth dq1 dq2',
 !    :  l,phi(l),d_t_adv(l),d_q_adv(l,1),d_q_adv(l,2)
       enddo
@@ -517,5 +517,5 @@
        d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l))
        d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l))
-!     print *,'l temp2 temp0 play2 play0 omega_mod',
+!     PRINT *,'l temp2 temp0 play2 play0 omega_mod',
 !    & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l)
       ENDDO
@@ -530,5 +530,5 @@
       d_q_dyn_z(:)=omega_mod(:)*d_q_z(:)
 !     do l=1,llm
-!      print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z',
+!      PRINT *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z',
 !    :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l)
 !     enddo
@@ -598,5 +598,5 @@
        d_t_z(l)=(temp(l+1)-temp(l))/(play(l+1)-play(l))
        d_q_z(l)=(q(l+1,1)-q(l,1))/(play(l+1)-play(l))
-!     print *,'l temp2 temp0 play2 play0 omega_mod',
+!     PRINT *,'l temp2 temp0 play2 play0 omega_mod',
 !    & temp(l+1),temp(l-1),play(l+1),play(l-1),omega_mod(l)
       ENDDO
@@ -611,5 +611,5 @@
       d_q_dyn_z(:)=w_mod(:)*d_q_z(:)
 !     do l=1,llm
-!      print *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z',
+!      PRINT *,'d_t_dyn omega_mod d_t_z d_q_dyn d_q_z',
 !    :l,d_t_dyn_z(l),omega_mod(l),d_t_z(l),d_q_dyn_z(l),d_q_z(l)
 !     enddo
@@ -792,5 +792,5 @@
         IF (tend_rayo.EQ.1) THEN
            dt_cooling(l) = dtrad_mod_cas(l)
-!          print *,'dt_cooling=',dt_cooling(l)
+!          PRINT *,'dt_cooling=',dt_cooling(l)
         else
            dt_cooling(l) = 0.0
@@ -806,5 +806,5 @@
       IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
-       print *,'ust=',ust
+       PRINT *,'ust=',ust
       ENDIF
       endif ! forcing_case
@@ -1001,5 +1001,5 @@
            tend_rayo=1
            dt_cooling(l) = dtrad_mod_cas(l)
-!          print *,'dt_cooling=',dt_cooling(l)
+!          PRINT *,'dt_cooling=',dt_cooling(l)
         else
            dt_cooling(l) = 0.0
@@ -1011,10 +1011,10 @@
        fsens=-1.*sens_prof_cas
        flat=-1.*lat_prof_cas
-       print *,'1D_interp: sens,flat',fsens,flat
+       PRINT *,'1D_interp: sens,flat',fsens,flat
       ENDIF
 
       IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
-       print *,'ust=',ust
+       PRINT *,'ust=',ust
       ENDIF
       endif ! forcing_case2
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_read_forc_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_read_forc_cases.h	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_read_forc_cases.h	(revision 5160)
@@ -62,5 +62,5 @@
           teta(l) = ttt*(pzero/play(l))**rkappa
        endif
-          print *,' temp,teta ',l,temp(l),teta(l)
+          PRINT *,' temp,teta ',l,temp(l),teta(l)
         q(l,1)  = qtprof(kmax)-frac*( qtprof(kmax)- qtprof(kmax-1))
         u(l)    =  uprof(kmax)-frac*(  uprof(kmax)-  uprof(kmax-1))
@@ -75,5 +75,5 @@
         dt_cooling(l)=thlpcar(kmax)-frac*(thlpcar(kmax)-thlpcar(kmax-1))
         DO k=2,kmax
-          print *,'k l height(k) height(k-1) zlay(l) frac=',k,l,height(k),height(k-1),zlay(l),frac
+          PRINT *,'k l height(k) height(k-1) zlay(l) frac=',k,l,height(k),height(k-1),zlay(l),frac
           frac = (height(k)-zlay(l))/(height(k)-height(k-1))
           IF(l==1) PRINT*,'k, height, tttprof',k,height(k),tttprof(k)
@@ -87,5 +87,5 @@
           teta(l) = ttt*(pzero/play(l))**rkappa
        endif
-          print *,' temp,teta ',l,temp(l),teta(l)
+          PRINT *,' temp,teta ',l,temp(l),teta(l)
             q(l,1)  = qtprof(k)-frac*( qtprof(k)- qtprof(k-1))
             u(l)    =  uprof(k)-frac*(  uprof(k)-  uprof(k-1))
@@ -151,5 +151,5 @@
      &               imp_fcg_gcssold,ts_fcg_gcssold,                        &
      &               Tp_fcg_gcssold,Turb_fcg_gcssold)
-       print *,' get_uvd2 -> hqturb_gcssold ',hqturb_gcssold
+       PRINT *,' get_uvd2 -> hqturb_gcssold ',hqturb_gcssold
       endif ! forcing_GCSSold
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -166,5 +166,5 @@
 
        mxcalc=llm
-       print *, airefi, ' airefi '
+       PRINT *, airefi, ' airefi '
        DO l = 1, llm
        rho(l)  = play(l)/(rd*t_rico(l)*(1.+(rv/rd-1.)*q_rico(l)))
@@ -328,5 +328,5 @@
        q(l,1) = q_mod(l)
        q(l,2) = 0.0
-!      print *,'read_forc: l,temp,q=',l,temp(l),q(l,1)
+!      PRINT *,'read_forc: l,temp,q=',l,temp(l),q(l,1)
        u(l) = u_mod(l)
        v(l) = v_mod(l)
@@ -426,5 +426,5 @@
        q(l,1) = qv_mod(l)
        q(l,2) = 0.0
-!      print *,'read_forc: l,temp,q=',l,temp(l),q(l,1)
+!      PRINT *,'read_forc: l,temp,q=',l,temp(l),q(l,1)
        u(l) = u_mod(l)
        v(l) = v_mod(l)
@@ -458,5 +458,5 @@
       ust=ustar_dice(1)
       tg=tg_dice(1)
-      print *,'ust= ',ust
+      PRINT *,'ust= ',ust
       IF (tsurf .LE. 0.) THEN
        tsurf= tg_dice(1)
@@ -533,5 +533,5 @@
        q(l,1) = qv_mod(l)
        q(l,2) = 0.0
-!      print *,'read_forc: l,temp,q=',l,temp(l),q(l,1)
+!      PRINT *,'read_forc: l,temp,q=',l,temp(l),q(l,1)
        u(l) = u_mod(l)
        v(l) = v_mod(l)
@@ -541,5 +541,5 @@
 !    tg=tsurf
 
-       print *,'***** tsurf=',tsurf
+       PRINT *,'***** tsurf=',tsurf
        rho(l)  = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1)))
 !      omega(l) = w_mod(l)*(-rg*rho(l))
@@ -567,5 +567,5 @@
 !     ust=ustar_dice(1)
 !     tg=tg_dice(1)
-!     print *,'ust= ',ust
+!     PRINT *,'ust= ',ust
 !     IF (tsurf .LE. 0.) THEN
 !      tsurf= tg_dice(1)
@@ -613,13 +613,13 @@
       WRITE(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',day,day1
 
-      print *,'Avant interp_armcu_time'
-      print *,'daytime=',daytime
-      print *,'day1=',day1
-      print *,'annee_ref=',annee_ref
-      print *,'year_ini_armcu=',year_ini_armcu
-      print *,'day_ju_ini_armcu=',day_ju_ini_armcu
-      print *,'nt_armcu=',nt_armcu
-      print *,'dt_armcu=',dt_armcu
-      print *,'nlev_armcu=',nlev_armcu
+      PRINT *,'Avant interp_armcu_time'
+      PRINT *,'daytime=',daytime
+      PRINT *,'day1=',day1
+      PRINT *,'annee_ref=',annee_ref
+      PRINT *,'year_ini_armcu=',year_ini_armcu
+      PRINT *,'day_ju_ini_armcu=',day_ju_ini_armcu
+      PRINT *,'nt_armcu=',nt_armcu
+      PRINT *,'dt_armcu=',dt_armcu
+      PRINT *,'nlev_armcu=',nlev_armcu
       CALL interp_armcu_time(daytime,day1,annee_ref                         &
      &            ,year_ini_armcu,day_ju_ini_armcu,nt_armcu,dt_armcu        &
@@ -672,5 +672,5 @@
       DO l = 1, llm
       plev(l+1) = ap(llm-l+1)+bp(llm-l+1)*psurf
-      print *,'Read_forc: l height play plev zlay temp',                    &
+      PRINT *,'Read_forc: l height play plev zlay temp',                    &
      &   l,height(l),play(l),plev(l),zlay(l),temp(l)
       enddo
@@ -707,13 +707,13 @@
 ! revoir 1DUTILS.h et les arguments
 
-      print *,'Avant interp_sandu_time'
-      print *,'daytime=',daytime
-      print *,'day1=',day1
-      print *,'annee_ref=',annee_ref
-      print *,'year_ini_sandu=',year_ini_sandu
-      print *,'day_ju_ini_sandu=',day_ju_ini_sandu
-      print *,'nt_sandu=',nt_sandu
-      print *,'dt_sandu=',dt_sandu
-      print *,'nlev_sandu=',nlev_sandu
+      PRINT *,'Avant interp_sandu_time'
+      PRINT *,'daytime=',daytime
+      PRINT *,'day1=',day1
+      PRINT *,'annee_ref=',annee_ref
+      PRINT *,'year_ini_sandu=',year_ini_sandu
+      PRINT *,'day_ju_ini_sandu=',day_ju_ini_sandu
+      PRINT *,'nt_sandu=',nt_sandu
+      PRINT *,'dt_sandu=',dt_sandu
+      PRINT *,'nlev_sandu=',nlev_sandu
       CALL interp_sandu_time(daytime,day1,annee_ref                         &
      &             ,year_ini_sandu,day_ju_ini_sandu,nt_sandu,dt_sandu       &
@@ -722,5 +722,5 @@
 
 ! vertical interpolation:
-      print *,'Avant interp_vertical: nlev_sandu=',nlev_sandu
+      PRINT *,'Avant interp_vertical: nlev_sandu=',nlev_sandu
       CALL interp_sandu_vertical(play,nlev_sandu,plev_profs                 &
      &         ,t_profs,thl_profs,q_profs,u_profs,v_profs,w_profs           &
@@ -782,13 +782,13 @@
 ! revoir 1DUTILS.h et les arguments
 
-      print *,'Avant interp_astex_time'
-      print *,'daytime=',daytime
-      print *,'day1=',day1
-      print *,'annee_ref=',annee_ref
-      print *,'year_ini_astex=',year_ini_astex
-      print *,'day_ju_ini_astex=',day_ju_ini_astex
-      print *,'nt_astex=',nt_astex
-      print *,'dt_astex=',dt_astex
-      print *,'nlev_astex=',nlev_astex
+      PRINT *,'Avant interp_astex_time'
+      PRINT *,'daytime=',daytime
+      PRINT *,'day1=',day1
+      PRINT *,'annee_ref=',annee_ref
+      PRINT *,'year_ini_astex=',year_ini_astex
+      PRINT *,'day_ju_ini_astex=',day_ju_ini_astex
+      PRINT *,'nt_astex=',nt_astex
+      PRINT *,'dt_astex=',dt_astex
+      PRINT *,'nlev_astex=',nlev_astex
       CALL interp_astex_time(daytime,day1,annee_ref                         &
      &             ,year_ini_astex,day_ju_ini_astex,nt_astex,dt_astex       &
@@ -798,5 +798,5 @@
 
 ! vertical interpolation:
-      print *,'Avant interp_vertical: nlev_astex=',nlev_astex
+      PRINT *,'Avant interp_vertical: nlev_astex=',nlev_astex
       CALL interp_astex_vertical(play,nlev_astex,plev_profa                 &
      &         ,t_profa,thl_profa,qv_profa,ql_profa,qt_profa                &
@@ -900,5 +900,5 @@
        IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
-       print *,'ust=',ust
+       PRINT *,'ust=',ust
        ENDIF
 
@@ -935,5 +935,5 @@
 
       DO l = 1, nlev_cas
-      print *,'apres 1ere interp: plev_cas, plev_prof_cas=',l,plev_cas(l,1),plev_prof_cas(l)
+      PRINT *,'apres 1ere interp: plev_cas, plev_prof_cas=',l,plev_cas(l,1),plev_prof_cas(l)
       enddo
 
@@ -997,5 +997,5 @@
        IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
-       print *,'ust=',ust
+       PRINT *,'ust=',ust
        ENDIF
 
@@ -1033,5 +1033,5 @@
 
       DO l = 1, nlev_cas
-      print *,'apres 1ere interp: plev_cas, plev_prof_cas=',l,plev_cas(l,1),plev_prof_cas(l)
+      PRINT *,'apres 1ere interp: plev_cas, plev_prof_cas=',l,plev_cas(l,1),plev_prof_cas(l)
       enddo
 
@@ -1096,5 +1096,5 @@
        IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
-       print *,'ust=',ust
+       PRINT *,'ust=',ust
        ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_monochromatic.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_monochromatic.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_monochromatic.F90	(revision 5160)
@@ -293,5 +293,5 @@
              &  ', longwave optical depth = ', &
              &  sum(od_lw_cloud(1,:,jcol)*cloud%fraction(jcol,:))
-        !    print *, 'LWP = ', sum(lwp_kg_m2(:,istartcol)*cloud%fraction(istartcol,:))
+        !    PRINT *, 'LWP = ', sum(lwp_kg_m2(:,istartcol)*cloud%fraction(istartcol,:))
       end do
     end if
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_aerosol_optics_description.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_aerosol_optics_description.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_aerosol_optics_description.F90	(revision 5160)
@@ -33,16 +33,16 @@
 
   ! These two should issue a warning that the aerosol type is ambiguous
-  print *, 'DD: ', aer_desc%get_index('DD',.false.)
-  print *, 'DD (bin=2): ', aer_desc%get_index('DD',.false.,ibin=2)
+  PRINT *, 'DD: ', aer_desc%get_index('DD',.false.)
+  PRINT *, 'DD (bin=2): ', aer_desc%get_index('DD',.false.,ibin=2)
   ! Indicate preferred aerosol optical model, after which further
   ! calls will prefer one particular model
-  print *, 'preferred_optical_model(DD,Fouquart)'
+  PRINT *, 'preferred_optical_model(DD,Fouquart)'
   call aer_desc%preferred_optical_model('DD','Fouquart')
-  print *, 'DD (bin=2): ', aer_desc%get_index('DD',.false.,ibin=2)
-  print *, 'DD (bin=2,model=Woodward): ', aer_desc%get_index('DD',.false.,ibin=2,optical_model_str="Woodward")
-  print *, 'DD (bin=2,model=Woodward2001): ', aer_desc%get_index('DD',.false.,ibin=2,optical_model_str="Woodward2001")
+  PRINT *, 'DD (bin=2): ', aer_desc%get_index('DD',.false.,ibin=2)
+  PRINT *, 'DD (bin=2,model=Woodward): ', aer_desc%get_index('DD',.false.,ibin=2,optical_model_str="Woodward")
+  PRINT *, 'DD (bin=2,model=Woodward2001): ', aer_desc%get_index('DD',.false.,ibin=2,optical_model_str="Woodward2001")
   ! This should fail to find a match, returning zero
-  print *, 'DD (model=Nobody): ', aer_desc%get_index('DD',.false.,optical_model_str="Nobody")
-  print *, 'SS (bin=3): ', aer_desc%get_index('SS',.true.,ibin=3)
+  PRINT *, 'DD (model=Nobody): ', aer_desc%get_index('DD',.false.,optical_model_str="Nobody")
+  PRINT *, 'SS (bin=3): ', aer_desc%get_index('SS',.true.,ibin=3)
 
 end program test_aerosol_optics_description
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_fast_expm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_fast_expm.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_fast_expm.F90	(revision 5160)
@@ -18,7 +18,7 @@
   call fast_expm_exchange_3(1,1,a(1:1),b(1:1),c(1:1),d(1:1),r)
 
-  print *, r
-  print *, 0.0000001
-  print *, epsilon(1.0_jprb)
+  PRINT *, r
+  PRINT *, 0.0000001
+  PRINT *, epsilon(1.0_jprb)
 
 end program test_fast_expm
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_random_number_generator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_random_number_generator.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/test_random_number_generator.F90	(revision 5160)
@@ -19,10 +19,10 @@
   integer :: jl
 
-  print *, 'working_fp_precision = ', jprb
+  PRINT *, 'working_fp_precision = ', jprb
 
   if (IRngType == IRngNative) then
-    print *, "rng_type = 'native'"
+    PRINT *, "rng_type = 'native'"
   else
-    print *, "rng_type = 'native'"
+    PRINT *, "rng_type = 'native'"
   end if
   
@@ -30,8 +30,8 @@
        &                                  nmaxstreams=streammax)
   DO jl = 1,1
-    print *, 'initial_state = [ ', int(random_number_generator%istate(1:streammax),jpib), ' ]'
+    PRINT *, 'initial_state = [ ', int(random_number_generator%istate(1:streammax),jpib), ' ]'
     call random_number_generator%uniform_distribution(vec)
-    print *, 'uniform_deviates = [ ', vec, ' ]'
-    print *, 'final_state = [ ', int(random_number_generator%istate(1:streammax),jpib), ' ]'
+    PRINT *, 'uniform_deviates = [ ', vec, ' ]'
+    PRINT *, 'final_state = [ ', int(random_number_generator%istate(1:streammax),jpib), ' ]'
   end do
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/lmdz/readaerosolstrato_ecrad.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/lmdz/readaerosolstrato_ecrad.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/lmdz/readaerosolstrato_ecrad.F90	(revision 5160)
@@ -124,5 +124,5 @@
 !--check mth_cur
         IF (mth_cur.LT.1.OR.mth_cur.GT.12) THEN
-          print *,'probleme avec le mois dans readaerosolstrat =', mth_cur
+          PRINT *,'probleme avec le mois dans readaerosolstrat =', mth_cur
         ENDIF
 
@@ -148,5 +148,5 @@
         IF (grid_type/=unstructured) THEN
            IF (n_lat.NE.nbp_lat) THEN 
-             print *, 'latitude=', n_lat, nbp_lat
+             PRINT *, 'latitude=', n_lat, nbp_lat
              abort_message='Le nombre de lat n est pas egal a nbp_lat'
              CALL abort_physic(modname,abort_message,1)
@@ -165,5 +165,5 @@
         CALL nf95_gw_var(ncid_in, varid, wav)
         n_wav = size(wav)
-        print *, 'WAV aerosol strato=', n_wav, wav
+        PRINT *, 'WAV aerosol strato=', n_wav, wav
 !        IF (n_wav.NE.config%n_bands_sw) THEN 
 !           abort_message='Le nombre de wav n est pas egal a config%n_bands_sw'
@@ -178,15 +178,15 @@
         CALL nf95_inq_varid(ncid_in, "TAU_SUN", varid)
         ncerr = nf90_get_var(ncid_in, varid, tauaerstrat)
-        print *,'code erreur readaerosolstrato=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato=', ncerr, varid
 
 !--reading stratospheric aerosol omega per layer
         CALL nf95_inq_varid(ncid_in, "OME_SUN", varid)
         ncerr = nf90_get_var(ncid_in, varid, pizaerstrat)
-        print *,'code erreur readaerosolstrato=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato=', ncerr, varid
 
 !--reading stratospheric aerosol g per layer
         CALL nf95_inq_varid(ncid_in, "GGG_SUN", varid)
         ncerr = nf90_get_var(ncid_in, varid, cgaerstrat)
-        print *,'code erreur readaerosolstrato sw=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato sw=', ncerr, varid
 
         CALL nf95_close(ncid_in)
@@ -256,5 +256,5 @@
         CALL nf95_gw_var(ncid_in, varid, wav)
         n_wav = size(wav)
-        print *, 'WAV aerosol strato=', n_wav, wav
+        PRINT *, 'WAV aerosol strato=', n_wav, wav
 !        IF (n_wav.NE.config%n_bands_lw) THEN 
 !           abort_message='Le nombre de wav n est pas egal a config%n_bands_lw'
@@ -271,5 +271,5 @@
         CALL nf95_inq_varid(ncid_in, "TAU_EAR", varid)
         ncerr = nf90_get_var(ncid_in, varid, taulwaerstrat)
-        print *,'code erreur readaerosolstrato lw=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato lw=', ncerr, varid
 
 ! add/mod ThL
@@ -278,10 +278,10 @@
         CALL nf95_inq_varid(ncid_in, "OME_EAR", varid)
         ncerr = nf90_get_var(ncid_in, varid, pizlwaerstrat)
-        print *,'code erreur readaerosolstrato lw=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato lw=', ncerr, varid
 
 !--reading stratospheric aerosol g per layer
         CALL nf95_inq_varid(ncid_in, "GGG_EAR", varid)
         ncerr = nf90_get_var(ncid_in, varid, cglwaerstrat)
-        print *,'code erreur readaerosolstrato lw=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato lw=', ncerr, varid
 
         CALL nf95_close(ncid_in)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_monochromatic.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_monochromatic.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_monochromatic.F90	(revision 5160)
@@ -293,5 +293,5 @@
              &  ', longwave optical depth = ', &
              &  sum(od_lw_cloud(1,:,jcol)*cloud%fraction(jcol,:))
-        !    print *, 'LWP = ', sum(lwp_kg_m2(:,istartcol)*cloud%fraction(istartcol,:))
+        !    PRINT *, 'LWP = ', sum(lwp_kg_m2(:,istartcol)*cloud%fraction(istartcol,:))
       end do
     end if
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90	(revision 5160)
@@ -201,5 +201,5 @@
       ENDDO
       zinta(nleva + 1) = zinta(nleva) + (zmida(nleva) - zmida(nleva - 1)) * 1000.0 !--extrapolation for last interface
-      !print *,'zinta=', zinta
+      !PRINT *,'zinta=', zinta
 
       CALL scatter(pkm_airpl_glo, pkm_airpl)
@@ -751,5 +751,5 @@
 
       Tcontr = 226.69 + 9.43 * log(Gcontr - 0.053) + 0.72 * (log(Gcontr - 0.053))**2 !--K
-      !print *,'Tcontr=',iter,i,k,eps_w,pplay,Gcontr,Tcontr(i,k)
+      !PRINT *,'Tcontr=',iter,i,k,eps_w,pplay,Gcontr,Tcontr(i,k)
       !--Psat with index 0 in FOEEW to get saturation wrt liquid water corresponding to Tcontr
       !qsatliqcontr = RESTT*FOEEW(Tcontr(i,k),0.)                               !--Pa
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ini_undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ini_undefSTD.F90	(revision 5159)
+++ 	(revision )
@@ -1,86 +1,0 @@
-
-! $Id$
-
-
-SUBROUTINE ini_undefstd(itap, itapm1)
-  USE dimphy
-  USE phys_state_var_mod ! Variables sauvegardees de la physique
-  USE phys_cal_mod, ONLY: mth_len
-  USE lmdz_clesphys
-
-  IMPLICIT NONE
-
-  ! ====================================================================
-
-  ! I. Musat : 09.2004
-
-  ! Initialisation - a des frequences differentes :
-
-  ! 1) des variables moyennees sur la journee "day" ou sur le mois "mth"
-  ! calculees a partir des valeurs "instantannees" de la physique
-
-  ! 2) des variables moyennes mensuelles "NMC" calculees a partir des val.
-  ! toutes les 6 heures
-
-  ! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps
-  ! de la physique
-  ! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps
-  ! de la physique
-  ! nout=3 !var. mensuelle "NMC" moyennee toutes les 6heures
-
-  ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
-  ! ====================================================================
-
-  ! ym INCLUDE "dimphy.h"
-  ! variables Input/Output
-  ! INTEGER nlevSTD, klevSTD, itap
-  INTEGER itap, itapm1
-  ! PARAMETER(klevSTD=17)
-  ! REAL dtime
-
-  ! variables locales
-  ! INTEGER i, k, nout, n
-  INTEGER i, k, n
-  ! PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC
-  ! REAL freq_outNMC(nout)
-  REAL un_jour
-  PARAMETER (un_jour=86400.)
-
-  ! variables Output
-  ! REAL tnondef(klon,klevSTD,nout)
-  ! REAL tsumSTD(klon,klevSTD,nout)
-
-  DO n = 1, nout
-
-    ! initialisation variables en debut du mois, de la journee ou des 6h
-
-    IF (n==1 .AND. itap-itapm1==1 .OR. n>1 .AND. mod(itap,nint( &
-        freq_outnmc(n)/phys_tstep))==1) THEN
-      ! PRINT*,'ini_undefSTD n itap',n,itap
-      DO k = 1, nlevstd
-        DO i = 1, klon
-          tnondef(i, k, n) = 0.
-          tsumstd(i, k, n) = 0.
-          usumstd(i, k, n) = 0.
-          vsumstd(i, k, n) = 0.
-          wsumstd(i, k, n) = 0.
-          phisumstd(i, k, n) = 0.
-          qsumstd(i, k, n) = 0.
-          rhsumstd(i, k, n) = 0.
-          uvsumstd(i, k, n) = 0.
-          vqsumstd(i, k, n) = 0.
-          vtsumstd(i, k, n) = 0.
-          wqsumstd(i, k, n) = 0.
-          vphisumstd(i, k, n) = 0.
-          wtsumstd(i, k, n) = 0.
-          u2sumstd(i, k, n) = 0.
-          v2sumstd(i, k, n) = 0.
-          t2sumstd(i, k, n) = 0.
-          o3sumstd(i, k, n) = 0.
-          o3daysumstd(i, k, n) = 0.
-        END DO !i
-      END DO !k
-    END IF !
-  END DO !n
-
-END SUBROUTINE ini_undefstd
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/init_be.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/init_be.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/init_be.F90	(revision 5160)
@@ -553,5 +553,5 @@
       ! 1/(60*1.295) = 0.01287
       srcbe(i, k) = srcbe(i, k) * 0.01287
-      !!       print *,'  k, srcbe(i,k) ',   &
+      !!       PRINT *,'  k, srcbe(i,k) ',   &
       !!                  k, srcbe(i,k)
       ! La source est  at/min/m3 -> at/s/m3
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_qso.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_qso.f90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_qso.f90	(revision 5160)
@@ -378,7 +378,7 @@
 
       IF(ikm<0.OR.ik0<0.OR.ikp<0)THEN
-       print *,"CRASH1 in sisvat_qso.f on pixel (i,j,n)", &
+       PRINT *,"CRASH1 in sisvat_qso.f on pixel (i,j,n)", &
              ii__SV(ikl),jj__SV(ikl),nn__SV(ikl)
-       print *,"decrease your time step or increase ntphys "// &
+       PRINT *,"decrease your time step or increase ntphys "// &
              "and ntdiff in time_steps.f"
        stop
@@ -424,7 +424,7 @@
 
       IF(ik0<0.OR.ikp<0)THEN
-       print *,"CRASH2 in sisvat_qso.f on pixel (i,j,n)", &
+       PRINT *,"CRASH2 in sisvat_qso.f on pixel (i,j,n)", &
              ii__SV(ikl),jj__SV(ikl),nn__SV(ikl)
-       print *,"decrease your time step or increase ntphys "// &
+       PRINT *,"decrease your time step or increase ntphys "// &
              "and ntdiff in time_steps.f"
        stop
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90	(revision 5160)
@@ -107,5 +107,5 @@
             ENDIF
             IF (ierr /= nf90_noerr) THEN
-              print *,'WARNING : BILS_OCE not found for layer 2'
+              PRINT *,'WARNING : BILS_OCE not found for layer 2'
             ENDIF
           ENDDO
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_chem.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_chem.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_chem.f90	(revision 5160)
@@ -0,0 +1,18 @@
+MODULE lmdz_chem
+  IMPLICIT NONE; PRIVATE
+  PUBLIC idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+
+  INTEGER idms, iso2, iso4, ih2s, idmso, imsa, ih2o2
+  PARAMETER (idms = 1, iso2 = 2, iso4 = 3)
+  PARAMETER (ih2s = 4, idmso = 5, imsa = 6, ih2o2 = 7)
+
+  REAL n_avogadro, masse_s, masse_so4, rho_water, rho_ice
+  PARAMETER (n_avogadro = 6.02E23)                  !--molec mol-1
+  PARAMETER (masse_s = 32.0)                        !--g mol-1
+  PARAMETER (masse_so4 = 96.0)                      !--g mol-1
+  PARAMETER (rho_water = 1000.0)                    !--kg m-3
+  PARAMETER (rho_ice = 500.0)                       !--kg m-3
+
+END MODULE lmdz_chem
+
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth.F90	(revision 5160)
@@ -1065,5 +1065,5 @@
             cenv_vol(ind1, ind2) = 0.5 * (1. + 1. * erf(xenv))
             ctot_vol(ind1, ind2) = fraca(ind1, ind2) * cth_vol(ind1, ind2) + (1. - 1. * fraca(ind1, ind2)) * cenv_vol(ind1, ind2)
-            !print *,'jeanjean_CV=',ctot_vol(ind1,ind2)
+            !PRINT *,'jeanjean_CV=',ctot_vol(ind1,ind2)
 
             qlth(ind1, ind2) = sigma2s * ((exp(-1. * xth**2) / sqrt2pi) + xth * sqrt(2.) * cth_vol(ind1, ind2))
@@ -1075,5 +1075,5 @@
             !beta=0.0044
             !inverse_rho=1.+beta*dz(ind1,ind2)
-            !print *,'jeanjean : beta=',beta
+            !PRINT *,'jeanjean : beta=',beta
             !cth(ind1,ind2)=cth_vol(ind1,ind2)*inverse_rho
             !cenv(ind1,ind2)=cenv_vol(ind1,ind2)*inverse_rho
@@ -1089,10 +1089,10 @@
             Dx_Brooks = 200000.
             f_Brooks = A_Maj_Brooks * (dz(ind1, ind2)**(a_Brooks)) * (Dx_Brooks**(-b_Brooks))
-            !print *,'jeanjean_f=',f_Brooks
+            !PRINT *,'jeanjean_f=',f_Brooks
 
             cth(ind1, ind2) = 1. / (1. + exp(-1. * f_Brooks) * ((1. / max(1.e-15, min(cth_vol(ind1, ind2), 1.))) - 1.))
             cenv(ind1, ind2) = 1. / (1. + exp(-1. * f_Brooks) * ((1. / max(1.e-15, min(cenv_vol(ind1, ind2), 1.))) - 1.))
             ctot(ind1, ind2) = 1. / (1. + exp(-1. * f_Brooks) * ((1. / max(1.e-15, min(ctot_vol(ind1, ind2), 1.))) - 1.))
-            !print *,'JJ_ctot_1',ctot(ind1,ind2)
+            !PRINT *,'JJ_ctot_1',ctot(ind1,ind2)
 
           ENDIF ! of if (iflag_cloudth_vert<5)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_concvl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_concvl.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_concvl.F90	(revision 5160)
@@ -386,5 +386,5 @@
   IF (iflag_con==30) THEN
 
-    ! print *, '-> cv_driver'      !jyg
+    ! PRINT *, '-> cv_driver'      !jyg
     CALL cv_driver(klon, klev, klevp1, ntra, iflag_con, &
             t, q, qs, u, v, tra, &
@@ -398,5 +398,5 @@
             wdtrainA, wdtrainM, &                                !RomP
             epmax_diag) ! epmax_cape
-    !           print *, 'cv_driver ->'      !jyg
+    !           PRINT *, 'cv_driver ->'      !jyg
 
     DO i = 1, klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ini_undefstd.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ini_undefstd.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ini_undefstd.f90	(revision 5160)
@@ -0,0 +1,87 @@
+MODULE lmdz_ini_undefstd
+  IMPLICIT NONE; PRIVATE
+  PUBLIC ini_undefstd
+CONTAINS
+  SUBROUTINE ini_undefstd(itap, itapm1)
+    USE dimphy
+    USE phys_state_var_mod ! Variables sauvegardees de la physique
+    USE phys_cal_mod, ONLY: mth_len
+    USE lmdz_clesphys
+
+    IMPLICIT NONE
+
+    ! ====================================================================
+
+    ! I. Musat : 09.2004
+
+    ! Initialisation - a des frequences differentes :
+
+    ! 1) des variables moyennees sur la journee "day" ou sur le mois "mth"
+    ! calculees a partir des valeurs "instantannees" de la physique
+
+    ! 2) des variables moyennes mensuelles "NMC" calculees a partir des val.
+    ! toutes les 6 heures
+
+    ! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps
+    ! de la physique
+    ! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps
+    ! de la physique
+    ! nout=3 !var. mensuelle "NMC" moyennee toutes les 6heures
+
+    ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
+    ! ====================================================================
+
+    ! ym INCLUDE "dimphy.h"
+    ! variables Input/Output
+    ! INTEGER nlevSTD, klevSTD, itap
+    INTEGER itap, itapm1
+    ! PARAMETER(klevSTD=17)
+    ! REAL dtime
+
+    ! variables locales
+    ! INTEGER i, k, nout, n
+    INTEGER i, k, n
+    ! PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC
+    ! REAL freq_outNMC(nout)
+    REAL un_jour
+    PARAMETER (un_jour = 86400.)
+
+    ! variables Output
+    ! REAL tnondef(klon,klevSTD,nout)
+    ! REAL tsumSTD(klon,klevSTD,nout)
+
+    DO n = 1, nout
+
+      ! initialisation variables en debut du mois, de la journee ou des 6h
+
+      IF (n==1 .AND. itap - itapm1==1 .OR. n>1 .AND. mod(itap, nint(&
+              freq_outnmc(n) / phys_tstep))==1) THEN
+        ! PRINT*,'ini_undefSTD n itap',n,itap
+        DO k = 1, nlevstd
+          DO i = 1, klon
+            tnondef(i, k, n) = 0.
+            tsumstd(i, k, n) = 0.
+            usumstd(i, k, n) = 0.
+            vsumstd(i, k, n) = 0.
+            wsumstd(i, k, n) = 0.
+            phisumstd(i, k, n) = 0.
+            qsumstd(i, k, n) = 0.
+            rhsumstd(i, k, n) = 0.
+            uvsumstd(i, k, n) = 0.
+            vqsumstd(i, k, n) = 0.
+            vtsumstd(i, k, n) = 0.
+            wqsumstd(i, k, n) = 0.
+            vphisumstd(i, k, n) = 0.
+            wtsumstd(i, k, n) = 0.
+            u2sumstd(i, k, n) = 0.
+            v2sumstd(i, k, n) = 0.
+            t2sumstd(i, k, n) = 0.
+            o3sumstd(i, k, n) = 0.
+            o3daysumstd(i, k, n) = 0.
+          END DO !i
+        END DO !k
+      END IF !
+    END DO !n
+
+  END SUBROUTINE ini_undefstd
+END MODULE lmdz_ini_undefstd
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_moy_undefstd.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_moy_undefstd.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_moy_undefstd.f90	(revision 5160)
@@ -0,0 +1,145 @@
+MODULE lmdz_moy_undefstd
+  IMPLICIT NONE; PRIVATE
+  PUBLIC moy_undefstd
+CONTAINS
+  SUBROUTINE moy_undefstd(itap, itapm1)
+    USE netcdf, ONLY: nf90_fill_real
+    USE dimphy
+    USE phys_state_var_mod
+    USE lmdz_wxios, ONLY: missing_val_xios => missing_val, using_xios
+
+    USE phys_cal_mod, ONLY: mth_len
+    USE lmdz_clesphys
+
+    IMPLICIT NONE
+    REAL :: missing_val
+
+    ! ====================================================================
+
+    ! I. Musat : 09.2004
+
+    ! Moyenne - a des frequences differentes - des valeurs bien definies
+    ! (.NE.missing_val) des variables interpolees a un niveau de
+    ! pression.
+    ! 1) les variables de type "day" (nout=1) ou "mth" (nout=2) sont sommees
+    ! tous les pas de temps de la physique
+
+    ! 2) les variables de type "NMC" (nout=3) sont calculees a partir
+    ! des valeurs instantannees toutes les 6 heures
+
+
+    ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
+    ! ====================================================================
+
+
+    ! variables Input
+    ! INTEGER nlevSTD, klevSTD, itap
+    ! PARAMETER(klevSTD=17)
+    INTEGER itap, itapm1
+
+    ! variables locales
+    ! INTEGER i, k, nout, n
+    ! PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC
+    INTEGER i, k, n
+    ! REAL dtime, freq_outNMC(nout), freq_moyNMC(nout)
+    ! REAL freq_outNMC(nout), freq_calNMC(nout)
+    REAL freq_moynmc(nout)
+
+    ! variables Output
+    ! REAL tnondef(klon,klevSTD,nout)
+    ! REAL tsumSTD(klon,klevSTD,nout)
+
+    REAL un_jour
+    PARAMETER (un_jour = 86400.)
+    ! REAL missing_val
+
+    ! missing_val = nf90_fill_real
+    IF (using_xios) THEN
+      missing_val = missing_val_xios
+    ELSE
+      missing_val = missing_val_nf90
+    ENDIF
+
+    DO n = 1, nout
+      IF (freq_outnmc(n)<0) THEN
+        freq_moynmc(n) = (mth_len * un_jour) / freq_calnmc(n)
+        ! PRINT*,'moy_undefSTD n freq_out freq_moy =',
+        ! $n,freq_moyNMC(n)
+      ELSE
+        freq_moynmc(n) = freq_outnmc(n) / freq_calnmc(n)
+      END IF
+
+      ! calcul 1 fois pas mois, 1 fois par jour ou toutes les 6h
+
+      IF (n==1 .AND. itap==itapm1 .OR. n>1 .AND. mod(itap, nint(freq_outnmc(n) / &
+              phys_tstep))==0) THEN
+
+        ! PRINT*,'moy_undefSTD n itap itapm1',n,itap,itapm1
+
+        DO k = 1, nlevstd
+          DO i = 1, klon
+            IF (tnondef(i, k, n)/=(freq_moynmc(n))) THEN
+              tsumstd(i, k, n) = tsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k, n &
+                      ))
+              usumstd(i, k, n) = usumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k, n &
+                      ))
+              vsumstd(i, k, n) = vsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k, n &
+                      ))
+              wsumstd(i, k, n) = wsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k, n &
+                      ))
+              phisumstd(i, k, n) = phisumstd(i, k, n) / &
+                      (freq_moynmc(n) - tnondef(i, k, n))
+              qsumstd(i, k, n) = qsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k, n &
+                      ))
+              rhsumstd(i, k, n) = rhsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              uvsumstd(i, k, n) = uvsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              vqsumstd(i, k, n) = vqsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              vtsumstd(i, k, n) = vtsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              wqsumstd(i, k, n) = wqsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              vphisumstd(i, k, n) = vphisumstd(i, k, n) / &
+                      (freq_moynmc(n) - tnondef(i, k, n))
+              wtsumstd(i, k, n) = wtsumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              u2sumstd(i, k, n) = u2sumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              v2sumstd(i, k, n) = v2sumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              t2sumstd(i, k, n) = t2sumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              o3sumstd(i, k, n) = o3sumstd(i, k, n) / (freq_moynmc(n) - tnondef(i, k &
+                      , n))
+              o3daysumstd(i, k, n) = o3daysumstd(i, k, n) / &
+                      (freq_moynmc(n) - tnondef(i, k, n))
+            ELSE
+              tsumstd(i, k, n) = missing_val
+              usumstd(i, k, n) = missing_val
+              vsumstd(i, k, n) = missing_val
+              wsumstd(i, k, n) = missing_val
+              phisumstd(i, k, n) = missing_val
+              qsumstd(i, k, n) = missing_val
+              rhsumstd(i, k, n) = missing_val
+              uvsumstd(i, k, n) = missing_val
+              vqsumstd(i, k, n) = missing_val
+              vtsumstd(i, k, n) = missing_val
+              wqsumstd(i, k, n) = missing_val
+              vphisumstd(i, k, n) = missing_val
+              wtsumstd(i, k, n) = missing_val
+              u2sumstd(i, k, n) = missing_val
+              v2sumstd(i, k, n) = missing_val
+              t2sumstd(i, k, n) = missing_val
+              o3sumstd(i, k, n) = missing_val
+              o3daysumstd(i, k, n) = missing_val
+            END IF !tnondef(i,k,n).NE.(freq_moyNMC(n))
+          END DO !i
+        END DO !k
+      END IF !MOD(itap,NINT(freq_outNMC(n)/phys_tstep)).EQ.0
+
+    END DO !n
+
+  END SUBROUTINE moy_undefstd
+END MODULE lmdz_moy_undefstd
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_plevel_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_plevel_new.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_plevel_new.f90	(revision 5160)
@@ -0,0 +1,135 @@
+MODULE lmdz_plevel_new
+  IMPLICIT NONE; PRIVATE
+  PUBLIC plevel_new
+CONTAINS
+
+  SUBROUTINE plevel_new(ilon, ilev, klevstd, lnew, pgcm, pres, qgcm, qpres)
+    USE dimphy
+    USE phys_state_var_mod, ONLY: missing_val_nf90
+    USE lmdz_wxios, ONLY: missing_val_xios => missing_val, using_xios
+
+    IMPLICIT NONE
+
+    ! ================================================================
+
+    ! Interpoler des champs 3-D u, v et g du modele a un niveau de
+    ! pression donnee (pres)
+
+    ! INPUT:  ilon ----- nombre de points
+    ! ilev ----- nombre de couches
+    ! lnew ----- true si on doit reinitialiser les poids
+    ! pgcm ----- pressions modeles
+    ! pres ----- pression vers laquelle on interpolle
+    ! Qgcm ----- champ GCM
+    ! Qpres ---- champ interpolle au niveau pres
+
+    ! ================================================================
+
+    ! arguments :
+    ! -----------
+
+    INTEGER ilon, ilev, klevstd
+    LOGICAL lnew
+
+    REAL pgcm(ilon, ilev)
+    REAL qgcm(ilon, ilev)
+    REAL pres(klevstd)
+    REAL qpres(ilon, klevstd)
+
+    ! local :
+    ! -------
+
+    ! ym      INTEGER lt(klon), lb(klon)
+    ! ym      REAL ptop, pbot, aist(klon), aisb(klon)
+
+    ! ym      save lt,lb,ptop,pbot,aist,aisb
+    INTEGER, ALLOCATABLE, SAVE, DIMENSION (:, :) :: lt, lb
+    REAL, ALLOCATABLE, SAVE, DIMENSION (:, :) :: aist, aisb
+    !$OMP THREADPRIVATE(lt,lb,aist,aisb)
+    REAL, SAVE :: ptop, pbot
+    !$OMP THREADPRIVATE(ptop, pbot)
+    LOGICAL, SAVE :: first = .TRUE.
+    INTEGER :: nlev
+    !$OMP THREADPRIVATE(first)
+    INTEGER i, k
+
+    REAL :: missing_val
+
+    IF (using_xios) THEN
+      missing_val = missing_val_xios
+    ELSE
+      missing_val = missing_val_nf90
+    ENDIF
+
+    IF (first) THEN
+      ALLOCATE (lt(klon, klevstd), lb(klon, klevstd))
+      ALLOCATE (aist(klon, klevstd), aisb(klon, klevstd))
+      first = .FALSE.
+    END IF
+
+    ! =====================================================================
+    IF (lnew) THEN
+      ! on reinitialise les reindicages et les poids
+      ! =====================================================================
+
+
+      ! Chercher les 2 couches les plus proches du niveau a obtenir
+
+      ! Eventuellement, faire l'extrapolation a partir des deux couches
+      ! les plus basses ou les deux couches les plus hautes:
+
+      DO nlev = 1, klevstd
+        DO i = 1, klon
+          IF (abs(pres(nlev) - pgcm(i, ilev))<abs(pres(nlev) - pgcm(i, 1))) THEN
+            lt(i, nlev) = ilev ! 2
+            lb(i, nlev) = ilev - 1 ! 1
+          ELSE
+            lt(i, nlev) = 2
+            lb(i, nlev) = 1
+          END IF
+        END DO
+        DO k = 1, ilev - 1
+          DO i = 1, klon
+            pbot = pgcm(i, k)
+            ptop = pgcm(i, k + 1)
+            IF (ptop<=pres(nlev) .AND. pbot>=pres(nlev)) THEN
+              lt(i, nlev) = k + 1
+              lb(i, nlev) = k
+            END IF
+          END DO
+        END DO
+
+        ! Interpolation lineaire:
+        DO i = 1, klon
+          ! interpolation en logarithme de pression:
+
+          ! ...   Modif . P. Le Van    ( 20/01/98) ....
+          ! Modif Frederic Hourdin (3/01/02)
+
+          aist(i, nlev) = log(pgcm(i, lb(i, nlev)) / pres(nlev)) / log(pgcm(i, lb(i, &
+                  nlev)) / pgcm(i, lt(i, nlev)))
+          aisb(i, nlev) = log(pres(nlev) / pgcm(i, lt(i, nlev))) / log(pgcm(i, lb(i, &
+                  nlev)) / pgcm(i, lt(i, nlev)))
+        END DO
+      END DO
+
+    END IF ! lnew
+
+    ! ======================================================================
+    ! inteprollation
+    ! ET je mets les vents a zero quand je rencontre une montagne
+    ! ======================================================================
+
+    DO nlev = 1, klevstd
+      DO i = 1, klon
+        IF (pgcm(i, 1)<pres(nlev)) THEN
+          qpres(i, nlev) = missing_val
+        ELSE
+          qpres(i, nlev) = qgcm(i, lb(i, nlev)) * aisb(i, nlev) + &
+                  qgcm(i, lt(i, nlev)) * aist(i, nlev)
+        END IF
+      END DO
+    END DO
+
+  END SUBROUTINE plevel_new
+END MODULE lmdz_plevel_new
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alp.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alp.F90	(revision 5160)
@@ -199,5 +199,5 @@
       CALL thermcell_tke_transport(ngrid, nlay, ptimestep, fm0, entr0, &  ! in
               rg, pplev, therm_tke_max)                               ! out
-      !   print *,' thermcell_tke_transport -> '   !!jyg
+      !   PRINT *,' thermcell_tke_transport -> '   !!jyg
 
       !-----Calcul des profils verticaux de TKE hors thermiques : env_tke_max, et de la vitesse verticale grande échelle : W_ls
@@ -209,5 +209,5 @@
         enddo
       enddo
-      !    print *,' apres w_ls = '   !!jyg
+      !    PRINT *,' apres w_ls = '   !!jyg
 
       DO ig = 1, ngrid
@@ -238,5 +238,5 @@
 
     ENDIF ! IF ( (iflag_trig_bl.ge.1) .OR. (iflag_clos_bl.ge.1) )
-    !  print *,'ENDIF  ( (iflag_trig_bl.ge.1) .OR. (iflag_clos_bl.ge.1) ) '    !!jyg
+    !  PRINT *,'ENDIF  ( (iflag_trig_bl.ge.1) .OR. (iflag_clos_bl.ge.1) ) '    !!jyg
 
     !------------Triggering------------------
@@ -270,5 +270,5 @@
         endif
       enddo
-      !   print *,'avant Calcul de Wmax '    !!jyg
+      !   PRINT *,'avant Calcul de Wmax '    !!jyg
 
       !CR: calcul de strig
@@ -304,5 +304,5 @@
 
     ENDIF ! iflag_trig_bl
-    !  print *,'ENDIF  iflag_trig_bl'    !!jyg
+    !  PRINT *,'ENDIF  iflag_trig_bl'    !!jyg
 
     !------------Closure------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_undefstd.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_undefstd.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_undefstd.f90	(revision 5160)
@@ -0,0 +1,107 @@
+MODULE lmdz_undefstd
+  IMPLICIT NONE; PRIVATE
+  PUBLIC undefstd
+CONTAINS
+
+  SUBROUTINE undefstd(itap, read_climoz)
+    USE netcdf, ONLY: nf90_fill_real
+    USE dimphy
+    USE phys_state_var_mod
+    USE lmdz_wxios, ONLY: missing_val_xios => missing_val, using_xios
+    USE lmdz_clesphys
+
+    IMPLICIT NONE
+    REAL :: missing_val
+
+    ! ====================================================================
+
+    ! I. Musat : 09.2004
+
+    ! Calcul * du nombre de pas de temps (FLOAT(ecrit_XXX)-tnondef))
+    ! ou la variable tlevSTD est bien definie (.NE.missing_val),
+    ! et
+    ! * de la somme de tlevSTD => tsumSTD
+
+    ! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps
+    ! de la physique
+    ! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps
+    ! de la physique
+    ! nout=3 !var. mensuelle "NMC" moyennee toutes les ecrit_hf
+
+
+    ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
+    ! ====================================================================
+
+    ! ymINCLUDE "dimphy.h"
+    ! variables Input
+
+    ! INTEGER nlevSTD, klevSTD, itap
+    ! PARAMETER(klevSTD=17)
+    INTEGER itap
+
+    ! variables locales
+    ! INTEGER i, k, nout, n
+    ! PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC
+    INTEGER i, k, n
+    ! REAL freq_calNMC(nout)
+    INTEGER read_climoz
+
+    ! variables Output
+    ! REAL tlevSTD(klon,klevSTD), tsumSTD(klon,klevSTD,nout)
+    ! LOGICAL oknondef(klon,klevSTD,nout)
+    ! REAL tnondef(klon,klevSTD,nout)
+
+    ! REAL missing_val
+
+    ! missing_val = nf90_fill_real
+    IF (using_xios) THEN
+      missing_val = missing_val_xios
+    ELSE
+      missing_val = missing_val_nf90
+    ENDIF
+
+    DO n = 1, nout
+
+
+      ! calcul variables tous les freq_calNMC(n)/phys_tstep pas de temps
+      ! de la physique
+
+      IF (mod(itap, nint(freq_calnmc(n) / phys_tstep))==0) THEN
+        DO k = 1, nlevstd
+          DO i = 1, klon
+            IF (tlevstd(i, k)==missing_val) THEN
+              ! IF(oknondef(i,k,n)) THEN
+              tnondef(i, k, n) = tnondef(i, k, n) + 1.
+              ! ENDIF !oknondef(i,k)
+
+            ELSE IF (tlevstd(i, k)/=missing_val) THEN
+              tsumstd(i, k, n) = tsumstd(i, k, n) + tlevstd(i, k)
+              usumstd(i, k, n) = usumstd(i, k, n) + ulevstd(i, k)
+              vsumstd(i, k, n) = vsumstd(i, k, n) + vlevstd(i, k)
+              wsumstd(i, k, n) = wsumstd(i, k, n) + wlevstd(i, k)
+              phisumstd(i, k, n) = phisumstd(i, k, n) + philevstd(i, k)
+              qsumstd(i, k, n) = qsumstd(i, k, n) + qlevstd(i, k)
+              rhsumstd(i, k, n) = rhsumstd(i, k, n) + rhlevstd(i, k)
+              uvsumstd(i, k, n) = uvsumstd(i, k, n) + uvstd(i, k)
+              vqsumstd(i, k, n) = vqsumstd(i, k, n) + vqstd(i, k)
+              vtsumstd(i, k, n) = vtsumstd(i, k, n) + vtstd(i, k)
+              wqsumstd(i, k, n) = wqsumstd(i, k, n) + wqstd(i, k)
+              vphisumstd(i, k, n) = vphisumstd(i, k, n) + vphistd(i, k)
+              wtsumstd(i, k, n) = wtsumstd(i, k, n) + wtstd(i, k)
+              u2sumstd(i, k, n) = u2sumstd(i, k, n) + u2std(i, k)
+              v2sumstd(i, k, n) = v2sumstd(i, k, n) + v2std(i, k)
+              t2sumstd(i, k, n) = t2sumstd(i, k, n) + t2std(i, k)
+              o3sumstd(i, k, n) = o3sumstd(i, k, n) + o3std(i, k)
+              IF (read_climoz==2) o3daysumstd(i, k, n) = o3daysumstd(i, k, n) + &
+                      o3daystd(i, k)
+
+            END IF
+          END DO !i
+        END DO !k
+
+      END IF !MOD(itap,NINT(freq_calNMC(n)/phys_tstep)).EQ.0
+
+    END DO !n
+
+  END SUBROUTINE undefstd
+END MODULE lmdz_undefstd
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake.F90	(revision 5160)
@@ -893,5 +893,5 @@
 
     DO i = 1, klon
-      ! c       print *,' isubstep,wk_adv(i),cstar(i),wape(i) ',
+      ! c       PRINT *,' isubstep,wk_adv(i),cstar(i),wape(i) ',
       ! c     $           isubstep,wk_adv(i),cstar(i),wape(i)
       IF (wk_adv(i) .AND. cstar(i)>0.01) THEN
@@ -1182,5 +1182,5 @@
       END DO
     END DO
-!!    print *,'omg(igout,k) ', (k,omg(igout,k),k=1,klev)
+!!    PRINT *,'omg(igout,k) ', (k,omg(igout,k),k=1,klev)
     ! cc nrlmd
     ! c      DO i=1,klon
@@ -2018,18 +2018,18 @@
     DO i = 1, klon
       IF (ok_qx_qw(i)) THEN
-        !! print *,'wake, hw0(i), dthmin(i) ', hw0(i), dthmin(i)
-        !! print *,'wake, 2.*sum_dth(i)/(hw0(i)*dthmin(i)) ', &
+        !! PRINT *,'wake, hw0(i), dthmin(i) ', hw0(i), dthmin(i)
+        !! PRINT *,'wake, 2.*sum_dth(i)/(hw0(i)*dthmin(i)) ', &
         !!                2.*sum_dth(i)/(hw0(i)*dthmin(i))
-        !! print *,'wake, sum_half_dth(i), sum_dth(i) ', &
+        !! PRINT *,'wake, sum_half_dth(i), sum_dth(i) ', &
         !!                sum_half_dth(i), sum_dth(i)
         IF ((hw0(i) < 1.) .OR. (dthmin(i) >= -delta_t_min) ) THEN
           wape2(i) = -1.
-          !! print *,'wake, rej 1'
+          !! PRINT *,'wake, rej 1'
         ELSE IF (iflag_wk_check_trgl==1.AND.abs(2.*sum_dth(i)/(hw0(i)*dthmin(i)) - 1.) > 0.5) THEN
           wape2(i) = -1.
-          !! print *,'wake, rej 2'
+          !! PRINT *,'wake, rej 2'
         ELSE IF (abs(sum_half_dth(i)) < 0.5*abs(sum_dth(i)) ) THEN
           wape2(i) = -1.
-          !! print *,'wake, rej 3'
+          !! PRINT *,'wake, rej 3'
         END IF
       END IF
@@ -2956,11 +2956,11 @@
 
       IF (prt_level >= 10) THEN
-        print *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1) ', &
+        PRINT *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1) ', &
                        cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1)
-        print *,'wake, wdens(1), awdens(1), act(1), d_awdens(1) ', &
+        PRINT *,'wake, wdens(1), awdens(1), act(1), d_awdens(1) ', &
                        wdens(1), awdens(1), act(1), d_awdens(1)
-        print *,'wake, wgen, -(wdens-awdens)*tau_wk_inv, -2.*wdens*gfl*drdt_pos, d_wdens ', &
+        PRINT *,'wake, wgen, -(wdens-awdens)*tau_wk_inv, -2.*wdens*gfl*drdt_pos, d_wdens ', &
                        wgen(1), -(wdens(1)-awdens(1))*tau_wk_inv(1), -2.*wdens(1)*gfl(1)*drdt_pos, d_wdens(1)
-        print *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
+        PRINT *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
                        d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1)
       ENDIF
@@ -3105,9 +3105,9 @@
 
       IF (prt_level >= 10) THEN
-        print *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), cont_fact(1) ', &
+        PRINT *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), cont_fact(1) ', &
                        cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), cont_fact(1)
-        print *,'wake, wdens(1), awdens(1), d_awdens(1) ', &
+        PRINT *,'wake, wdens(1), awdens(1), d_awdens(1) ', &
                        wdens(1), awdens(1), d_awdens(1)
-        print *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
+        PRINT *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
                        d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1)
       ENDIF
@@ -3351,9 +3351,9 @@
 
       IF (prt_level >= 10) THEN
-        print *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), gfl(1) ', &
+        PRINT *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), gfl(1) ', &
                        cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), gfl(1)
-        print *,'wake, wdens(1), awdens(1), d_awdens(1) ', &
+        PRINT *,'wake, wdens(1), awdens(1), d_awdens(1) ', &
                        wdens(1), awdens(1), d_awdens(1)
-        print *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
+        PRINT *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
                        d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1)
       ENDIF
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lsc_scav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lsc_scav.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lsc_scav.F90	(revision 5160)
@@ -14,4 +14,6 @@
   USE lmdz_YOECUMF
   USE lmdz_yomcst
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
 
   IMPLICIT NONE
@@ -22,6 +24,4 @@
   ! last modification 16/01/2013 (reformulation partie evaporation)
   !=====================================================================
-
-  include "chem.h"
 
   ! inputs
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/moy_undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/moy_undefSTD.F90	(revision 5159)
+++ 	(revision )
@@ -1,144 +1,0 @@
-
-! $Id$
-
-SUBROUTINE moy_undefstd(itap, itapm1)
-  USE netcdf, ONLY: nf90_fill_real
-  USE dimphy
-  USE phys_state_var_mod
-  USE lmdz_wxios, ONLY: missing_val_xios => missing_val, using_xios
- 
-  USE phys_cal_mod, ONLY: mth_len
-  USE lmdz_clesphys
-
-  IMPLICIT NONE
-  REAL :: missing_val
-
-  ! ====================================================================
-
-  ! I. Musat : 09.2004
-
-  ! Moyenne - a des frequences differentes - des valeurs bien definies
-  ! (.NE.missing_val) des variables interpolees a un niveau de
-  ! pression.
-  ! 1) les variables de type "day" (nout=1) ou "mth" (nout=2) sont sommees
-  ! tous les pas de temps de la physique
-
-  ! 2) les variables de type "NMC" (nout=3) sont calculees a partir
-  ! des valeurs instantannees toutes les 6 heures
-
-
-  ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
-  ! ====================================================================
-
-
-  ! variables Input
-  ! INTEGER nlevSTD, klevSTD, itap
-  ! PARAMETER(klevSTD=17)
-  INTEGER itap, itapm1
-
-  ! variables locales
-  ! INTEGER i, k, nout, n
-  ! PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC
-  INTEGER i, k, n
-  ! REAL dtime, freq_outNMC(nout), freq_moyNMC(nout)
-  ! REAL freq_outNMC(nout), freq_calNMC(nout)
-  REAL freq_moynmc(nout)
-
-  ! variables Output
-  ! REAL tnondef(klon,klevSTD,nout)
-  ! REAL tsumSTD(klon,klevSTD,nout)
-
-  REAL un_jour
-  PARAMETER (un_jour=86400.)
-! REAL missing_val
-
-! missing_val = nf90_fill_real
-  IF (using_xios) THEN
-    missing_val = missing_val_xios
-  ELSE
-    missing_val=missing_val_nf90
-  ENDIF
-
-  DO n = 1, nout
-    IF (freq_outnmc(n)<0) THEN
-      freq_moynmc(n) = (mth_len*un_jour)/freq_calnmc(n)
-      ! PRINT*,'moy_undefSTD n freq_out freq_moy =',
-      ! $n,freq_moyNMC(n)
-    ELSE
-      freq_moynmc(n) = freq_outnmc(n)/freq_calnmc(n)
-    END IF
-
-    ! calcul 1 fois pas mois, 1 fois par jour ou toutes les 6h
-
-    IF (n==1 .AND. itap==itapm1 .OR. n>1 .AND. mod(itap,nint(freq_outnmc(n)/ & 
-        phys_tstep))==0) THEN
-
-      ! PRINT*,'moy_undefSTD n itap itapm1',n,itap,itapm1
-
-      DO k = 1, nlevstd
-        DO i = 1, klon
-          IF (tnondef(i,k,n)/=(freq_moynmc(n))) THEN
-            tsumstd(i, k, n) = tsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
-              ))
-            usumstd(i, k, n) = usumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
-              ))
-            vsumstd(i, k, n) = vsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
-              ))
-            wsumstd(i, k, n) = wsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
-              ))
-            phisumstd(i, k, n) = phisumstd(i, k, n)/ &
-              (freq_moynmc(n)-tnondef(i,k,n))
-            qsumstd(i, k, n) = qsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
-              ))
-            rhsumstd(i, k, n) = rhsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            uvsumstd(i, k, n) = uvsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            vqsumstd(i, k, n) = vqsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            vtsumstd(i, k, n) = vtsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            wqsumstd(i, k, n) = wqsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            vphisumstd(i, k, n) = vphisumstd(i, k, n)/ &
-              (freq_moynmc(n)-tnondef(i,k,n))
-            wtsumstd(i, k, n) = wtsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            u2sumstd(i, k, n) = u2sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            v2sumstd(i, k, n) = v2sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            t2sumstd(i, k, n) = t2sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            o3sumstd(i, k, n) = o3sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
-              ,n))
-            o3daysumstd(i, k, n) = o3daysumstd(i, k, n)/ &
-              (freq_moynmc(n)-tnondef(i,k,n))
-          ELSE
-            tsumstd(i, k, n) = missing_val
-            usumstd(i, k, n) = missing_val
-            vsumstd(i, k, n) = missing_val
-            wsumstd(i, k, n) = missing_val
-            phisumstd(i, k, n) = missing_val
-            qsumstd(i, k, n) = missing_val
-            rhsumstd(i, k, n) = missing_val
-            uvsumstd(i, k, n) = missing_val
-            vqsumstd(i, k, n) = missing_val
-            vtsumstd(i, k, n) = missing_val
-            wqsumstd(i, k, n) = missing_val
-            vphisumstd(i, k, n) = missing_val
-            wtsumstd(i, k, n) = missing_val
-            u2sumstd(i, k, n) = missing_val
-            v2sumstd(i, k, n) = missing_val
-            t2sumstd(i, k, n) = missing_val
-            o3sumstd(i, k, n) = missing_val
-            o3daysumstd(i, k, n) = missing_val
-          END IF !tnondef(i,k,n).NE.(freq_moyNMC(n))
-        END DO !i
-      END DO !k
-    END IF !MOD(itap,NINT(freq_outNMC(n)/phys_tstep)).EQ.0
-
-  END DO !n
-
-
-END SUBROUTINE moy_undefstd
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_slab_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_slab_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_slab_mod.F90	(revision 5160)
@@ -152,5 +152,5 @@
     nslay = 2
     CALL getin_p('slab_layers', nslay)
-    print *, 'number of slab layers : ', nslay
+    PRINT *, 'number of slab layers : ', nslay
     ! Layer thickness
     ALLOCATE(slabh(nslay), stat = error)
@@ -172,5 +172,5 @@
     cpl_pas = NINT(86400. / dtime * 1.0) ! une fois par jour
     CALL getin_p('cpl_pas', cpl_pas)
-    print *, 'cpl_pas', cpl_pas
+    PRINT *, 'cpl_pas', cpl_pas
 
     ! Horizontal diffusion
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/orografi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/orografi.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/orografi.F90	(revision 5160)
@@ -426,5 +426,5 @@
   ! --------------
 
-  ! print *,' entree gwsetup'
+  ! PRINT *,' entree gwsetup'
 
   ! ------------------------------------------------------------------
@@ -971,5 +971,5 @@
   ! --------------
 
-  ! print *,' entree gwprofil'
+  ! PRINT *,' entree gwprofil'
 
 
@@ -1366,5 +1366,5 @@
   ! do 2011 jl=kidia,kfdia
   ! IF(KTEST(JL).EQ.1) THEN
-  ! print *,' iknul= ',iknul(jl),'  iknub=',iknub(jl)
+  ! PRINT *,' iknul= ',iknul(jl),'  iknub=',iknub(jl)
   ! ENDIF
   ! 2011 continue
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/orografi_strato.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/orografi_strato.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/orografi_strato.F90	(revision 5160)
@@ -276,5 +276,5 @@
   ! --------------
 
-  ! print *,' in orodrag'
+  ! PRINT *,' in orodrag'
 
   ! ------------------------------------------------------------------
@@ -1038,5 +1038,5 @@
       ! IF(lo) ptau(jl,klev+1)=0.0
 
-      ! print *,jl,ptau(jl,klev+1)
+      ! PRINT *,jl,ptau(jl,klev+1)
 
     ELSE
@@ -1124,5 +1124,5 @@
   ! --------------
 
-  ! print *,' entree gwprofil'
+  ! PRINT *,' entree gwprofil'
 
 
@@ -1134,5 +1134,5 @@
       zoro(jl) = psig(jl) * pdmod(jl) / 4. / pstd(jl)
       ztau(jl, klev + 1) = ptau(jl, klev + 1)
-      ! print *,jl,ptau(jl,klev+1)
+      ! PRINT *,jl,ptau(jl,klev+1)
       ztau(jl, kkcrith(jl)) = grahilo * ptau(jl, klev + 1)
     END IF
@@ -1188,5 +1188,5 @@
             zriw = pri(jl, jk) * (1. - zalfa) / (1 + zalfa * zsqr)**2
             IF (zriw<grcrit) THEN
-              ! print *,' breaking!!!',ptau(jl,jk)
+              ! PRINT *,' breaking!!!',ptau(jl,jk)
               zdel = 4. / zsqr / grcrit + 1. / grcrit**2 + 4. / grcrit
               zb = 1. / grcrit + 2. / zsqr
@@ -1346,5 +1346,5 @@
 
 
-  ! print *,'in lift_noro'
+  ! PRINT *,'in lift_noro'
   DO i = 1, klon
     pulow(i) = 0.0
@@ -1406,5 +1406,5 @@
   END DO
 
-  ! print *,' out lift_noro'
+  ! PRINT *,' out lift_noro'
 
 END SUBROUTINE lift_noro_strato
@@ -1573,5 +1573,5 @@
     END DO
   END DO
-  ! print *,'  dans orolift: 223'
+  ! PRINT *,'  dans orolift: 223'
 
   ! ********************************************************************
@@ -1698,5 +1698,5 @@
   END IF
 
-  ! print *,' out orolift'
+  ! PRINT *,' out orolift'
 
 END SUBROUTINE orolift_strato
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90	(revision 5160)
@@ -1064,5 +1064,5 @@
     ENDIF
 
-    IF (prt_level >=10) print *, ' -> pbl_surface, itap ', itap
+    IF (prt_level >=10) PRINT *, ' -> pbl_surface, itap ', itap
 
     !!jyg      iflag_split = mod(iflag_pbl_split,2)
@@ -1577,5 +1577,5 @@
     loop_nbsrf: DO nsrf = 1, nbsrf                                        !<<<<<<<<<<<<<
       !<<<<<<<<<<<<<
-      IF (prt_level >=10) print *, ' Loop nsrf ', nsrf
+      IF (prt_level >=10) PRINT *, ' Loop nsrf ', nsrf
 
       IF (iflag_split_ref == 3) THEN
@@ -1601,5 +1601,5 @@
       !!! jyg le 19/08/2012
       !       IF (knon <= 0) THEN
-      !         IF (prt_level >= 10) print *,' no grid point for nsrf= ',nsrf
+      !         IF (prt_level >= 10) PRINT *,' no grid point for nsrf= ',nsrf
       !         cycle loop_nbsrf
       !       ENDIF
@@ -1785,6 +1785,6 @@
 
         IF (prt_level >= 10) THEN
-          print *, 'pbl_surface, wake_s(1), wake_dlt(1,:) ', wake_s(1), wake_dlt(1, :)
-          print *, 'pbl_surface, wake_s(1), wake_dlq(1,:) ', wake_s(1), wake_dlq(1, :)
+          PRINT *, 'pbl_surface, wake_s(1), wake_dlt(1,:) ', wake_s(1), wake_dlt(1, :)
+          PRINT *, 'pbl_surface, wake_s(1), wake_dlq(1,:) ', wake_s(1), wake_dlq(1, :)
         ENDIF
 
@@ -1888,5 +1888,5 @@
         IF (ok_prescr_ust) THEN
           DO i = 1, knon
-            print *, 'ycdragm avant=', ycdragm(i)
+            PRINT *, 'ycdragm avant=', ycdragm(i)
             vent = sqrt(yu(i, 1) * yu(i, 1) + yv(i, 1) * yv(i, 1))
             !      ycdragm(i) = ust*ust/(1.+(yu(i,1)*yu(i,1)+yv(i,1)*yv(i,1)))
@@ -1894,9 +1894,9 @@
             !     *sqrt(yu(i,1)*yu(i,1)+yv(i,1)*yv(i,1)))
             ycdragm(i) = ust * ust / (1. + vent) / vent
-            !      print *,'ycdragm ust yu yv apres=',ycdragm(i),ust,yu(i,1),yv(i,1)
+            !      PRINT *,'ycdragm ust yu yv apres=',ycdragm(i),ust,yu(i,1),yv(i,1)
           ENDDO
         ENDIF
 
-        IF (prt_level >=10) print *, 'cdrag -> ycdragh ', ycdragh(1:knon)
+        IF (prt_level >=10) PRINT *, 'cdrag -> ycdragh ', ycdragh(1:knon)
       ELSE  !(iflag_split .EQ.0)
 
@@ -1921,11 +1921,11 @@
         IF (ok_prescr_ust) THEN
           DO i = 1, knon
-            !         print *,'ycdragm_x avant=',ycdragm_x(i)
+            !         PRINT *,'ycdragm_x avant=',ycdragm_x(i)
             vent = sqrt(yu_x(i, 1) * yu_x(i, 1) + yv_x(i, 1) * yv_x(i, 1))
             ycdragm_x(i) = ust * ust / (1. + vent) / vent
-            !         print *,'ycdragm_x ust yu yv apres=',ycdragm_x(i),ust,yu_x(i,1),yv_x(i,1)
+            !         PRINT *,'ycdragm_x ust yu yv apres=',ycdragm_x(i),ust,yu_x(i,1),yv_x(i,1)
           ENDDO
         ENDIF
-        IF (prt_level >=10) print *, 'clcdrag -> ycdragh_x ', ycdragh_x(1:knon)
+        IF (prt_level >=10) PRINT *, 'clcdrag -> ycdragh_x ', ycdragh_x(1:knon)
 
         ! Faire disparaitre les lignes commentees fin 2015 (le temps des tests)
@@ -1954,11 +1954,11 @@
         IF (ok_prescr_ust) THEN
           DO i = 1, knon
-            !         print *,'ycdragm_w avant=',ycdragm_w(i)
+            !         PRINT *,'ycdragm_w avant=',ycdragm_w(i)
             vent = sqrt(yu_w(i, 1) * yu_w(i, 1) + yv_w(i, 1) * yv_w(i, 1))
             ycdragm_w(i) = ust * ust / (1. + vent) / vent
-            !         print *,'ycdragm_w ust yu yv apres=',ycdragm_w(i),ust,yu_w(i,1),yv_w(i,1)
+            !         PRINT *,'ycdragm_w ust yu yv apres=',ycdragm_w(i),ust,yu_w(i,1),yv_w(i,1)
           ENDDO
         ENDIF
-        IF (prt_level >=10) print *, 'clcdrag -> ycdragh_w ', ycdragh_w(1:knon)
+        IF (prt_level >=10) PRINT *, 'clcdrag -> ycdragh_w ', ycdragh_w(1:knon)
         !!!
       ENDIF  ! (iflag_split .EQ.0)
@@ -1975,14 +1975,14 @@
         !!! nrlmd & jyg les 02/05/2011, 13/06/2011, 05/02/2012
         IF (prt_level >=10) THEN
-          print *, ' args coef_diff_turb: yu ', yu(1:knon, :)
-          print *, ' args coef_diff_turb: yv ', yv(1:knon, :)
-          print *, ' args coef_diff_turb: yq ', yq(1:knon, :)
-          print *, ' args coef_diff_turb: yt ', yt(1:knon, :)
-          print *, ' args coef_diff_turb: yts ', yts(1:knon)
-          print *, ' args coef_diff_turb: yz0m ', yz0m(1:knon)
-          print *, ' args coef_diff_turb: yqsurf ', yqsurf(1:knon)
-          print *, ' args coef_diff_turb: ycdragm ', ycdragm(1:knon)
-          print *, ' args coef_diff_turb: ycdragh ', ycdragh(1:knon)
-          print *, ' args coef_diff_turb: ytke ', ytke(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yu ', yu(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yv ', yv(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yq ', yq(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yt ', yt(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yts ', yts(1:knon)
+          PRINT *, ' args coef_diff_turb: yz0m ', yz0m(1:knon)
+          PRINT *, ' args coef_diff_turb: yqsurf ', yqsurf(1:knon)
+          PRINT *, ' args coef_diff_turb: ycdragm ', ycdragm(1:knon)
+          PRINT *, ' args coef_diff_turb: ycdragh ', ycdragh(1:knon)
+          PRINT *, ' args coef_diff_turb: ytke ', ytke(1:knon, :)
         ENDIF
 
@@ -2012,18 +2012,18 @@
         ENDIF ! iflag_pbl >= 50
 
-        IF (prt_level >=10) print *, 'coef_diff_turb -> ycoefh ', ycoefh(1:knon, :)
+        IF (prt_level >=10) PRINT *, 'coef_diff_turb -> ycoefh ', ycoefh(1:knon, :)
 
       ELSE  !(iflag_split .EQ.0)
 
         IF (prt_level >=10) THEN
-          print *, ' args coef_diff_turb: yu_x ', yu_x(1:knon, :)
-          print *, ' args coef_diff_turb: yv_x ', yv_x(1:knon, :)
-          print *, ' args coef_diff_turb: yq_x ', yq_x(1:knon, :)
-          print *, ' args coef_diff_turb: yt_x ', yt_x(1:knon, :)
-          print *, ' args coef_diff_turb: yts_x ', yts_x(1:knon)
-          print *, ' args coef_diff_turb: yqsurf ', yqsurf(1:knon)
-          print *, ' args coef_diff_turb: ycdragm_x ', ycdragm_x(1:knon)
-          print *, ' args coef_diff_turb: ycdragh_x ', ycdragh_x(1:knon)
-          print *, ' args coef_diff_turb: ytke_x ', ytke_x(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yu_x ', yu_x(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yv_x ', yv_x(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yq_x ', yq_x(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yt_x ', yt_x(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yts_x ', yts_x(1:knon)
+          PRINT *, ' args coef_diff_turb: yqsurf ', yqsurf(1:knon)
+          PRINT *, ' args coef_diff_turb: ycdragm_x ', ycdragm_x(1:knon)
+          PRINT *, ' args coef_diff_turb: ycdragh_x ', ycdragh_x(1:knon)
+          PRINT *, ' args coef_diff_turb: ytke_x ', ytke_x(1:knon, :)
         ENDIF
 
@@ -2054,16 +2054,16 @@
         ENDIF ! iflag_pbl >= 50
 
-        IF (prt_level >=10) print *, 'coef_diff_turb -> ycoefh_x ', ycoefh_x(1:knon, :)
+        IF (prt_level >=10) PRINT *, 'coef_diff_turb -> ycoefh_x ', ycoefh_x(1:knon, :)
 
         IF (prt_level >=10) THEN
-          print *, ' args coef_diff_turb: yu_w ', yu_w(1:knon, :)
-          print *, ' args coef_diff_turb: yv_w ', yv_w(1:knon, :)
-          print *, ' args coef_diff_turb: yq_w ', yq_w(1:knon, :)
-          print *, ' args coef_diff_turb: yt_w ', yt_w(1:knon, :)
-          print *, ' args coef_diff_turb: yts_w ', yts_w(1:knon)
-          print *, ' args coef_diff_turb: yqsurf ', yqsurf(1:knon)
-          print *, ' args coef_diff_turb: ycdragm_w ', ycdragm_w(1:knon)
-          print *, ' args coef_diff_turb: ycdragh_w ', ycdragh_w(1:knon)
-          print *, ' args coef_diff_turb: ytke_w ', ytke_w(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yu_w ', yu_w(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yv_w ', yv_w(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yq_w ', yq_w(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yt_w ', yt_w(1:knon, :)
+          PRINT *, ' args coef_diff_turb: yts_w ', yts_w(1:knon)
+          PRINT *, ' args coef_diff_turb: yqsurf ', yqsurf(1:knon)
+          PRINT *, ' args coef_diff_turb: ycdragm_w ', ycdragm_w(1:knon)
+          PRINT *, ' args coef_diff_turb: ycdragh_w ', ycdragh_w(1:knon)
+          PRINT *, ' args coef_diff_turb: ytke_w ', ytke_w(1:knon, :)
         ENDIF
 
@@ -2093,5 +2093,5 @@
         ENDIF ! iflag_pbl >= 50
 
-        IF (prt_level >=10) print *, 'coef_diff_turb -> ycoefh_w ', ycoefh_w(1:knon, :)
+        IF (prt_level >=10) PRINT *, 'coef_diff_turb -> ycoefh_w ', ycoefh_w(1:knon, :)
 
         !!!jyg le 10/04/2013
@@ -2567,17 +2567,17 @@
         )
         IF (prt_level >=10) THEN
-          print *, 'arg de surf_ocean: ycdragh ', ycdragh(1:knon)
-          print *, 'arg de surf_ocean: ycdragm ', ycdragm(1:knon)
-          print *, 'arg de surf_ocean: yt ', yt(1:knon, :)
-          print *, 'arg de surf_ocean: yq ', yq(1:knon, :)
-          print *, 'arg de surf_ocean: yts ', yts(1:knon)
-          print *, 'arg de surf_ocean: AcoefH ', AcoefH(1:knon)
-          print *, 'arg de surf_ocean: AcoefQ ', AcoefQ(1:knon)
-          print *, 'arg de surf_ocean: BcoefH ', BcoefH(1:knon)
-          print *, 'arg de surf_ocean: BcoefQ ', BcoefQ(1:knon)
-          print *, 'arg de surf_ocean: yevap ', yevap(1:knon)
-          print *, 'arg de surf_ocean: yfluxsens ', yfluxsens(1:knon)
-          print *, 'arg de surf_ocean: yfluxlat ', yfluxlat(1:knon)
-          print *, 'arg de surf_ocean: ytsurf_new ', ytsurf_new(1:knon)
+          PRINT *, 'arg de surf_ocean: ycdragh ', ycdragh(1:knon)
+          PRINT *, 'arg de surf_ocean: ycdragm ', ycdragm(1:knon)
+          PRINT *, 'arg de surf_ocean: yt ', yt(1:knon, :)
+          PRINT *, 'arg de surf_ocean: yq ', yq(1:knon, :)
+          PRINT *, 'arg de surf_ocean: yts ', yts(1:knon)
+          PRINT *, 'arg de surf_ocean: AcoefH ', AcoefH(1:knon)
+          PRINT *, 'arg de surf_ocean: AcoefQ ', AcoefQ(1:knon)
+          PRINT *, 'arg de surf_ocean: BcoefH ', BcoefH(1:knon)
+          PRINT *, 'arg de surf_ocean: BcoefQ ', BcoefQ(1:knon)
+          PRINT *, 'arg de surf_ocean: yevap ', yevap(1:knon)
+          PRINT *, 'arg de surf_ocean: yfluxsens ', yfluxsens(1:knon)
+          PRINT *, 'arg de surf_ocean: yfluxlat ', yfluxlat(1:knon)
+          PRINT *, 'arg de surf_ocean: ytsurf_new ', ytsurf_new(1:knon)
         ENDIF
         ! Special DICE MPL 05082013 puis BOMEX MPL 20150410
@@ -2870,5 +2870,5 @@
 
       IF (prt_level >= 10) THEN
-        print *, 'pbl_surface, ybeta , yevap, yevap_pot ', &
+        PRINT *, 'pbl_surface, ybeta , yevap, yevap_pot ', &
                 ybeta(1:knon), yevap(1:knon), yevap_pot(1:knon)
       ENDIF  ! (prt_level >= 10)
@@ -3045,5 +3045,5 @@
 
         IF (prt_level >=10) THEN
-          print *, 'After climbing up, lfuxlat_x, fluxlat_w ', &
+          PRINT *, 'After climbing up, lfuxlat_x, fluxlat_w ', &
                   yfluxlat_x(1:knon), yfluxlat_w(1:knon)
         ENDIF
@@ -3195,5 +3195,5 @@
         ENDDO
         IF (prt_level >=10) THEN
-          print *, ' nsrf, flux_t(:,1,nsrf), flux_t_x(:,1,nsrf), flux_t_w(:,1,nsrf) ', &
+          PRINT *, ' nsrf, flux_t(:,1,nsrf), flux_t_x(:,1,nsrf), flux_t_w(:,1,nsrf) ', &
                   nsrf, flux_t(:, 1, nsrf), flux_t_x(:, 1, nsrf), flux_t_w(:, 1, nsrf)
         ENDIF
@@ -3488,5 +3488,5 @@
 
       IF (prt_level >=10) THEN
-        print *, 'pbl_surface tendencies for w: d_t_w, d_t_x, d_t ', &
+        PRINT *, 'pbl_surface tendencies for w: d_t_w, d_t_x, d_t ', &
                 d_t_w(1:knon, 1), d_t_x(1:knon, 1), d_t(1:knon, 1)
       ENDIF
@@ -3734,5 +3734,5 @@
 
       IF (prt_level >=10) THEN
-        print *, 'T2m, q2m, RH2m ', &
+        PRINT *, 'T2m, q2m, RH2m ', &
                 t2m(1:knon, :), q2m(1:knon, :), rh2m(1:knon)
       ENDIF
@@ -3748,15 +3748,15 @@
                 ytherm, ytrmb1, ytrmb2, ytrmb3, ylcl)
         IF (prt_level >=10) THEN
-          print *, ' Arg. de HBTM: yt2m ', yt2m(1:knon)
-          print *, ' Arg. de HBTM: yt10m ', yt10m(1:knon)
-          print *, ' Arg. de HBTM: yq2m ', yq2m(1:knon)
-          print *, ' Arg. de HBTM: yq10m ', yq10m(1:knon)
-          print *, ' Arg. de HBTM: yustar ', yustar(1:knon)
-          print *, ' Arg. de HBTM: y_flux_t ', y_flux_t(1:knon, :)
-          print *, ' Arg. de HBTM: y_flux_q ', y_flux_q(1:knon, :)
-          print *, ' Arg. de HBTM: yu ', yu(1:knon, :)
-          print *, ' Arg. de HBTM: yv ', yv(1:knon, :)
-          print *, ' Arg. de HBTM: yt ', yt(1:knon, :)
-          print *, ' Arg. de HBTM: yq ', yq(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yt2m ', yt2m(1:knon)
+          PRINT *, ' Arg. de HBTM: yt10m ', yt10m(1:knon)
+          PRINT *, ' Arg. de HBTM: yq2m ', yq2m(1:knon)
+          PRINT *, ' Arg. de HBTM: yq10m ', yq10m(1:knon)
+          PRINT *, ' Arg. de HBTM: yustar ', yustar(1:knon)
+          PRINT *, ' Arg. de HBTM: y_flux_t ', y_flux_t(1:knon, :)
+          PRINT *, ' Arg. de HBTM: y_flux_q ', y_flux_q(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yu ', yu(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yv ', yv(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yt ', yt(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yq ', yq(1:knon, :)
         ENDIF
       ELSE  ! (iflag_split .EQ.0)
@@ -3767,15 +3767,15 @@
                 ytherm_x, ytrmb1_x, ytrmb2_x, ytrmb3_x, ylcl_x)
         IF (prt_level >=10) THEN
-          print *, ' Arg. de HBTM: yt2m_x ', yt2m_x(1:knon)
-          print *, ' Arg. de HBTM: yt10m_x ', yt10m_x(1:knon)
-          print *, ' Arg. de HBTM: yq2m_x ', yq2m_x(1:knon)
-          print *, ' Arg. de HBTM: yq10m_x ', yq10m_x(1:knon)
-          print *, ' Arg. de HBTM: yustar_x ', yustar_x(1:knon)
-          print *, ' Arg. de HBTM: y_flux_t_x ', y_flux_t_x(1:knon, :)
-          print *, ' Arg. de HBTM: y_flux_q_x ', y_flux_q_x(1:knon, :)
-          print *, ' Arg. de HBTM: yu_x ', yu_x(1:knon, :)
-          print *, ' Arg. de HBTM: yv_x ', yv_x(1:knon, :)
-          print *, ' Arg. de HBTM: yt_x ', yt_x(1:knon, :)
-          print *, ' Arg. de HBTM: yq_x ', yq_x(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yt2m_x ', yt2m_x(1:knon)
+          PRINT *, ' Arg. de HBTM: yt10m_x ', yt10m_x(1:knon)
+          PRINT *, ' Arg. de HBTM: yq2m_x ', yq2m_x(1:knon)
+          PRINT *, ' Arg. de HBTM: yq10m_x ', yq10m_x(1:knon)
+          PRINT *, ' Arg. de HBTM: yustar_x ', yustar_x(1:knon)
+          PRINT *, ' Arg. de HBTM: y_flux_t_x ', y_flux_t_x(1:knon, :)
+          PRINT *, ' Arg. de HBTM: y_flux_q_x ', y_flux_q_x(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yu_x ', yu_x(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yv_x ', yv_x(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yt_x ', yt_x(1:knon, :)
+          PRINT *, ' Arg. de HBTM: yq_x ', yq_x(1:knon, :)
         ENDIF
         CALL HBTM(knon, ypaprs, ypplay, &
@@ -3806,7 +3806,7 @@
         ENDDO
         IF (prt_level >=10) THEN
-          print *, 'After HBTM: pblh ', pblh(1:knon, :)
-          print *, 'After HBTM: plcl ', plcl(1:knon, :)
-          print *, 'After HBTM: cteiCL ', cteiCL(1:knon, :)
+          PRINT *, 'After HBTM: pblh ', pblh(1:knon, :)
+          PRINT *, 'After HBTM: plcl ', plcl(1:knon, :)
+          PRINT *, 'After HBTM: cteiCL ', cteiCL(1:knon, :)
         ENDIF
       ELSE  !(iflag_split .EQ.0)
@@ -3826,7 +3826,7 @@
         ENDDO
         IF (prt_level >=10) THEN
-          print *, 'After HBTM: pblh_x ', pblh_x(1:knon, :)
-          print *, 'After HBTM: plcl_x ', plcl_x(1:knon, :)
-          print *, 'After HBTM: cteiCL_x ', cteiCL_x(1:knon, :)
+          PRINT *, 'After HBTM: pblh_x ', pblh_x(1:knon, :)
+          PRINT *, 'After HBTM: plcl_x ', plcl_x(1:knon, :)
+          PRINT *, 'After HBTM: cteiCL_x ', cteiCL_x(1:knon, :)
         ENDIF
         DO j = 1, knon
@@ -3845,7 +3845,7 @@
         ENDDO
         IF (prt_level >=10) THEN
-          print *, 'After HBTM: pblh_w ', pblh_w(1:knon, :)
-          print *, 'After HBTM: plcl_w ', plcl_w(1:knon, :)
-          print *, 'After HBTM: cteiCL_w ', cteiCL_w(1:knon, :)
+          PRINT *, 'After HBTM: pblh_w ', pblh_w(1:knon, :)
+          PRINT *, 'After HBTM: plcl_w ', plcl_w(1:knon, :)
+          PRINT *, 'After HBTM: cteiCL_w ', cteiCL_w(1:knon, :)
         ENDIF
         !!!
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90	(revision 5160)
@@ -315,5 +315,5 @@
       ! have to use (hour-dtphys).
       CALL ymds2ju(annee_ref, 1, idayref, hour - pdtphys, zjulian)
-      print *, 'phys_output_mod: annee,iday,hour,zjulian=', annee_ref, idayref, hour, zjulian
+      PRINT *, 'phys_output_mod: annee,iday,hour,zjulian=', annee_ref, idayref, hour, zjulian
     ELSE
       CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5160)
@@ -461,4 +461,5 @@
     USE lmdz_wxios, ONLY: wxios_closedef, missing_val_xios=>missing_val, wxios_set_context
     USE phys_cal_mod, ONLY: mth_len
+    USE lmdz_phys_constants, ONLY: dobson_u
 
 #ifdef CPP_RRTM
@@ -507,6 +508,4 @@
     INTEGER, DIMENSION(nbp_lon*nbp_lat)  :: ndex2d
     INTEGER, DIMENSION(nbp_lon*nbp_lat*klev) :: ndex3d
-    REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
-!   REAL, PARAMETER :: missing_val=nf90_fill_real
     REAL, DIMENSION(klev+1,2) :: Ahyb_bounds, Bhyb_bounds
     REAL, DIMENSION(klev,2) :: Ahyb_mid_bounds, Bhyb_mid_bounds
@@ -586,5 +585,5 @@
     ! ug la boucle qui suit ne sert qu'une fois, pour l'initialisation, sinon il n'y a toujours qu'un seul passage:
     DO iinit=1, iinitend
-!      print *,'IFF iinit=', iinit, iinitend 
+!      PRINT *,'IFF iinit=', iinit, iinitend
        IF (using_xios) THEN
          !$OMP MASTER
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5160)
@@ -91,4 +91,8 @@
     USE phys_output_var_mod, ONLY: cloudth_sth, cloudth_senv, cloudth_sigmath, cloudth_sigmaenv
     USE phys_output_var_mod, ONLY: cloud_cover_sw, cloud_cover_sw_s2
+    USE lmdz_plevel_new, ONLY: plevel_new
+    USE lmdz_moy_undefstd, ONLY: moy_undefstd
+    USE lmdz_undefstd, ONLY: undefstd
+    USE lmdz_ini_undefstd, ONLY: ini_undefstd
 
     USE lmdz_geometry, ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
@@ -104,5 +108,5 @@
     USE paramLMDZ_phy_mod
 
-    USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
+    USE lmdz_phytracr_spl, ONLY: phytracr_spl, phytracr_spl_out_init
     USE phys_output_write_spl_mod
     USE phytrac_mod, ONLY: phytrac_init, phytrac
@@ -111,5 +115,9 @@
     USE lmdz_calcul_divers, ONLY: calcul_divers
 
-    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DUST, CPPKEY_COSP, CPPKEY_COSP2, CPPKEY_COSPV2
+    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DUST, CPPKEY_COSP, CPPKEY_COSP2, CPPKEY_COSPV2, CPPKEY_STRATAER
+    USE phys_local_var_mod, ONLY: d_q_emiss
+    USE strataer_local_var_mod
+    USE strataer_nuc_mod, ONLY: strataer_nuc_init
+    USE strataer_emiss_mod, ONLY: strataer_emiss_init
 
     !!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
@@ -126,11 +134,4 @@
     USE YOERAD, ONLY: NRADLP
 #endif
-
-    USE phys_local_var_mod, ONLY: d_q_emiss
-    USE strataer_local_var_mod
-    USE strataer_nuc_mod, ONLY: strataer_nuc_init
-    USE strataer_emiss_mod, ONLY: strataer_emiss_init
-    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
-
 
     !!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!!
@@ -356,6 +357,6 @@
     USE lmdz_dimpft, ONLY: nvm_lmdz
     USE lmdz_yoethf
-
     USE lmdz_yomcst
+    USE lmdz_phys_constants, ONLY: dobson_u
 
     IMPLICIT NONE
@@ -808,6 +809,4 @@
     REAL zmasse(klon, nbp_lev), exner(klon, nbp_lev)
     !     (column-density of mass of air in a cell, in kg m-2)
-    REAL, parameter :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
-
     !IM sorties
     REAL un_jour
@@ -831,9 +830,6 @@
     EXTERNAL suphel    ! initialiser certaines constantes
     EXTERNAL transp    ! transport total de l'eau et de l'energie
-    !IM
+
     EXTERNAL haut2bas  !variables de haut en bas
-    EXTERNAL ini_undefSTD  !initialise a 0 une variable a 1 niveau de pression
-    EXTERNAL undefSTD !somme les valeurs definies d'1 var a 1 niveau de pression
-    !     EXTERNAL moy_undefSTD  !moyenne d'1 var a 1 niveau de pression
     ! EXTERNAL moyglo_aire
     ! moyenne globale d'1 var ponderee par l'aire de la maille (moyglo_pondaire)
@@ -1509,5 +1505,5 @@
     ENDIF
 
-    IF (prt_level>=1) print *, 'CONVERGENCE PHYSIQUE THERM 1 '
+    IF (prt_level>=1) PRINT *, 'CONVERGENCE PHYSIQUE THERM 1 '
 
     !======================================================================
@@ -1623,9 +1619,9 @@
       IF (nbapp_cv == 0) nbapp_cv = 86400. / phys_tstep
       IF (nbapp_wk == 0) nbapp_wk = 86400. / phys_tstep
-      print *, 'physiq, nbapp_cv, nbapp_wk ', nbapp_cv, nbapp_wk
+      PRINT *, 'physiq, nbapp_cv, nbapp_wk ', nbapp_cv, nbapp_wk
       IF (MOD(NINT(86400. / phys_tstep), nbapp_cv)==0) THEN
         cvpas_0 = NINT(86400. / phys_tstep) / nbapp_cv
         cvpas = cvpas_0
-        print *, 'physiq, cvpas ', cvpas
+        PRINT *, 'physiq, cvpas ', cvpas
       ELSE
         WRITE(lunout, *) 'le nombre de pas de temps physique doit etre un ', &
@@ -1639,5 +1635,5 @@
       IF (MOD(NINT(86400. / phys_tstep), nbapp_wk)==0) THEN
         wkpas = NINT(86400. / phys_tstep) / nbapp_wk
-        !       print *,'physiq, wkpas ',wkpas
+        !       PRINT *,'physiq, wkpas ',wkpas
       ELSE
         WRITE(lunout, *) 'le nombre de pas de temps physique doit etre un ', &
@@ -2765,7 +2761,7 @@
       !!jyg       IF (prt_level .ge. 2 .AND. mod(iflag_pbl_split,2) .EQ. 1) THEN
       IF (prt_level >= 2 .AND. mod(iflag_pbl_split, 10) >= 1) THEN
-        print *, 'debut du splitting de la PBL, wake_s = ', wake_s(:)
-        print *, 'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:, 1)
-        print *, 'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:, 1)
+        PRINT *, 'debut du splitting de la PBL, wake_s = ', wake_s(:)
+        PRINT *, 'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:, 1)
+        PRINT *, 'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:, 1)
       ENDIF
       ! !!
@@ -3008,5 +3004,5 @@
 
     !!jyg    IF (MOD(itapcv,cvpas).EQ.0) THEN
-    !!    print *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
+    !!    PRINT *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
     !!                       itapcv, cvpas, itap-1, cvpas_0
     IF (MOD(itapcv, cvpas)==0 .OR. MOD(itap - 1, cvpas_0)==0) THEN
@@ -3115,5 +3111,5 @@
         !>jyg
 
-        !!      print *,'physiq. q_w(1,k), q_x(1,k) ', &
+        !!      PRINT *,'physiq. q_w(1,k), q_x(1,k) ', &
         !!             (k, q_w(1,k), q_x(1,k),k=1,25)
 
@@ -3212,5 +3208,5 @@
                       abs(d_q_con(i, k)) > dqcon_multistep_max) THEN
                 cvpas = 1
-                !!                 print *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
+                !!                 PRINT *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
                 !!                                   i,k,d_t_con(i,k),d_q_con(i,k)
               ENDIF
@@ -3349,5 +3345,5 @@
     ENDIF
     IF (mod(itap, 1000) == 0) THEN
-      print *, ' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
+      PRINT *, ' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
     ENDIF
 
@@ -3475,7 +3471,7 @@
 
       IF (prt_level >= 10) THEN
-        print *, ' physiq, after calwake, wake_s: ', wake_s(:)
-        print *, ' physiq, after calwake, wake_deltat: ', wake_deltat(:, 1)
-        print *, ' physiq, after calwake, wake_deltaq: ', wake_deltaq(:, 1)
+        PRINT *, ' physiq, after calwake, wake_s: ', wake_s(:)
+        PRINT *, ' physiq, after calwake, wake_deltat: ', wake_deltat(:, 1)
+        PRINT *, ' physiq, after calwake, wake_deltaq: ', wake_deltaq(:, 1)
       ENDIF
 
@@ -3754,5 +3750,5 @@
     !-------------------------------------------------------------------------
     IF (prt_level >=10) THEN
-      print *, 'itap, ->fisrtilp ', itap
+      PRINT *, 'itap, ->fisrtilp ', itap
     ENDIF
 
@@ -4445,5 +4441,5 @@
 
         IF (prt_level >=10) THEN
-          print *, ' ->radlwsw, number 1 '
+          PRINT *, ' ->radlwsw, number 1 '
         ENDIF
 
@@ -4524,5 +4520,5 @@
 
           IF (prt_level >=10) THEN
-            print *, ' ->radlwsw, number 2 '
+            PRINT *, ' ->radlwsw, number 2 '
           ENDIF
 
@@ -4699,5 +4695,5 @@
 
     IF (prt_level >=10) THEN
-      print *, ' CALL orography ? ', ok_orodr
+      PRINT *, ' CALL orography ? ', ok_orodr
     ENDIF
 
@@ -4913,7 +4909,7 @@
         flh2o = 1
         IF(flag_verbose_strataer) THEN
-          print *, 'IN physiq_mod: ok_qemiss =yes (', ok_qemiss, '), flh2o=', flh2o
-          print *, 'IN physiq_mod: flag_emit=', flag_emit, ', nErupt=', nErupt
-          print *, 'IN physiq_mod: nAerErupt=', nAerErupt
+          PRINT *, 'IN physiq_mod: ok_qemiss =yes (', ok_qemiss, '), flh2o=', flh2o
+          PRINT *, 'IN physiq_mod: flag_emit=', flag_emit, ', nErupt=', nErupt
+          PRINT *, 'IN physiq_mod: nAerErupt=', nAerErupt
         ENDIF
 
@@ -4926,5 +4922,5 @@
                     day_cur<(day_emit_vol(ieru) + injdur)) THEN
 
-              IF(flag_verbose_strataer) print *, 'IN physiq_mod: date=', year_cur, mth_cur, day_cur
+              IF(flag_verbose_strataer) PRINT *, 'IN physiq_mod: date=', year_cur, mth_cur, day_cur
               ! initialisation of q tendency emission
               d_q_emiss(:, :) = 0.
@@ -4941,5 +4937,5 @@
                       nAerErupt + 1, 0)
 
-              IF(flag_verbose_strataer) print *, 'IN physiq_mod: min max d_q_emiss=', &
+              IF(flag_verbose_strataer) PRINT *, 'IN physiq_mod: min max d_q_emiss=', &
                       minval(d_q_emiss), maxval(d_q_emiss)
 
@@ -5425,5 +5421,5 @@
 
     IF (prt_level >=10) THEN
-      print *, 'Convertir les incrementations en tendances '
+      PRINT *, 'Convertir les incrementations en tendances '
     ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/plevel_new.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/plevel_new.F90	(revision 5159)
+++ 	(revision )
@@ -1,140 +1,0 @@
-
-! $Header: /home/cvsroot/LMDZ4/libf/phylmd/plevel.F,v 1.1.1.1.10.1 2006/08/17
-! 15:41:51 fairhead Exp $
-
-! ================================================================
-! ================================================================
-SUBROUTINE plevel_new(ilon, ilev, klevstd, lnew, pgcm, pres, qgcm, qpres)
-  ! ================================================================
-  ! ================================================================
-  USE dimphy
-  USE phys_state_var_mod, ONLY: missing_val_nf90
-  USE lmdz_wxios, ONLY: missing_val_xios=>missing_val, using_xios
-
-  IMPLICIT NONE
-
-  ! ================================================================
-
-  ! Interpoler des champs 3-D u, v et g du modele a un niveau de
-  ! pression donnee (pres)
-
-  ! INPUT:  ilon ----- nombre de points
-  ! ilev ----- nombre de couches
-  ! lnew ----- true si on doit reinitialiser les poids
-  ! pgcm ----- pressions modeles
-  ! pres ----- pression vers laquelle on interpolle
-  ! Qgcm ----- champ GCM
-  ! Qpres ---- champ interpolle au niveau pres
-
-  ! ================================================================
-
-  ! arguments :
-  ! -----------
-
-  INTEGER ilon, ilev, klevstd
-  LOGICAL lnew
-
-  REAL pgcm(ilon, ilev)
-  REAL qgcm(ilon, ilev)
-  REAL pres(klevstd)
-  REAL qpres(ilon, klevstd)
-
-  ! local :
-  ! -------
-
-  ! ym      INTEGER lt(klon), lb(klon)
-  ! ym      REAL ptop, pbot, aist(klon), aisb(klon)
-
-  ! ym      save lt,lb,ptop,pbot,aist,aisb
-  INTEGER, ALLOCATABLE, SAVE, DIMENSION (:, :) :: lt, lb
-  REAL, ALLOCATABLE, SAVE, DIMENSION (:, :) :: aist, aisb
-  !$OMP THREADPRIVATE(lt,lb,aist,aisb)
-  REAL, SAVE :: ptop, pbot
-  !$OMP THREADPRIVATE(ptop, pbot)
-  LOGICAL, SAVE :: first = .TRUE.
-  INTEGER :: nlev
-  !$OMP THREADPRIVATE(first)
-  INTEGER i, k
-
-  REAL :: missing_val
-
-  IF (using_xios) THEN
-    missing_val=missing_val_xios
-  ELSE
-    missing_val=missing_val_nf90
-  ENDIF
-
-  IF (first) THEN
-    ALLOCATE (lt(klon,klevstd), lb(klon,klevstd))
-    ALLOCATE (aist(klon,klevstd), aisb(klon,klevstd))
-    first = .FALSE.
-  END IF
-
-  ! =====================================================================
-  IF (lnew) THEN
-    ! on reinitialise les reindicages et les poids
-    ! =====================================================================
-
-
-    ! Chercher les 2 couches les plus proches du niveau a obtenir
-
-    ! Eventuellement, faire l'extrapolation a partir des deux couches
-    ! les plus basses ou les deux couches les plus hautes:
-
-
-    DO nlev = 1, klevstd
-      DO i = 1, klon
-        IF (abs(pres(nlev)-pgcm(i,ilev))<abs(pres(nlev)-pgcm(i,1))) THEN
-          lt(i, nlev) = ilev ! 2
-          lb(i, nlev) = ilev - 1 ! 1
-        ELSE
-          lt(i, nlev) = 2
-          lb(i, nlev) = 1
-        END IF
-      END DO
-      DO k = 1, ilev - 1
-        DO i = 1, klon
-          pbot = pgcm(i, k)
-          ptop = pgcm(i, k+1)
-          IF (ptop<=pres(nlev) .AND. pbot>=pres(nlev)) THEN
-            lt(i, nlev) = k + 1
-            lb(i, nlev) = k
-          END IF
-        END DO
-      END DO
-
-      ! Interpolation lineaire:
-      DO i = 1, klon
-        ! interpolation en logarithme de pression:
-
-        ! ...   Modif . P. Le Van    ( 20/01/98) ....
-        ! Modif Frederic Hourdin (3/01/02)
-
-        aist(i, nlev) = log(pgcm(i,lb(i,nlev))/pres(nlev))/log(pgcm(i,lb(i, &
-          nlev))/pgcm(i,lt(i,nlev)))
-        aisb(i, nlev) = log(pres(nlev)/pgcm(i,lt(i,nlev)))/log(pgcm(i,lb(i, &
-          nlev))/pgcm(i,lt(i,nlev)))
-      END DO
-    END DO
-
-  END IF ! lnew
-
-  ! ======================================================================
-  ! inteprollation
-  ! ET je mets les vents a zero quand je rencontre une montagne
-  ! ======================================================================
-
-  DO nlev = 1, klevstd
-    DO i = 1, klon
-      IF (pgcm(i,1)<pres(nlev)) THEN
-        qpres(i, nlev) = missing_val
-      ELSE
-        qpres(i, nlev) = qgcm(i, lb(i,nlev))*aisb(i, nlev) + &
-          qgcm(i, lt(i,nlev))*aist(i, nlev)
-      END IF
-    END DO
-  END DO
-
-
-
-END SUBROUTINE plevel_new
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90	(revision 5160)
@@ -37,5 +37,5 @@
 
     !$omp single
-    print *, "Call sequence information: press_coefoz"
+    PRINT *, "Call sequence information: press_coefoz"
 
     IF (is_mpi_root) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/radiation_AR4.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/radiation_AR4.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/radiation_AR4.F90	(revision 5160)
@@ -9,4 +9,5 @@
   USE lmdz_clesphys
   USE lmdz_yomcst
+  USE lmdz_phys_constants, ONLY: dobson_u
 
   IMPLICIT NONE
@@ -80,7 +81,4 @@
 
   ! * LOCAL VARIABLES:
-
-  REAL, PARAMETER :: dobson_u = 2.1415E-05 ! Dobson unit, in kg m-2
-
   REAL (KIND = 8) zoz(kdlon, kflev)
   ! column-density of ozone in layer, in kilo-Dobsons
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90	(revision 5160)
@@ -53,4 +53,5 @@
     USE lmdz_clesphys
     USE lmdz_yoethf
+    USE lmdz_phys_constants, ONLY: dobson_u
 
 #ifdef REPROBUS
@@ -472,5 +473,4 @@
     !      REAL(KIND=8) SUN(3)
     !      REAL(KIND=8) SUN_FRACT(2)
-    REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
     CHARACTER (LEN = 80) :: abort_message
     CHARACTER (LEN = 80) :: modname = 'radlwsw_m'
@@ -619,5 +619,5 @@
           !       A activer pour CCMVAL on prend l'ozone impose (MPL 07042010)
           !       POZON(i,k,:) = wo(i,k,:)
-          !       print *,'RADLWSW: POZON',k, POZON(i,k,1)
+          !       PRINT *,'RADLWSW: POZON',k, POZON(i,k,1)
           PCLDLD(i, k) = cldfra(iof + i, k) * cldemi(iof + i, k)
           PCLDLU(i, k) = cldfra(iof + i, k) * cldemi(iof + i, k)
@@ -681,5 +681,5 @@
         DO k = 1, kflev + 1
           DO i = 1, kdlon
-            !     print *,'RADLWSW: boucle mise a zero i k',i,k
+            !     PRINT *,'RADLWSW: boucle mise a zero i k',i,k
             ZFLUP(i, k) = 0.
             ZFLDN(i, k) = 0.
@@ -763,5 +763,5 @@
         zsolswfdiff(:) = -999.999
 
-        !     print *,'Avant SW_LMDAR4: PSCT zrmu0 zfract',PSCT, zrmu0, zfract
+        !     PRINT *,'Avant SW_LMDAR4: PSCT zrmu0 zfract',PSCT, zrmu0, zfract
         ! daylight ozone, if we have it, for short wave
         CALL SW_AEROAR4(PSCT, zrmu0, zfract, &
@@ -904,5 +904,5 @@
              POZON_i(1:klon,k,:)=POZON(1:klon,kflev+1-k,:)
 !!!            POZON_i(1:klon,k)=POZON(1:klon,k)        !!! on laisse 1=sol et klev=top
-             !          print *,'Juste avant RECMWFL: k tsol temp',k,tsol,t(1,k)
+             !          PRINT *,'Juste avant RECMWFL: k tsol temp',k,tsol,t(1,k)
 !!!!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6      
              DO i=1,6
@@ -911,5 +911,5 @@
           ENDDO
 
-          !       print *,'RADLWSW: avant RECMWFL, RI0,rmu0=',solaire,rmu0
+          !       PRINT *,'RADLWSW: avant RECMWFL, RI0,rmu0=',solaire,rmu0
 
           !  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -996,5 +996,5 @@
 
 
-          !        print *,'RADLWSW: apres RECMWF'
+          !        PRINT *,'RADLWSW: apres RECMWF'
           IF (lldebug) THEN
              CALL writefield_phy('zemtd_i',ZEMTD_i,klev+1)
@@ -1062,5 +1062,5 @@
                 ZLWFT(i,k+1) =-ZFLUX_i(i,2,k+1)-ZFLUX_i(i,1,k+1)
                 ZLWFT0_i(i,k+1)=-ZFLUC_i(i,2,k+1)-ZFLUC_i(i,1,k+1)
-                !        print *,'FLUX2 FLUX1 FLUC2 FLUC1',ZFLUX_i(i,2,k+1),&
+                !        PRINT *,'FLUX2 FLUX1 FLUC2 FLUC1',ZFLUX_i(i,2,k+1),&
                 !    & ZFLUX_i(i,1,k+1),ZFLUC_i(i,2,k+1),ZFLUC_i(i,1,k+1)
              ENDDO
@@ -1152,5 +1152,5 @@
                    zcool_volc(i,k)=(ZLWADAERO(i,k)-ZLWADAERO(i,k+1))*RG/RCPD/PDP(i,k) !NL
                 ENDIF
-                !          print *,'heat cool heat0 cool0 ',zheat(i,k),zcool(i,k),zheat0(i,k),zcool0(i,k)
+                !          PRINT *,'heat cool heat0 cool0 ',zheat(i,k),zcool(i,k),zheat0(i,k),zcool0(i,k)
                 !       ZFLUCUP_i(i,k)=ZFLUC_i(i,1,k)
                 !       ZFLUCDWN_i(i,k)=ZFLUC_i(i,2,k)
@@ -1310,5 +1310,5 @@
 
 
-          print *,'RADLWSW: avant RADIATION_SCHEME '
+          PRINT *,'RADLWSW: avant RADIATION_SCHEME '
 
           ! AI mars 2022
@@ -1446,5 +1446,5 @@
 
 
-          print *,'========= RADLWSW: apres RADIATION_SCHEME ==================== '
+          PRINT *,'========= RADLWSW: apres RADIATION_SCHEME ==================== '
 
           IF (lldebug_for_offline) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_interp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_interp.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_interp.F90	(revision 5160)
@@ -25,8 +25,8 @@
   USE lmdz_clesphys
   USE lmdz_yomcst
+  USE lmdz_chem, ONLY: idms, iso2, iso4, ih2s, idmso, imsa, ih2o2, &
+          n_avogadro, masse_s, masse_so4, rho_water, rho_ice
 
   IMPLICIT NONE
-
-  INCLUDE "chem.h"
 
   ! Input:
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90	(revision 5160)
@@ -454,5 +454,5 @@
         ! Get variable id
         !CALL check_err( nf90_inq_varid(ncid, TRIM(varname), varid),"pb inq var "//TRIM(varname) )
-        print *, 'readaerosol ', TRIM(varname)
+        PRINT *, 'readaerosol ', TRIM(varname)
         IF (nf90_inq_varid(ncid, TRIM(varname), varid) /= nf90_noerr) THEN
           ! Variable is not there
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/reevap.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/reevap.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/reevap.F90	(revision 5160)
@@ -25,5 +25,5 @@
   ! Re-evaporer l'eau liquide nuageuse
 
-  !print *,'rrevap ; fl_cor_ebil:',fl_cor_ebil,' iflag_ice_thermo:',iflag_ice_thermo,' RVTMP2',RVTMP2
+  !PRINT *,'rrevap ; fl_cor_ebil:',fl_cor_ebil,' iflag_ice_thermo:',iflag_ice_thermo,' RVTMP2',RVTMP2
   DO k = 1, klev  ! re-evaporation de l'eau liquide nuageuse
     DO i = 1, klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 5160)
@@ -116,5 +116,5 @@
     !---------------------------------
 
-    print *, "Call sequence information: regr_lat_time_coefoz"
+    PRINT *, "Call sequence information: regr_lat_time_coefoz"
 
     ! Names of ozone parameters:
@@ -262,5 +262,5 @@
     !---------------------------
 
-    print *, "Call sequence information: prepare_out"
+    PRINT *, "Call sequence information: prepare_out"
     n_o3_param = assert_eq(size(varid_in), size(varid_out), &
          size(name_out), "prepare_out") 
@@ -335,5 +335,5 @@
 
       IF (ncerr /= nf90_noerr) THEN
-         print *, "prepare_out " // trim(name_out(i)) &
+         PRINT *, "prepare_out " // trim(name_out(i)) &
               // " nf90_copy_att " // att_name // " -- " &
               // trim(nf90_strerror(ncerr))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 5160)
@@ -47,5 +47,5 @@
 
     !$omp master
-    print *, "Call sequence information: alloc_coefoz"
+    PRINT *, "Call sequence information: alloc_coefoz"
     !$omp end master
     allocate(c_Mob(klon, nbp_lev), a2(klon, nbp_lev), a4_mass(klon, nbp_lev))
@@ -118,5 +118,5 @@
     !------------------------------------
 
-    !!print *, "Call sequence information: regr_pr_comb_coefoz"
+    !!PRINT *, "Call sequence information: regr_pr_comb_coefoz"
     CALL assert((/size(rlat), size(paprs, 1), size(pplay, 1)/) == klon, &
          "regr_pr_comb_coefoz klon")
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90	(revision 5160)
@@ -54,5 +54,5 @@
     !------------------------------------------------------------
 
-    print *, "Call sequence information: regr_pr_o3"
+    PRINT *, "Call sequence information: regr_pr_o3"
     CALL assert(shape(o3_mob_regr) == (/nbp_lon + 1, nbp_lat, nbp_lev/), &
          "regr_pr_o3 o3_mob_regr")
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/gppref.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/gppref.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/gppref.F90	(revision 5160)
@@ -134,5 +134,5 @@
 IF (LVERTFE) THEN
   DO JLEV=1,KFLEV
-!   print *,'GPPREF: LVERTFE KFLEV KSTART KPROF JLEV',LVERTFE,KFLEV,KSTART,KPROF,JLEV
+!   PRINT *,'GPPREF: LVERTFE KFLEV KSTART KPROF JLEV',LVERTFE,KFLEV,KSTART,KPROF,JLEV
     PRESF(KSTART:KPROF,JLEV)=VAF(JLEV)+VBF(JLEV)*PRESH(KSTART:KPROF,KFLEV)  
   ENDDO
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/gpxyb.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/gpxyb.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/gpxyb.F90	(revision 5160)
@@ -121,5 +121,5 @@
 ! The first block if is for economy (no do loop start up) and the second
 ! for safety.
-!print *,'GPXYB: NDLNPR RHYDR0=',NDLNPR,RHYDR0
+!PRINT *,'GPXYB: NDLNPR RHYDR0=',NDLNPR,RHYDR0
 TOPPRES=0.1  !!!!! A REVOIR (MPL) 29042010 passe de 0 a 0.1 comme ARPEGE
 IF(PRES(KSTART,0) <= TOPPRES)THEN
@@ -139,5 +139,5 @@
 !              --------------------
 
-!print *,'NDLNPR LVERTFE',NDLNPR,LVERTFE
+!PRINT *,'NDLNPR LVERTFE',NDLNPR,LVERTFE
 IF(NDLNPR == 0) THEN
 
@@ -177,8 +177,8 @@
          & *(PVDELB(JLEV)+PVC(JLEV)*PLNPR(JLON,JLEV)*PRDELP(JLON,&
          & JLEV))  
-!       print *,'GPXYB JLEV JLON JJ PRES ZPRES PDELP ', JLEV,JLON,JJ,PRES(JLON,JLEV),ZRPRES(JLON,JJ),PDELP(JLON,JLEV)
-!       print *,'GPXYB JLEV JLON JM PRDELP PLNPR ', JLEV,JLON,JM,PRDELP(JLON,JLEV),PLNPR (JLON,JLEV)
-!       print *,'GPXYB JLEV JLON JJ PRPRES PALPH ', JLEV,JLON,JJ,PRPRES(JLON,JLEV),PALPH (JLON,JLEV)
-!       print *,'GPXYB JLEV JLON PRPP PRTGR PVDELB PVC ', JLEV,JLON,PRPP  (JLON,JLEV),PRTGR (JLON,JLEV),PVDELB(JLEV),PVC(JLEV)
+!       PRINT *,'GPXYB JLEV JLON JJ PRES ZPRES PDELP ', JLEV,JLON,JJ,PRES(JLON,JLEV),ZRPRES(JLON,JJ),PDELP(JLON,JLEV)
+!       PRINT *,'GPXYB JLEV JLON JM PRDELP PLNPR ', JLEV,JLON,JM,PRDELP(JLON,JLEV),PLNPR (JLON,JLEV)
+!       PRINT *,'GPXYB JLEV JLON JJ PRPRES PALPH ', JLEV,JLON,JJ,PRPRES(JLON,JLEV),PALPH (JLON,JLEV)
+!       PRINT *,'GPXYB JLEV JLON PRPP PRTGR PVDELB PVC ', JLEV,JLON,PRPP  (JLON,JLEV),PRTGR (JLON,JLEV),PVDELB(JLEV),PVC(JLEV)
       ENDDO
       JTEMP=JM
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lw.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lw.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lw.F90	(revision 5160)
@@ -142,5 +142,5 @@
 
 IF (LHOOK) CALL DR_HOOK('LW',0,ZHOOK_HANDLE)
-print *,'    LW: Avant LWU'
+PRINT *,'    LW: Avant LWU'
 CALL LWU &
  & (  KIDIA, KFDIA, KLON, KLEV,&
@@ -156,5 +156,5 @@
 !                ---------------------------------
 
-print *,'    LW: Avant LWBV'
+PRINT *,'    LW: Avant LWBV'
 CALL LWBV &
  & ( KIDIA, KFDIA, KLON , KLEV  , KMODE,&
@@ -169,5 +169,5 @@
 !                --------------------------------
 
-print *,'    LW: Avant LWC'
+PRINT *,'    LW: Avant LWC'
 CALL LWC &
  & ( KIDIA , KFDIA, KLON  , KLEV,&
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwb.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwb.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwb.F90	(revision 5160)
@@ -115,5 +115,5 @@
 !                  ------------------------------
 
-print *,'dans LWB'
+PRINT *,'dans LWB'
 IF (LHOOK) CALL DR_HOOK('LWB',0,ZHOOK_HANDLE)
 ILEV2=2*KLEV
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwbv.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwbv.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwbv.F90	(revision 5160)
@@ -123,5 +123,5 @@
 
 IF (LHOOK) CALL DR_HOOK('LWBV',0,ZHOOK_HANDLE)
-print *,'LWBV: avant LWB'
+PRINT *,'LWBV: avant LWB'
 CALL LWB &
  & ( KIDIA, KFDIA, KLON  , KLEV  , KMODE,&
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwc.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwc.F90	(revision 5160)
@@ -114,5 +114,5 @@
 !100  CONTINUE
 
-!      print *,' Enter LWC '
+!      PRINT *,' Enter LWC '
 IF (LHOOK) CALL DR_HOOK('LWC',0,ZHOOK_HANDLE)
 DO JL = KIDIA,KFDIA
@@ -152,5 +152,5 @@
   ENDDO
 ENDDO
-!      print *,' LWC after Initialisation to clear-sky fluxes'
+!      PRINT *,' LWC after Initialisation to clear-sky fluxes'
 
 !*         2.1     FLUXES FOR ONE OVERCAST UNITY EMISSIVITY CLOUD
@@ -211,5 +211,5 @@
 
 ENDDO
-!      print *,' LWC after 213: Fluxes for unity emissivity'
+!      PRINT *,' LWC after 213: Fluxes for unity emissivity'
 
 !*         2.2     CLOUD COVER MATRIX
@@ -228,5 +228,5 @@
   ENDDO
 ENDDO
-!      print *,' LWC after Initialisation CC matrix'
+!      PRINT *,' LWC after Initialisation CC matrix'
 
 !*         2.4     CLOUD COVER BELOW THE LEVEL OF CALCULATION
@@ -279,5 +279,5 @@
 
 ENDDO
-!      print *,' LWC after 244: CC below level of calculation'
+!      PRINT *,' LWC after 244: CC below level of calculation'
 
 !*         2.5     CLOUD COVER ABOVE THE LEVEL OF CALCULATION
@@ -329,5 +329,5 @@
   ENDDO
 ENDDO
-!      print *,' LWC after 254: CC above level of calculation'
+!      PRINT *,' LWC after 254: CC above level of calculation'
 
 !*         3.      FLUXES FOR PARTIAL/MULTIPLE LAYERED CLOUDINESS
@@ -371,5 +371,5 @@
 
 ENDDO
-!      print *,' LWC after 317: Downward fluxes'
+!      PRINT *,' LWC after 317: Downward fluxes'
 
 !*         3.2     UPWARD FLUX AT THE SURFACE
@@ -413,5 +413,5 @@
 
 ENDDO
-!      print *,' LWC after 337: Upward fluxes'
+!      PRINT *,' LWC after 337: Upward fluxes'
 
 !-----------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwu.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwu.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwu.F90	(revision 5160)
@@ -223,13 +223,13 @@
     IAE2 = 3 * KLEV + 1 - (IJ + 1)
     IAE3 = 3 * KLEV + 1 - IJPN
-    ! print *,'IAE1= ',IAE1
-    ! print *,'IAE2= ',IAE2
-    ! print *,'IAE3= ',IAE3
-    ! print *,'KIDIA= ',KIDIA
-    ! print *,'KFDIA= ',KFDIA
-    ! print *,'KLEV= ',KLEV
+    ! PRINT *,'IAE1= ',IAE1
+    ! PRINT *,'IAE2= ',IAE2
+    ! PRINT *,'IAE3= ',IAE3
+    ! PRINT *,'KIDIA= ',KIDIA
+    ! PRINT *,'KFDIA= ',KFDIA
+    ! PRINT *,'KLEV= ',KLEV
     DO JAE = 1, 6
       DO JL = KIDIA, KFDIA
-        !   print *,'JL= ',JL,'-JAE= ',JAE,'-JK= ',JK,'-NSIL= ',NSIL
+        !   PRINT *,'JL= ',JL,'-JAE= ',JAE,'-JK= ',JK,'-NSIL= ',NSIL
         ZUAER(JL, JAE) = &
                 & (RAER(JAE, 1) * PAER(JL, 1, JK) + RAER(JAE, 2) * PAER(JL, 2, JK)&
@@ -363,5 +363,5 @@
 
   ENDDO
-  !      print *,'END OF LWU'
+  !      PRINT *,'END OF LWU'
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/posnam.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/posnam.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/posnam.F90	(revision 5160)
@@ -71,8 +71,8 @@
 ISTATUS=0
 ISCAN=0
-print *,'On cherche a lire:',CDNAML
+PRINT *,'On cherche a lire:',CDNAML
 DO WHILE (ISTATUS==0 .AND. ISCAN==0)
   READ(KULNAM,'(A)',IOSTAT=ISTATUS) CLINE
-! print *,'CLINE,ISTATUS= ',CLINE,ISTATUS
+! PRINT *,'CLINE,ISTATUS= ',CLINE,ISTATUS
   SELECT CASE (ISTATUS)
   CASE (:-1)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/radlsw.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/radlsw.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/radlsw.F90	(revision 5160)
@@ -1064,5 +1064,5 @@
 !                 ------------------------------------
 
-!print *,'RADLSW: LPHYLIN, LRRTM',LPHYLIN, LRRTM
+!PRINT *,'RADLSW: LPHYLIN, LRRTM',LPHYLIN, LRRTM
 IF (.NOT.LPHYLIN) THEN
   IF ( .NOT. LRRTM) THEN
@@ -1076,5 +1076,5 @@
      & ZEMIT , PFLUX , PFLUC &
      & )  
-!   print *,'RADLSW: apres CALL LW'
+!   PRINT *,'RADLSW: apres CALL LW'
     IF(LLDEBUG) THEN
     call writefield_phy('radlsw_flux1',PFLUX(:,1,:),klev+1)
@@ -1103,5 +1103,5 @@
     ENDDO
 
-!   print *,'RADLSW: avant CALL RRTM_RRTM_140GP,PAP=',PAP(1,:)
+!   PRINT *,'RADLSW: avant CALL RRTM_RRTM_140GP,PAP=',PAP(1,:)
     CALL RRTM_RRTM_140GP &
      & ( KIDIA , KFDIA , KLON  , KLEV,&
@@ -1113,5 +1113,5 @@
      & PTAU_LW,&
      & ZEMIT , PFLUX , PFLUC , ZTCLEAR )
-!   print *,'RADLSW: apres CALL RRTM_RRTM_140GP'
+!   PRINT *,'RADLSW: apres CALL RRTM_RRTM_140GP'
 
   ENDIF
@@ -1120,5 +1120,5 @@
   PFLUX(:,:,:)= 0.0_JPRB
   PFLUC(:,:,:)= 0.0_JPRB
-! print *,'RADLSW: ZEMIT,PFLUX et PFLUC = 0'
+! PRINT *,'RADLSW: ZEMIT,PFLUX et PFLUC = 0'
 ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/read_rsun_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/read_rsun_rrtm.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/read_rsun_rrtm.F90	(revision 5160)
@@ -102,5 +102,5 @@
       solaire=TSI(days_elapsed+1)
 
-      print *,'READ_RSUN_RRTM day=', days_elapsed+1,' solaire=', solaire, ' RSUN=', RSUN(1:NSW)
+      PRINT *,'READ_RSUN_RRTM day=', days_elapsed+1,' solaire=', solaire, ' RSUN=', RSUN(1:NSW)
 
     ENDIF !--fin allocation
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/readaerosolstrato1_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/readaerosolstrato1_rrtm.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/readaerosolstrato1_rrtm.F90	(revision 5160)
@@ -85,5 +85,5 @@
 
     IF (nbands_sw_rrtm.NE.6) THEN 
-        print *,'nbands_sw_rrtm doit etre egal a 6 dans readaerosolstrat_rrtm'
+        PRINT *,'nbands_sw_rrtm doit etre egal a 6 dans readaerosolstrat_rrtm'
         STOP
     ENDIF
@@ -95,5 +95,5 @@
     n_lev = size(lev)
     IF (n_lev.NE.klev) THEN 
-       print *,'Le nombre de niveaux n est pas egal a klev'
+       PRINT *,'Le nombre de niveaux n est pas egal a klev'
        STOP
     ENDIF
@@ -102,9 +102,9 @@
     CALL nf95_gw_var(ncid_in, varid, latitude)
     n_lat = size(latitude)
-    print *, 'LAT aerosol strato=', n_lat, latitude
+    PRINT *, 'LAT aerosol strato=', n_lat, latitude
 
     IF (grid_type/=unstructured) THEN
       IF (n_lat.NE.nbp_lat) THEN 
-         print *,'Le nombre de lat n est pas egal a nbp_lat'
+         PRINT *,'Le nombre de lat n est pas egal a nbp_lat'
          STOP
       ENDIF
@@ -114,9 +114,9 @@
     CALL nf95_gw_var(ncid_in, varid, longitude)
     n_lon = size(longitude)
-    print *, 'LON aerosol strato=', n_lon, longitude
+    PRINT *, 'LON aerosol strato=', n_lon, longitude
 
     IF (grid_type/=unstructured) THEN
       IF (n_lon.NE.nbp_lon) THEN 
-         print *,'Le nombre de lon n est pas egal a nbp_lon'
+         PRINT *,'Le nombre de lon n est pas egal a nbp_lon'
          STOP
       ENDIF
@@ -127,7 +127,7 @@
     CALL nf95_gw_var(ncid_in, varid, time)
     n_month = size(time)
-    print *, 'TIME aerosol strato=', n_month, time
+    PRINT *, 'TIME aerosol strato=', n_month, time
     IF (n_month.NE.12) THEN 
-       print *,'Le nombre de month n est pas egal a 12'
+       PRINT *,'Le nombre de month n est pas egal a 12'
        STOP
     ENDIF
@@ -140,5 +140,5 @@
     CALL nf95_inq_varid(ncid_in, "TAUSTRAT", varid)
     ncerr = nf90_get_var(ncid_in, varid, tauaerstrat)
-    print *,'code erreur readaerosolstrato=', ncerr, varid
+    PRINT *,'code erreur readaerosolstrato=', ncerr, varid
 
     CALL nf95_close(ncid_in)
@@ -146,5 +146,5 @@
 !---select the correct month
     IF (mth_cur.LT.1.OR.mth_cur.GT.12) THEN
-      print *,'probleme avec le mois dans readaerosolstrat =', mth_cur
+      PRINT *,'probleme avec le mois dans readaerosolstrat =', mth_cur
     ENDIF
     tauaerstrat_mois(:,:,:) = tauaerstrat(:,:,:,mth_cur)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90	(revision 5160)
@@ -92,5 +92,5 @@
 !--check mth_cur
         IF (mth_cur.LT.1.OR.mth_cur.GT.12) THEN
-          print *,'probleme avec le mois dans readaerosolstrat =', mth_cur
+          PRINT *,'probleme avec le mois dans readaerosolstrat =', mth_cur
         ENDIF
 
@@ -116,5 +116,5 @@
         IF (grid_type/=unstructured) THEN
            IF (n_lat.NE.nbp_lat) THEN 
-             print *, 'latitude=', n_lat, nbp_lat
+             PRINT *, 'latitude=', n_lat, nbp_lat
              abort_message='Le nombre de lat n est pas egal a nbp_lat'
              CALL abort_physic(modname,abort_message,1)
@@ -133,5 +133,5 @@
         CALL nf95_gw_var(ncid_in, varid, wav)
         n_wav = size(wav)
-        print *, 'WAV aerosol strato=', n_wav, wav
+        PRINT *, 'WAV aerosol strato=', n_wav, wav
         IF (n_wav.NE.NSW) THEN 
            abort_message='Le nombre de wav n est pas egal a NSW'
@@ -146,15 +146,15 @@
         CALL nf95_inq_varid(ncid_in, "TAU_SUN", varid)
         ncerr = nf90_get_var(ncid_in, varid, tauaerstrat)
-        print *,'code erreur readaerosolstrato=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato=', ncerr, varid
 
 !--reading stratospheric aerosol omega per layer
         CALL nf95_inq_varid(ncid_in, "OME_SUN", varid)
         ncerr = nf90_get_var(ncid_in, varid, pizaerstrat)
-        print *,'code erreur readaerosolstrato=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato=', ncerr, varid
 
 !--reading stratospheric aerosol g per layer
         CALL nf95_inq_varid(ncid_in, "GGG_SUN", varid)
         ncerr = nf90_get_var(ncid_in, varid, cgaerstrat)
-        print *,'code erreur readaerosolstrato sw=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato sw=', ncerr, varid
 
         CALL nf95_close(ncid_in)
@@ -224,5 +224,5 @@
         CALL nf95_gw_var(ncid_in, varid, wav)
         n_wav = size(wav)
-        print *, 'WAV aerosol strato=', n_wav, wav
+        PRINT *, 'WAV aerosol strato=', n_wav, wav
         IF (n_wav.NE.NLW) THEN 
            abort_message='Le nombre de wav n est pas egal a NLW'
@@ -235,5 +235,5 @@
         CALL nf95_inq_varid(ncid_in, "TAU_EAR", varid)
         ncerr = nf90_get_var(ncid_in, varid, taulwaerstrat)
-        print *,'code erreur readaerosolstrato lw=', ncerr, varid
+        PRINT *,'code erreur readaerosolstrato lw=', ncerr, varid
 
         CALL nf95_close(ncid_in)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/rrtm_rtrn1a_140gp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/rrtm_rtrn1a_140gp.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/rrtm_rtrn1a_140gp.F90	(revision 5160)
@@ -529,5 +529,5 @@
 DO I_LEV = 1, KLEV
   DO IBAND = K_ISTART, K_IEND
-! print *,'RTRN1A: I_LEV JPLAY IBAND INDLAY',I_LEV,JPLAY,IBAND,INDLAY(I_LEV)
+! PRINT *,'RTRN1A: I_LEV JPLAY IBAND INDLAY',I_LEV,JPLAY,IBAND,INDLAY(I_LEV)
 !----              
 !- Calculate the integrated Planck functions for at the
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_cldprop.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_cldprop.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_cldprop.F90	(revision 5160)
@@ -116,5 +116,5 @@
 
 IF (I_NDBUG <= 2) THEN
-  print *,'cldprop before loop K_INFLAG, K_ICEFLAG, K_LIQFLAG:',K_INFLAG,K_ICEFLAG,K_LIQFLAG,IB1,IB2
+  PRINT *,'cldprop before loop K_INFLAG, K_ICEFLAG, K_LIQFLAG:',K_INFLAG,K_ICEFLAG,K_LIQFLAG,IB1,IB2
 ENDIF
 
@@ -216,5 +216,5 @@
         ENDDO
       ENDIF
-      print *,'end of ice computations for I_LAY=',I_LAY
+      PRINT *,'end of ice computations for I_LAY=',I_LAY
                   
 !  Calculation of absorption coefficients due to water clouds.
@@ -270,5 +270,5 @@
 
       IF (I_NDBUG <= 1) THEN
-        print *,'end of liquid water computations for I_LAY=',I_LAY
+        PRINT *,'end of liquid water computations for I_LAY=',I_LAY
       ENDIF
 
@@ -332,5 +332,5 @@
 
 IF (I_NDBUG <= 1) THEN
-  print *,'about to leave SRTM_CLDPROP'
+  PRINT *,'about to leave SRTM_CLDPROP'
 ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_setcoef.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_setcoef.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_setcoef.F90	(revision 5160)
@@ -94,5 +94,5 @@
 
 !IF (NDBUG.LE.3) THEN
-!  print *,'-------- Computed in SETCOEF --------'
+!  PRINT *,'-------- Computed in SETCOEF --------'
 !  print 8990
 8990 format(18x,'  T     PFAC00,    01,    10,    11  PCO2MULT     MOL   &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_spcvrt.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_spcvrt.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_spcvrt.F90	(revision 5160)
@@ -203,5 +203,5 @@
 IB1=JPB1
 IB2=JPB2
-!print *,'IB1, IB2, KSW, KMOL, KLEV: ', IB1,IB2,KSW,KMOL,KLEV
+!PRINT *,'IB1, IB2, KSW, KMOL, KLEV: ', IB1,IB2,KSW,KMOL,KLEV
 
 IW=0
@@ -215,5 +215,5 @@
   ZINCF14(IBM)=0.0_JPRB
 
-!  print *,'=== spectral band === JB= ',JB,' ====== i.e. IBM= ',IBM,' with IGT= ',IGT
+!  PRINT *,'=== spectral band === JB= ',JB,' ====== i.e. IBM= ',IBM,' with IGT= ',IGT
         
 !-- for each band, computes the gaseous and Rayleigh optical thickness 
@@ -229,5 +229,5 @@
      &   ZSFLXZEN, ZTAUG    , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL16'
+!    PRINT *,'After  SRTM_TAUMOL16'
 
   ELSEIF (JB == 17) THEN
@@ -240,5 +240,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL17'
+!    PRINT *,'After  SRTM_TAUMOL17'
 
   ELSEIF (JB == 18) THEN
@@ -251,5 +251,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL18'
+!    PRINT *,'After  SRTM_TAUMOL18'
 
   ELSEIF (JB == 19) THEN
@@ -262,5 +262,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL19'
+!    PRINT *,'After  SRTM_TAUMOL19'
 
   ELSEIF (JB == 20) THEN
@@ -273,5 +273,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL20'
+!    PRINT *,'After  SRTM_TAUMOL20'
 
   ELSEIF (JB == 21) THEN
@@ -284,5 +284,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL21'
+!    PRINT *,'After  SRTM_TAUMOL21'
 
   ELSEIF (JB == 22) THEN
@@ -295,5 +295,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL22'
+!    PRINT *,'After  SRTM_TAUMOL22'
 
   ELSEIF (JB == 23) THEN
@@ -306,5 +306,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL23'
+!    PRINT *,'After  SRTM_TAUMOL23'
 
   ELSEIF (JB == 24) THEN
@@ -317,5 +317,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL24'
+!    PRINT *,'After  SRTM_TAUMOL24'
 
   ELSEIF (JB == 25) THEN
@@ -329,5 +329,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR   &
      & )  
-!    print *,'After  SRTM_TAUMOL25'
+!    PRINT *,'After  SRTM_TAUMOL25'
 
   ELSEIF (JB == 26) THEN
@@ -341,5 +341,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL26'
+!    PRINT *,'After  SRTM_TAUMOL26'
 
   ELSEIF (JB == 27) THEN
@@ -353,5 +353,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL27'
+!    PRINT *,'After  SRTM_TAUMOL27'
 
   ELSEIF (JB == 28) THEN
@@ -365,5 +365,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR  &
      & )  
-!    print *,'After  SRTM_TAUMOL28'
+!    PRINT *,'After  SRTM_TAUMOL28'
 
   ELSEIF (JB == 29) THEN
@@ -376,23 +376,23 @@
      &   ZSFLXZEN , ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL29'
+!    PRINT *,'After  SRTM_TAUMOL29'
 
   ENDIF
 
 !  IF (NDBUG.LE.3) THEN
-!    print *,'Incident Solar Flux'
+!    PRINT *,'Incident Solar Flux'
 !    PRINT 9010,(ZSFLXZEN(JG),JG=1,16)
   9010 format(1x,'SolFlx ',16F8.4)
-!    print *,'Optical thickness for molecular absorption for JB= ',JB 
+!    PRINT *,'Optical thickness for molecular absorption for JB= ',JB
 !    DO JK=1,KLEV
 !      PRINT 9011,JK,(ZTAUG(JK,JG),JG=1,16)
   9011  format(1x,'TauGas ',I3,16E9.2)
 !    ENDDO
-!    print *,'Optical thickness for Rayleigh scattering for JB= ',JB 
+!    PRINT *,'Optical thickness for Rayleigh scattering for JB= ',JB
 !    DO JK=1,KLEV
 !      PRINT 9012,JK,(ZTAUR(JK,JG),JG=1,16)
   9012  format(1x,'TauRay ',I3,16E9.2)
 !    ENDDO
-!    print *,'Cloud optical properties for JB= ',JB
+!    PRINT *,'Cloud optical properties for JB= ',JB
 !    DO JK=1,KLEV
 !      PRINT 9013,JK,PFRCL(JK),PTAUC(JK,IBM),POMGC(JK,IBM),PASYC(JK,IBM)
@@ -405,5 +405,5 @@
 
 !    IF (NDBUG.LE.1) THEN
-!      print *,' === JG= ',JG,' === for JB= ',JB,' with IW, IBM, JPLAY, KLEV=',IW,IBM,JPLAY,KLEV
+!      PRINT *,' === JG= ',JG,' === for JB= ',JB,' with IW, IBM, JPLAY, KLEV=',IW,IBM,JPLAY,KLEV
 !    ENDIF
 
@@ -460,5 +460,5 @@
     ZRUP(KLEV+1) =PALBP(IBM)
     ZRUPD(KLEV+1)=PALBD(IBM)
-!    if (NDBUG < 2) print *,'SWSPCTRL after 1 with JB,JG,IBM and IW= ',JB,JG,IBM,IW
+!    if (NDBUG < 2) PRINT *,'SWSPCTRL after 1 with JB,JG,IBM and IW= ',JB,JG,IBM,IW
     
     DO JK=1,KLEV
@@ -511,5 +511,5 @@
 !      end if
     ENDDO    
-!    if (NDBUG < 2) print *,'SWSPCTRL after 2'
+!    if (NDBUG < 2) PRINT *,'SWSPCTRL after 2'
 
 !-- Delta scaling for clear-sky / aerosol optical quantities
@@ -525,5 +525,5 @@
      &   LLRTCHK, ZGCC  , PRMU0, ZTAUC , ZOMCC ,&
      &   ZREFC  , ZREFDC, ZTRAC, ZTRADC )  
-!    if (NDBUG < 2) print *,'SWSPCTR after SWREFTRA for clear-sky'
+!    if (NDBUG < 2) PRINT *,'SWSPCTR after SWREFTRA for clear-sky'
     
 !-- Delta scaling for cloudy quantities
@@ -545,10 +545,10 @@
 
     ENDDO
-!    if (NDBUG < 2) print *,'SWSPCTR after Delta scaling'
+!    if (NDBUG < 2) PRINT *,'SWSPCTR after Delta scaling'
     
     CALL SRTM_REFTRA ( KLEV, I_KMODTS ,&
      &   LLRTCHK, ZGCO  , PRMU0, ZTAUO , ZOMCO ,&
      &   ZREFO , ZREFDO, ZTRAO, ZTRADO )  
-!    if (NDBUG < 2) print *,'SWSPCTR after SWREFTRA for cloudy'
+!    if (NDBUG < 2) PRINT *,'SWSPCTR after SWREFTRA for cloudy'
 
     DO JK=1,KLEV
@@ -582,9 +582,9 @@
 
     ENDDO           
-!    if (NDBUG < 2) print *,'SRTM_SPCVRT after combining clear and cloudy'
+!    if (NDBUG < 2) PRINT *,'SRTM_SPCVRT after combining clear and cloudy'
                  
 !-- vertical quadrature producing clear-sky fluxes
 
-!    print *,'SRTM_SPCVRT after 3 before SRTM_VRTQDR clear'
+!    PRINT *,'SRTM_SPCVRT after 3 before SRTM_VRTQDR clear'
     
     CALL SRTM_VRTQDR ( KLEV, IW ,&
@@ -594,5 +594,5 @@
       
 !    IF (NDBUG < 2) THEN
-!      print *,'SRTM_SPCVRT out of SRTM_VRTQDR for clear IW=',IW  
+!      PRINT *,'SRTM_SPCVRT out of SRTM_VRTQDR for clear IW=',IW
 !      DO JK=1,KLEV+1
 !        print 9201,JK,ZCD(JK,IW),ZCU(JK,IW)
@@ -603,5 +603,5 @@
 !-- vertical quadrature producing cloudy fluxes
 
-!    print *,'SRTM_SPCVRT after 4 before SRTM_VRTQDR cloudy'
+!    PRINT *,'SRTM_SPCVRT after 4 before SRTM_VRTQDR cloudy'
     
     CALL SRTM_VRTQDR ( KLEV, IW ,&
@@ -611,5 +611,5 @@
  
 !    IF (NDBUG < 2) THEN     
-!      print *,'SRTM_SPCVRT out of SRTM_VRTQDR for cloudy IW=',IW
+!      PRINT *,'SRTM_SPCVRT out of SRTM_VRTQDR for cloudy IW=',IW
 !      DO JK=1,KLEV+1
 !        print 9202,JK,ZFD(JK,IW),ZFU(JK,IW)
@@ -655,12 +655,12 @@
     ENDDO
 
-!    if (NDBUG < 2) print *,'SRTM_SPCVRT end of JG=',JG,' for JB=',JB,' i.e. IW=',IW
+!    if (NDBUG < 2) PRINT *,'SRTM_SPCVRT end of JG=',JG,' for JB=',JB,' i.e. IW=',IW
   ENDDO             
 !-- end loop on JG
 
-!  print *,' --- JB= ',JB,' with IB1, IB2= ',IB1,IB2
+!  PRINT *,' --- JB= ',JB,' with IB1, IB2= ',IB1,IB2
 ENDDO                    
 !-- end loop on JB
-!if (NDBUG < 2) print *,'SRTM_SPCVRT about to come out'
+!if (NDBUG < 2) PRINT *,'SRTM_SPCVRT about to come out'
 
 !DO IBM=1,14
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_spcvrt_mcica.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_spcvrt_mcica.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_spcvrt_mcica.F90	(revision 5160)
@@ -210,5 +210,5 @@
 IB1=JPB1
 IB2=JPB2
-!print *,'IB1, IB2, KSW, KMOL, KLEV: ', IB1,IB2,KSW,KMOL,KLEV
+!PRINT *,'IB1, IB2, KSW, KMOL, KLEV: ', IB1,IB2,KSW,KMOL,KLEV
 
 IW=0
@@ -222,5 +222,5 @@
   ZINCF14(IBM)=0.0_JPRB
 
-!  print *,'=== spectral band === JB= ',JB,' ====== i.e. IBM= ',IBM,' with IGT= ',IGT
+!  PRINT *,'=== spectral band === JB= ',JB,' ====== i.e. IBM= ',IBM,' with IGT= ',IGT
         
 !-- for each band, computes the gaseous and Rayleigh optical thickness 
@@ -236,5 +236,5 @@
      &   ZSFLXZEN, ZTAUG    , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL16'
+!    PRINT *,'After  SRTM_TAUMOL16'
 
   ELSEIF (JB == 17) THEN
@@ -247,5 +247,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL17'
+!    PRINT *,'After  SRTM_TAUMOL17'
 
   ELSEIF (JB == 18) THEN
@@ -258,5 +258,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL18'
+!    PRINT *,'After  SRTM_TAUMOL18'
 
   ELSEIF (JB == 19) THEN
@@ -269,5 +269,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL19'
+!    PRINT *,'After  SRTM_TAUMOL19'
 
   ELSEIF (JB == 20) THEN
@@ -280,5 +280,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL20'
+!    PRINT *,'After  SRTM_TAUMOL20'
 
   ELSEIF (JB == 21) THEN
@@ -291,5 +291,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL21'
+!    PRINT *,'After  SRTM_TAUMOL21'
 
   ELSEIF (JB == 22) THEN
@@ -302,5 +302,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL22'
+!    PRINT *,'After  SRTM_TAUMOL22'
 
   ELSEIF (JB == 23) THEN
@@ -313,5 +313,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL23'
+!    PRINT *,'After  SRTM_TAUMOL23'
 
   ELSEIF (JB == 24) THEN
@@ -324,5 +324,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL24'
+!    PRINT *,'After  SRTM_TAUMOL24'
 
   ELSEIF (JB == 25) THEN
@@ -336,5 +336,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR   &
      & )  
-!    print *,'After  SRTM_TAUMOL25'
+!    PRINT *,'After  SRTM_TAUMOL25'
 
   ELSEIF (JB == 26) THEN
@@ -348,5 +348,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL26'
+!    PRINT *,'After  SRTM_TAUMOL26'
 
   ELSEIF (JB == 27) THEN
@@ -360,5 +360,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL27'
+!    PRINT *,'After  SRTM_TAUMOL27'
 
   ELSEIF (JB == 28) THEN
@@ -372,5 +372,5 @@
      &   ZSFLXZEN, ZTAUG   , ZTAUR  &
      & )  
-!    print *,'After  SRTM_TAUMOL28'
+!    PRINT *,'After  SRTM_TAUMOL28'
 
   ELSEIF (JB == 29) THEN
@@ -383,18 +383,18 @@
      &   ZSFLXZEN , ZTAUG   , ZTAUR    &
      & )  
-!    print *,'After  SRTM_TAUMOL29'
+!    PRINT *,'After  SRTM_TAUMOL29'
 
   ENDIF
 
 !  IF (NDBUG.LE.3) THEN
-!    print *,'Incident Solar Flux'
+!    PRINT *,'Incident Solar Flux'
 !    PRINT 9010,(ZSFLXZEN(JG),JG=1,16)
   9010 format(1x,'SolFlx ',16F8.4)
-!    print *,'Optical thickness for molecular absorption for JB= ',JB 
+!    PRINT *,'Optical thickness for molecular absorption for JB= ',JB
 !    DO JK=1,KLEV
 !      PRINT 9011,JK,(ZTAUG(JK,JG),JG=1,16)
   9011  format(1x,'TauGas ',I3,16E9.2)
 !    ENDDO
-!    print *,'Optical thickness for Rayleigh scattering for JB= ',JB 
+!    PRINT *,'Optical thickness for Rayleigh scattering for JB= ',JB
 !    DO JK=1,KLEV
 !      PRINT 9012,JK,(ZTAUR(JK,JG),JG=1,16)
@@ -407,8 +407,8 @@
 
 !    IF (NDBUG.LE.1) THEN
-!      print *,' === JG= ',JG,' === for JB= ',JB,' with IW, IBM, JPLAY, KLEV=',IW,IBM,JPLAY,KLEV
+!      PRINT *,' === JG= ',JG,' === for JB= ',JB,' with IW, IBM, JPLAY, KLEV=',IW,IBM,JPLAY,KLEV
 !    ENDIF
 !    IF (NDBUG.LE.3) THEN
-!      print *,'Cloud optical properties for JB= ',JB
+!      PRINT *,'Cloud optical properties for JB= ',JB
 !      DO JK=1,KLEV
 !        PRINT 9013,JK,PFRCL(IW,JK),PTAUC(JK,IW),POMGC(JK,IW),PASYC(JK,IW)
@@ -469,5 +469,5 @@
     ZRUP(KLEV+1) =PALBP(IBM)
     ZRUPD(KLEV+1)=PALBD(IBM)
-!    if (NDBUG < 2) print *,'SWSPCTRL after 1 with JB,JG,IBM and IW= ',JB,JG,IBM,IW
+!    if (NDBUG < 2) PRINT *,'SWSPCTRL after 1 with JB,JG,IBM and IW= ',JB,JG,IBM,IW
     
 
@@ -523,5 +523,5 @@
 !      end if
     ENDDO    
-!    if (NDBUG < 2) print *,'SWSPCTRL after 2'
+!    if (NDBUG < 2) PRINT *,'SWSPCTRL after 2'
 
 !-- Delta scaling for clear-sky / aerosol optical quantities
@@ -537,5 +537,5 @@
      &   LLRTCHK, ZGCC  , PRMU0, ZTAUC , ZOMCC ,&
      &   ZREFC  , ZREFDC, ZTRAC, ZTRADC )  
-!    if (NDBUG < 2) print *,'SWSPCTR after SWREFTRA for clear-sky'
+!    if (NDBUG < 2) PRINT *,'SWSPCTR after SWREFTRA for clear-sky'
     
 !-- Delta scaling for cloudy quantities
@@ -557,10 +557,10 @@
 
     ENDDO
-!    if (NDBUG < 2) print *,'SWSPCTR after Delta scaling'
+!    if (NDBUG < 2) PRINT *,'SWSPCTR after Delta scaling'
     
     CALL SRTM_REFTRA ( KLEV, I_KMODTS ,&
      &   LLRTCHK, ZGCO  , PRMU0, ZTAUO , ZOMCO ,&
      &   ZREFO , ZREFDO, ZTRAO, ZTRADO )  
-!    if (NDBUG < 2) print *,'SWSPCTR after SWREFTRA for cloudy'
+!    if (NDBUG < 2) PRINT *,'SWSPCTR after SWREFTRA for cloudy'
 
     DO JK=1,KLEV
@@ -606,9 +606,9 @@
 
     ENDDO           
-!    if (NDBUG < 2) print *,'SRTM_SPCVRT after combining clear and cloudy'
+!    if (NDBUG < 2) PRINT *,'SRTM_SPCVRT after combining clear and cloudy'
                  
 !-- vertical quadrature producing clear-sky fluxes
 
-!    print *,'SRTM_SPCVRT after 3 before SRTM_VRTQDR clear'
+!    PRINT *,'SRTM_SPCVRT after 3 before SRTM_VRTQDR clear'
     
     CALL SRTM_VRTQDR ( KLEV, IW ,&
@@ -618,5 +618,5 @@
       
 !    IF (NDBUG < 2) THEN
-!      print *,'SRTM_SPCVRT out of SRTM_VRTQDR for clear IW=',IW  
+!      PRINT *,'SRTM_SPCVRT out of SRTM_VRTQDR for clear IW=',IW
 !      DO JK=1,KLEV+1
 !        print 9201,JK,ZCD(JK,IW),ZCU(JK,IW)
@@ -627,5 +627,5 @@
 !-- vertical quadrature producing cloudy fluxes
 
-!    print *,'SRTM_SPCVRT after 4 before SRTM_VRTQDR cloudy'
+!    PRINT *,'SRTM_SPCVRT after 4 before SRTM_VRTQDR cloudy'
     
     CALL SRTM_VRTQDR ( KLEV, IW ,&
@@ -635,5 +635,5 @@
  
 !    IF (NDBUG < 2) THEN     
-!      print *,'SRTM_SPCVRT out of SRTM_VRTQDR for cloudy IW=',IW
+!      PRINT *,'SRTM_SPCVRT out of SRTM_VRTQDR for cloudy IW=',IW
 !      DO JK=1,KLEV+1
 !        print 9202,JK,ZFD(JK,IW),ZFU(JK,IW)
@@ -679,13 +679,13 @@
     ENDDO
 
-!    if (NDBUG < 2) print *,'SRTM_SPCVRT end of JG=',JG,' for JB=',JB,' i.e. IW=',IW
+!    if (NDBUG < 2) PRINT *,'SRTM_SPCVRT end of JG=',JG,' for JB=',JB,' i.e. IW=',IW
   ENDDO             
 !-- end loop on JG
 
-!  print *,' --- JB= ',JB,' with IB1, IB2= ',IB1,IB2
+!  PRINT *,' --- JB= ',JB,' with IB1, IB2= ',IB1,IB2
 ENDDO                    
 !-- end loop on JB
-!if (NDBUG < 2) print *,'SRTM_SPCVRT about to come out'
-!print *,'SRTM_SPCVRT about to come out'
+!if (NDBUG < 2) PRINT *,'SRTM_SPCVRT about to come out'
+!PRINT *,'SRTM_SPCVRT about to come out'
 
 !DO IBM=1,14
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_srtm_224gp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_srtm_224gp.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_srtm_224gp.F90	(revision 5160)
@@ -133,5 +133,5 @@
   IOVLP = 3
 
-  !print *,'Entering srtm_srtm_224gp'
+  !PRINT *,'Entering srtm_srtm_224gp'
 
   ICLDATM = 1
@@ -148,5 +148,5 @@
       !- coefficients related to the cloud optical properties (original RRTM_SW)
 
-      !  print *,'just before SRTM_CLDPROP'
+      !  PRINT *,'just before SRTM_CLDPROP'
 
       !  DO JK=1,KLEV
@@ -218,5 +218,5 @@
       ENDDO
 
-      !  print *,'ZTOTCC ZCLEAR : ',ZTOTCC,' ',ZCLEAR
+      !  PRINT *,'ZTOTCC ZCLEAR : ',ZTOTCC,' ',ZCLEAR
 
       DO IMOL = 1, I_NMOL
@@ -236,5 +236,5 @@
       !    ENDIF
 
-      !  print *,'just before SRTM_SETCOEF'
+      !  PRINT *,'just before SRTM_SETCOEF'
 
       ZFRCL(1:KLEV) = PFRCL(JL, 1:KLEV)
@@ -253,5 +253,5 @@
               &)
 
-      !  print *,'just after SRTM_SETCOEF'
+      !  PRINT *,'just after SRTM_SETCOEF'
 
       !- call the radiation transfer routine
@@ -271,5 +271,5 @@
       !- mixing of aerosols
 
-      !  print *,'Aerosol optical properties computations'
+      !  PRINT *,'Aerosol optical properties computations'
       !  DO JSW=1,KSW
       !    print 9012,JSW,(JAE,RSRTAUA(JSW,JAE),RSRPIZA(JSW,JAE),RSRASYA(JSW,JAE),JAE=1,6)
@@ -335,5 +335,5 @@
       ENDDO
 
-      !  print *,'just before calling STRM_SPCVRT for JL=',JL,' and ZRMU0=',ZRMU0
+      !  PRINT *,'just before calling STRM_SPCVRT for JL=',JL,' and ZRMU0=',ZRMU0
 
       CALL SRTM_SPCVRT &
@@ -351,5 +351,5 @@
               &)
 
-      !  print *,'SRTM_SRTM_224GP before potential scaling'
+      !  PRINT *,'SRTM_SRTM_224GP before potential scaling'
       !    IF (IOVLP == 3) THEN
       !      DO JK=1,KLEV+1
@@ -362,5 +362,5 @@
       !      ENDDO
       !    ELSE
-      !    print *,'SRTM_SRTM_224GP after potential scaling'
+      !    PRINT *,'SRTM_SRTM_224GP after potential scaling'
       DO JK = 1, KLEV + 1
         PFSUC(JL, 1, JK) = ZADJI0 * ZBBCU(JK)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_srtm_224gp_mcica.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_srtm_224gp_mcica.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_srtm_224gp_mcica.F90	(revision 5160)
@@ -144,5 +144,5 @@
   IOVLP = 3
 
-  !print *,'Entering srtm_srtm_224gp_mcica'
+  !PRINT *,'Entering srtm_srtm_224gp_mcica'
 
   ICLDATM = 1
@@ -159,5 +159,5 @@
       !- coefficients related to the cloud optical properties (original RRTM_SW)
 
-      !  print *,'just before SRTM_CLDPROP'
+      !  PRINT *,'just before SRTM_CLDPROP'
 
       !  DO JK=1,KLEV
@@ -214,5 +214,5 @@
       ENDDO
 
-      !  print *,'ZTOTCC ZCLEAR : ',ZTOTCC,' ',ZCLEAR
+      !  PRINT *,'ZTOTCC ZCLEAR : ',ZTOTCC,' ',ZCLEAR
 
       DO IMOL = 1, ITMOL
@@ -222,5 +222,5 @@
       ENDDO
 
-      !  print *,'just before SRTM_SETCOEF'
+      !  PRINT *,'just before SRTM_SETCOEF'
 
       CALL SRTM_SETCOEF &
@@ -235,5 +235,5 @@
               &)
 
-      !  print *,'just after SRTM_SETCOEF'
+      !  PRINT *,'just after SRTM_SETCOEF'
 
       !- call the radiation transfer routine
@@ -265,5 +265,5 @@
       !- mixing of aerosols
 
-      !  print *,'Aerosol optical properties computations'
+      !  PRINT *,'Aerosol optical properties computations'
       !  DO JSW=1,KSW
       !    print 9012,JSW,(JAE,RSRTAUA(JSW,JAE),RSRPIZA(JSW,JAE),RSRASYA(JSW,JAE),JAE=1,6)
@@ -329,5 +329,5 @@
       ENDDO
 
-      !    print *,'just before calling STRM_SPCVRT for JL=',JL,' and ZRMU0=',ZRMU0
+      !    PRINT *,'just before calling STRM_SPCVRT for JL=',JL,' and ZRMU0=',ZRMU0
 
       CALL SRTM_SPCVRT_MCICA &
@@ -347,5 +347,5 @@
       !     & )
 
-      !  print *,'SRTM_SRTM_224GP before potential scaling'
+      !  PRINT *,'SRTM_SRTM_224GP before potential scaling'
       !    IF (IOVLP == 3) THEN
       !      DO JK=1,KLEV+1
@@ -358,5 +358,5 @@
       !      ENDDO
       !    ELSE
-      !    print *,'SRTM_SRTM_224GP after potential scaling'
+      !    PRINT *,'SRTM_SRTM_224GP after potential scaling'
       DO JK = 1, KLEV + 1
         PFSUC(JL, 1, JK) = ZADJI0 * ZBBCU(JK)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_vrtqdr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_vrtqdr.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/srtm_vrtqdr.F90	(revision 5160)
@@ -114,5 +114,5 @@
 !  print 9201,PRUP(KLEV),PRUPD(KLEV)
 9201 format(1x,'link surf:',6E13.6)
-!  print *,'SRTM_VRTQDR after linking with surface layer'
+!  PRINT *,'SRTM_VRTQDR after linking with surface layer'
 !END IF
     
@@ -134,5 +134,5 @@
   9203 format(1x,'bot2top:',6E13.6)
 ENDDO
-!print *,'SRTM_VRTQDR after passing from bottom to top'
+!PRINT *,'SRTM_VRTQDR after passing from bottom to top'
     
 !-- upper boundary conditions
@@ -146,5 +146,5 @@
 !  print 9204,ZTDN(1),PRDND(1),ZTDN(2),PRDND(2)
 9204 format(1x,'link upper bound:',6E13.6)
-!  print *,'SRTM_VRTQDR after upper boundary conditions'
+!  PRINT *,'SRTM_VRTQDR after upper boundary conditions'
 !END IF
     
@@ -166,5 +166,5 @@
 
 ENDDO
-!print *,'SRTM_VRTQDR after passing from top to bottom'
+!PRINT *,'SRTM_VRTQDR after passing from top to bottom'
                                               
 !-- up and down-welling fluxes at levels
@@ -190,7 +190,7 @@
 
 ENDDO
-!print *,'SRTM_VRTQDR after up and down flux'
+!PRINT *,'SRTM_VRTQDR after up and down flux'
    
-!print *,'SRTM_VRTQDR about to come out'
+!PRINT *,'SRTM_VRTQDR about to come out'
 !     ------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/su_aerw.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/su_aerw.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/su_aerw.F90	(revision 5160)
@@ -90,5 +90,5 @@
 !                   ----------------------------
 
-print *,'DANS SU_AERW'
+PRINT *,'DANS SU_AERW'
 NBINAER(:) = (/ 3, 3, 2, 2, 1, 1, 1, 1, 1 /)
 
@@ -166,7 +166,7 @@
 
   CALL SU_AERP
-print *,'SU_AERW: apres SU_AERP'
+PRINT *,'SU_AERW: apres SU_AERP'
   CALL SU_AEROP
-print *,'SU_AERW: apres SU_AEROP'
+PRINT *,'SU_AERW: apres SU_AEROP'
 
 IF (LEPAERO) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/sucst.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/sucst.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/sucst.F90	(revision 5160)
@@ -202,11 +202,11 @@
 RBETW=RLVTT/RV+RGAMW*RTT
 RALPW=LOG(RESTT)+RBETW/RTT+RGAMW*LOG(RTT)
-print *,'SUCST: RESTT,RBETW,RTT,RGAMW',RESTT,RBETW,RTT,RGAMW
-print *,'SUCST: RALPW',RALPW
+PRINT *,'SUCST: RESTT,RBETW,RTT,RGAMW',RESTT,RBETW,RTT,RGAMW
+PRINT *,'SUCST: RALPW',RALPW
 RGAMS=(RCS-RCPV)/RV
 RBETS=RLSTT/RV+RGAMS*RTT
 RALPS=LOG(RESTT)+RBETS/RTT+RGAMS*LOG(RTT)
-print *,'SUCST: RESTT,RBETS,RTT,RGAMS',RESTT,RBETS,RTT,RGAMS
-print *,'SUCST: RALPS',RALPS
+PRINT *,'SUCST: RESTT,RBETS,RTT,RGAMS',RESTT,RBETS,RTT,RGAMS
+PRINT *,'SUCST: RALPS',RALPS
 RGAMS=(RCS-RCPV)/RV
 RGAMD=RGAMS-RGAMW
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suecrad.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suecrad.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suecrad.F90	(revision 5160)
@@ -295,5 +295,5 @@
   NRADIP = 3            ! before 3?R1 default=2     3
   NRADLP = 2            ! before 3?R1 default=2    2
-  print *, 'SUECRAD: NRADLP, NRADIP=', NRADLP, NRADIP
+  PRINT *, 'SUECRAD: NRADLP, NRADIP=', NRADLP, NRADIP
   RRe2De = 0.64952_JPRB ! before 3?R1 default=0.5_JPRB
 
@@ -345,5 +345,5 @@
   !- interaction radiation / prognostic O3 off by default
   LEPO3RA = .FALSE.
-  print *, 'SUECRAD-0'
+  PRINT *, 'SUECRAD-0'
   IF (.NOT.YO3%LGP) THEN
     LEPO3RA = .FALSE.
@@ -407,5 +407,5 @@
     NOVLP = 1
   END SELECT
-  print *, 'SUECRAD: NOVLP=', NOVLP
+  PRINT *, 'SUECRAD: NOVLP=', NOVLP
   NLW = 16
   NTSW = 14
@@ -462,9 +462,9 @@
   RCCFC11 = CFC11_ppt * 1.0e-12
   RCCFC12 = CFC12_ppt * 1.0e-12
-  !print *,'LMDZSUECRAD-1 RCCO2=',RCCO2
-  !print *,'LMDZSUECRAD-1 RCCH4=',RCCH4
-  !print *,'LMDZSUECRAD-1 RCN2O=',RCN2O
-  !print *,'LMDZSUECRAD-1 RCCFC11=',RCCFC11
-  !print *,'LMDZSUECRAD-1 RCCFC12=',RCCFC12
+  !PRINT *,'LMDZSUECRAD-1 RCCO2=',RCCO2
+  !PRINT *,'LMDZSUECRAD-1 RCCH4=',RCCH4
+  !PRINT *,'LMDZSUECRAD-1 RCN2O=',RCN2O
+  !PRINT *,'LMDZSUECRAD-1 RCCFC11=',RCCFC11
+  !PRINT *,'LMDZSUECRAD-1 RCCFC12=',RCCFC12
   !     ------------------------------------------------------------------
 
@@ -474,5 +474,5 @@
   !CALL POSNAM(NULNAM,'NAERAD')
   !READ (NULNAM,NAERAD)
-  print *, 'SUECRAD-2'
+  PRINT *, 'SUECRAD-2'
 
   !CALL POSNAM(NULNAM,'NAEAER')
@@ -510,5 +510,5 @@
     RSWINHF = 0.7_JPRB
   ENDIF
-  print *, 'SUECRAD-3'
+  PRINT *, 'SUECRAD-3'
 
   !- for McICA computations, make sure these parameters are as follows ...
@@ -520,5 +520,5 @@
     CALL SU_McICA
   ENDIF
-  print *, 'SUECRAD-4'
+  PRINT *, 'SUECRAD-4'
 
   IF(LLDEBUG)THEN
@@ -613,5 +613,5 @@
         ENDIF
       ENDIF
-      print *, 'SUECRAD-5'
+      PRINT *, 'SUECRAD-5'
 
       ! test if radiation grid resolution has been set
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suinit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suinit.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suinit.F90	(revision 5160)
@@ -94,5 +94,5 @@
 !          NDLNPR=1: formulation of delta used in non hydrostatic model,
 NDLNPR=0
-print *,'SUINIT: RHYDR0 NDLNPR',RHYDR0,NDLNPR
+PRINT *,'SUINIT: RHYDR0 NDLNPR',RHYDR0,NDLNPR
 
 !----------------------------------------------------------------
@@ -114,5 +114,5 @@
 NSSSSS=0  ! LMDZ demarre tjrs a 00h -- MPL 15.04.09
 CALL SUCST(6,NINDAT,NSSSSS,1)
-print *,'SUINIT: NINDAT, NSSSSS',NINDAT, NSSSSS
+PRINT *,'SUINIT: NINDAT, NSSSSS',NINDAT, NSSSSS
 
 IF (LLDEBUG) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suovlp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suovlp.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suovlp.F90	(revision 5160)
@@ -43,5 +43,5 @@
 DO JK=1,KLEV
   RA1OVLP(JK)=RAOVLP*STZ(JK)+RBOVLP
-  print *,'SU_OVLP: JK RAOVLP STZ RBOVLP:',JK,RAOVLP,STZ(JK),RBOVLP
+  PRINT *,'SU_OVLP: JK RAOVLP STZ RBOVLP:',JK,RAOVLP,STZ(JK),RBOVLP
 ENDDO  
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphec.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphec.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphec.F90	(revision 5160)
@@ -190,5 +190,5 @@
 !  VAH(JLEV)=ap(JLEV+1)ap(JLEV+1)
 !  VBH(JLEV)=bp(JLEV+1)
-!  print *,'SUPHEC: jlev ap bp',JLEV,ap(JLEV+1),bp(JLEV+1)
+!  PRINT *,'SUPHEC: jlev ap bp',JLEV,ap(JLEV+1),bp(JLEV+1)
    VAH(JLEV)=ap(NFLEVG+1-JLEV)
    VBH(JLEV)=bp(NFLEVG+1-JLEV)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphmf.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphmf.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphmf.F90	(revision 5160)
@@ -93,21 +93,21 @@
 
 IF (LHOOK) CALL DR_HOOK('SUPHMF',0,ZHOOK_HANDLE)
-print *,'SUPHMF: avant SU0PHY'
+PRINT *,'SUPHMF: avant SU0PHY'
 CALL SU0PHY(KULOUT)
-print *,'SUPHMF: avant SUPHY0'
+PRINT *,'SUPHMF: avant SUPHY0'
 CALL SUPHY0(KULOUT)
-print *,'SUPHMF: avant SUPHY1'
+PRINT *,'SUPHMF: avant SUPHY1'
 CALL SUPHY1(KULOUT)
-print *,'SUPHMF: avant SUPHY2'
+PRINT *,'SUPHMF: avant SUPHY2'
 CALL SUPHY2(KULOUT)
-print *,'SUPHMF: avant SUPHY3'
+PRINT *,'SUPHMF: avant SUPHY3'
 CALL SUPHY3(KULOUT)
-print *,'SUPHMF: avant SUTOPH'
+PRINT *,'SUPHMF: avant SUTOPH'
 CALL SUTOPH(KULOUT)
-print *,'SUPHMF: avant VAL923'
+PRINT *,'SUPHMF: avant VAL923'
 
 CALL VAL923(LSOLV)
 
-print *,'SUPHMF: avant SUCAPE'
+PRINT *,'SUPHMF: avant SUCAPE'
 CALL SUCAPE(KULOUT)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphy.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/suphy.F90	(revision 5160)
@@ -97,8 +97,8 @@
 !              --------------------
 
-print *,'---- SUPHY: avant SUPHMF'
+PRINT *,'---- SUPHY: avant SUPHMF'
 CALL SUPHMF(KULOUT)
 
-print *,'---- SUPHY: avant SUGFL'
+PRINT *,'---- SUPHY: avant SUGFL'
 !SUGFL: Set up unified_treatment grid-point fields
 CALL SUGFL
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/sw1s.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/sw1s.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/sw1s.F90	(revision 5160)
@@ -191,5 +191,5 @@
 !   IKL = KLEV+1-JK
 !   DO JL = KIDIA,KFDIA
-!   print *,'Apres SWCLR,SWR RMU0 RMUE ',ZRMU0(JL,IKL),ZRMUE(JL,IKL)
+!   PRINT *,'Apres SWCLR,SWR RMU0 RMUE ',ZRMU0(JL,IKL),ZRMUE(JL,IKL)
 !   ENDDO
 ! ENDDO
@@ -303,5 +303,5 @@
 
 ELSEIF (NSW == 6) THEN
-!print *,'... dans SW1S: NSW=',NSW
+!PRINT *,'... dans SW1S: NSW=',NSW
 
 !*         3.2   SIX SPECTRAL INTERVALS
@@ -425,5 +425,5 @@
       PCU(JL,JK) = ZDIRF(JL) * RSUN(KNU)
 !WRITE(*,'("---> Dans SW1S:")')
-!print *,'===JL= ',jl
+!PRINT *,'===JL= ',jl
 !WRITE(*,'("ZR1",10E12.5)') (ZR(JL,1))
 !WRITE(*,'("ZR2",10E12.5)') (ZR(JL,2))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swclr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swclr.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swclr.F90	(revision 5160)
@@ -229,5 +229,5 @@
 ! MPLFH : ZTRAY N'EST PAS INITIALISE !!!!! A REVOIR (MPL)
       ZTRAY= PRAYL(JL) * PDSIG(JL,JK)
-!     print *,'>>>>>>> swclr: ZTRAY ',ZTRAY
+!     PRINT *,'>>>>>>> swclr: ZTRAY ',ZTRAY
       ZDENB = ZTRAY + PTAUAZ(JL,JK)*(1.0_JPRB-PPIZAZ(JL,JK)*ZFF)
       ZRATIO=ZTRAY/ZDENB
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swtt1.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swtt1.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swtt1.F90	(revision 5160)
@@ -91,5 +91,5 @@
 DO JA = 1,KABS
   IA=KIND(JA)
-! print *,'SWTT1: KNU', KNU
+! PRINT *,'SWTT1: KNU', KNU
   DO JL = KIDIA,KFDIA
     ZU(JL) = PU(JL,JA)
@@ -98,5 +98,5 @@
      & * ( APAD(KNU,IA,5) + ZU(JL) * (APAD(KNU,IA,6) + ZU(JL)&
      & * ( APAD(KNU,IA,7) ))))))  
-!    print *,'SWTT1 ZU APAD',IA,ZU(JL),APAD(KNU,IA,1),APAD(KNU,IA,2),&
+!    PRINT *,'SWTT1 ZU APAD',IA,ZU(JL),APAD(KNU,IA,1),APAD(KNU,IA,2),&
 !    &APAD(KNU,IA,3),APAD(KNU,IA,4),APAD(KNU,IA,5),APAD(KNU,IA,6),APAD(KNU,IA,7)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swu.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swu.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swu.F90	(revision 5160)
@@ -180,7 +180,7 @@
     ZO175(JL) = ZN175(JL)
     ZO190(JL) = ZN190(JL)
-!print *,'SWU: RTH2O RTDH2O RTUMG RTDUMG',RTH2O,RTDH2O,RTUMG,RTDUMG
-!print *,'SWU: RPNH ZDSH2O ZWH2O ZRTH',RPNH,ZDSH2O,ZWH2O,ZRTH
-!print *,'SWU: RPNU ZDSCO2 PCARDI ZRTU',RPNU,ZDSCO2,PCARDI,ZRTU
+!PRINT *,'SWU: RTH2O RTDH2O RTUMG RTDUMG',RTH2O,RTDH2O,RTUMG,RTDUMG
+!PRINT *,'SWU: RPNH ZDSH2O ZWH2O ZRTH',RPNH,ZDSH2O,ZWH2O,ZRTH
+!PRINT *,'SWU: RPNU ZDSCO2 PCARDI ZRTU',RPNU,ZDSCO2,PCARDI,ZRTU
 
 !++MODIFCODE
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swuvo3.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swuvo3.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/swuvo3.F90	(revision 5160)
@@ -90,5 +90,5 @@
 LLDEBUG=.FALSE.
 
-!print *,'Dans SWUVO3, N_VMASS= ',N_VMASS
+!PRINT *,'Dans SWUVO3, N_VMASS= ',N_VMASS
 IF(N_VMASS > 0) THEN
   JLEN=KFDIA-KIDIA+N_VMASS-MOD(KFDIA-KIDIA,N_VMASS)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/slab_heat_transp_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/slab_heat_transp_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/slab_heat_transp_mod.F90	(revision 5160)
@@ -170,37 +170,37 @@
     alpha_var = .FALSE.
     CALL getin('slab_alphav', alpha_var)
-    print *, 'alpha variable', alpha_var
+    PRINT *, 'alpha variable', alpha_var
     !  centered ou upstream scheme for meridional transport
     slab_upstream = .FALSE.
     CALL getin('slab_upstream', slab_upstream)
-    print *, 'upstream slab scheme', slab_upstream
+    PRINT *, 'upstream slab scheme', slab_upstream
     ! Sverdrup balance at equator ?
     slab_sverdrup = .TRUE.
     CALL getin('slab_sverdrup', slab_sverdrup)
-    print *, 'Sverdrup balance', slab_sverdrup
+    PRINT *, 'Sverdrup balance', slab_sverdrup
     ! Use tauy for meridional flux at equator ?
     slab_tyeq = .TRUE.
     CALL getin('slab_tyeq', slab_tyeq)
-    print *, 'Tauy forcing at equator', slab_tyeq
+    PRINT *, 'Tauy forcing at equator', slab_tyeq
     ! Use tauy for meridional flux at equator ?
     ekman_zonadv = .TRUE.
     CALL getin('slab_ekman_zonadv', ekman_zonadv)
-    print *, 'Use Ekman flow in zonal direction', ekman_zonadv
+    PRINT *, 'Use Ekman flow in zonal direction', ekman_zonadv
     ! Use tauy for meridional flux at equator ?
     ekman_zonavg = .FALSE.
     CALL getin('slab_ekman_zonavg', ekman_zonavg)
-    print *, 'Use zonally-averaged wind stress ?', ekman_zonavg
+    PRINT *, 'Use zonally-averaged wind stress ?', ekman_zonavg
     ! Value of alpha
     alpham = 2. / 3.
     CALL getin('slab_alpha', alpham)
-    print *, 'slab_alpha', alpham
+    PRINT *, 'slab_alpha', alpham
     ! GM k coefficient (m2/s) for 2-layers
     gmkappa = 1000.
     CALL getin('slab_gmkappa', gmkappa)
-    print *, 'slab_gmkappa', gmkappa
+    PRINT *, 'slab_gmkappa', gmkappa
     ! GM k coefficient (m2/s) for 2-layers
     gm_smax = 2e-3
     CALL getin('slab_gm_smax', gm_smax)
-    print *, 'slab_gm_smax', gm_smax
+    PRINT *, 'slab_gm_smax', gm_smax
     ! -----------------------------------------------------------
     ! Define ocean / continent mask (no flux into continent cell)
@@ -240,5 +240,5 @@
       eps = 1e-5 ! Drag
       CALL getin('slab_eps', eps)
-      print *, 'epsilon=', eps
+      PRINT *, 'epsilon=', eps
       ff = fext * unsairez ! Coriolis
       ! coefs to convert tau_x, tau_y to Ekman mass fluxes
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/stdlevvar_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/stdlevvar_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/stdlevvar_mod.F90	(revision 5160)
@@ -130,7 +130,7 @@
     IF (ok_prescr_ust) THEN
       DO i = 1, knon
-        print *, 'cdram avant=', cdram(i)
+        PRINT *, 'cdram avant=', cdram(i)
         cdram(i) = ust * ust / speed(i) / speed(i)
-        print *, 'cdram ust speed apres=', cdram(i), ust, speed
+        PRINT *, 'cdram ust speed apres=', cdram(i), ust, speed
       ENDDO
     ENDIF
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/sw_aeroAR4.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/sw_aeroAR4.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/sw_aeroAR4.F90	(revision 5160)
@@ -97,7 +97,4 @@
 
   !* LOCAL VARIABLES:
-
-  REAL, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
-
   REAL(KIND=8) ZOZ(KDLON,KFLEV)
   ! column-density of ozone in layer, in kilo-Dobsons
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90	(revision 5159)
+++ 	(revision )
@@ -1,105 +1,0 @@
-
-! $Id$
-
-SUBROUTINE undefstd(itap, read_climoz)
-  USE netcdf, ONLY: nf90_fill_real
-  USE dimphy
-  USE phys_state_var_mod
-  USE lmdz_wxios, ONLY: missing_val_xios => missing_val, using_xios
-  USE lmdz_clesphys
-
-  IMPLICIT NONE
-  REAL :: missing_val
-
-  ! ====================================================================
-
-  ! I. Musat : 09.2004
-
-  ! Calcul * du nombre de pas de temps (FLOAT(ecrit_XXX)-tnondef))
-  ! ou la variable tlevSTD est bien definie (.NE.missing_val),
-  ! et
-  ! * de la somme de tlevSTD => tsumSTD
-
-  ! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps
-  ! de la physique
-  ! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps
-  ! de la physique
-  ! nout=3 !var. mensuelle "NMC" moyennee toutes les ecrit_hf
-
-
-  ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
-  ! ====================================================================
-
-  ! ymINCLUDE "dimphy.h"
-  ! variables Input
-
-  ! INTEGER nlevSTD, klevSTD, itap
-  ! PARAMETER(klevSTD=17)
-  INTEGER itap
-
-  ! variables locales
-  ! INTEGER i, k, nout, n
-  ! PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC
-  INTEGER i, k, n
-  ! REAL freq_calNMC(nout)
-  INTEGER read_climoz
-
-  ! variables Output
-  ! REAL tlevSTD(klon,klevSTD), tsumSTD(klon,klevSTD,nout)
-  ! LOGICAL oknondef(klon,klevSTD,nout)
-  ! REAL tnondef(klon,klevSTD,nout)
-
-! REAL missing_val
-
-! missing_val = nf90_fill_real
-  IF (using_xios) THEN
-    missing_val=missing_val_xios
-  ELSE
-      missing_val=missing_val_nf90
-  ENDIF
-
-  DO n = 1, nout
-
-
-    ! calcul variables tous les freq_calNMC(n)/phys_tstep pas de temps
-    ! de la physique
-
-    IF (mod(itap,nint(freq_calnmc(n)/phys_tstep))==0) THEN
-      DO k = 1, nlevstd
-        DO i = 1, klon
-          IF (tlevstd(i,k)==missing_val) THEN
-            ! IF(oknondef(i,k,n)) THEN
-            tnondef(i, k, n) = tnondef(i, k, n) + 1.
-            ! ENDIF !oknondef(i,k)
-
-          ELSE IF (tlevstd(i,k)/=missing_val) THEN
-            tsumstd(i, k, n) = tsumstd(i, k, n) + tlevstd(i, k)
-            usumstd(i, k, n) = usumstd(i, k, n) + ulevstd(i, k)
-            vsumstd(i, k, n) = vsumstd(i, k, n) + vlevstd(i, k)
-            wsumstd(i, k, n) = wsumstd(i, k, n) + wlevstd(i, k)
-            phisumstd(i, k, n) = phisumstd(i, k, n) + philevstd(i, k)
-            qsumstd(i, k, n) = qsumstd(i, k, n) + qlevstd(i, k)
-            rhsumstd(i, k, n) = rhsumstd(i, k, n) + rhlevstd(i, k)
-            uvsumstd(i, k, n) = uvsumstd(i, k, n) + uvstd(i, k)
-            vqsumstd(i, k, n) = vqsumstd(i, k, n) + vqstd(i, k)
-            vtsumstd(i, k, n) = vtsumstd(i, k, n) + vtstd(i, k)
-            wqsumstd(i, k, n) = wqsumstd(i, k, n) + wqstd(i, k)
-            vphisumstd(i, k, n) = vphisumstd(i, k, n) + vphistd(i, k)
-            wtsumstd(i, k, n) = wtsumstd(i, k, n) + wtstd(i, k)
-            u2sumstd(i, k, n) = u2sumstd(i, k, n) + u2std(i, k)
-            v2sumstd(i, k, n) = v2sumstd(i, k, n) + v2std(i, k)
-            t2sumstd(i, k, n) = t2sumstd(i, k, n) + t2std(i, k)
-            o3sumstd(i, k, n) = o3sumstd(i, k, n) + o3std(i, k)
-            IF (read_climoz==2) o3daysumstd(i, k, n) = o3daysumstd(i, k, n) + &
-              o3daystd(i, k)
-
-          END IF
-        END DO !i
-      END DO !k
-
-    END IF !MOD(itap,NINT(freq_calNMC(n)/phys_tstep)).EQ.0
-
-  END DO !n
-
-
-END SUBROUTINE undefstd
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_mod.F90	(revision 5160)
@@ -366,5 +366,5 @@
     !   L_v(1:knon) = RLvtt
 
-    !      print *,' AAAA wx_pbl_dTs, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
+    !      PRINT *,' AAAA wx_pbl_dTs, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
 
     T10_x(1:knon) = (AT_x(1:knon) / C_p(1:knon) - Kech_h_x(1:knon) * BT_x(1:knon) * dtime * Ts0_x(1:knon)) / &
@@ -449,5 +449,5 @@
     !!!! DO j = 1,knon
     !!!!  IF (mod(j,20) .EQ.0) THEN
-    !!!!   print *, '   j     dd_QQ       QQ_b  dd_HQphiQ  dd_HQphiT   dd_HQRn   HQphiQ_b   HQphiT_b     HQRn_b '
+    !!!!   PRINT *, '   j     dd_QQ       QQ_b  dd_HQphiQ  dd_HQphiT   dd_HQRn   HQphiQ_b   HQphiT_b     HQRn_b '
     !!!!  ENDIF
     !!!!   print 1789, j, dd_QQ(j), QQ_b(j), dd_HQphiQ(j), dd_HQphiT(j), dd_HQRn(j), HQphiQ_b(j), HQphiT_b(j), HQRn_b(j)
@@ -503,11 +503,11 @@
 
     IF (prt_level >= 10) THEN
-      print *, 'wx_pbl_merge, tau         ', tau
-      print *, 'wx_pbl_merge, AcoefT0     ', AcoefT0
-      print *, 'wx_pbl_merge, AcoefQ0     ', AcoefQ0
-      print *, 'wx_pbl_merge, BcoefT0     ', BcoefT0
-      print *, 'wx_pbl_merge, BcoefQ0     ', BcoefQ0
-      print *, 'wx_pbl_merge, qsat0_w, qsat0_x ', (qsat0_w(j), qsat0_x(j), j = 1, knon)
-      print *, 'wx_pbl_merge, dqsatdT0_w, dqsatdT0_x ', (dqsatdT0_w(j), dqsatdT0_x(j), j = 1, knon)
+      PRINT *, 'wx_pbl_merge, tau         ', tau
+      PRINT *, 'wx_pbl_merge, AcoefT0     ', AcoefT0
+      PRINT *, 'wx_pbl_merge, AcoefQ0     ', AcoefQ0
+      PRINT *, 'wx_pbl_merge, BcoefT0     ', BcoefT0
+      PRINT *, 'wx_pbl_merge, BcoefQ0     ', BcoefQ0
+      PRINT *, 'wx_pbl_merge, qsat0_w, qsat0_x ', (qsat0_w(j), qsat0_x(j), j = 1, knon)
+      PRINT *, 'wx_pbl_merge, dqsatdT0_w, dqsatdT0_x ', (dqsatdT0_w(j), dqsatdT0_x(j), j = 1, knon)
     ENDIF
 
@@ -535,8 +535,8 @@
 
     IF (prt_level >= 10) THEN
-      print *, 'wx_pbl_dts AAAA BcoefQ, BcoefQ0, sigw ', &
+      PRINT *, 'wx_pbl_dts AAAA BcoefQ, BcoefQ0, sigw ', &
               BcoefQ, BcoefQ0, sigw
-      print *, 'wx_pbl_dts_merge, dTs_ins      ', dTs_ins
-      print *, 'wx_pbl_dts_merge, dqs_ins      ', dqsatsrf_ins
+      PRINT *, 'wx_pbl_dts_merge, dTs_ins      ', dTs_ins
+      PRINT *, 'wx_pbl_dts_merge, dqs_ins      ', dqsatsrf_ins
     ENDIF
 
@@ -616,5 +616,5 @@
     sigx(:) = 1. - sigw(:)
 
-    !      print *,' AAAA wx_pbl_split, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
+    !      PRINT *,' AAAA wx_pbl_split, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
 
     IF (iflag_split == 2 .AND. nsrf /= is_oce) THEN
@@ -623,6 +623,6 @@
       !   -----------------------------------------
       IF (prt_level >=10) THEN
-        print *, ' wx_pbl_split, dTs_ins, dTs0 , Gamma_phiT, g_T ', dTs_ins, dTs0, Gamma_phiT, g_T
-        print *, ' wx_pbl_split, dqsatsrf_ins, Gamma_phiQ, g_q ', dqsatsrf_ins, Gamma_phiQ, g_q
+        PRINT *, ' wx_pbl_split, dTs_ins, dTs0 , Gamma_phiT, g_T ', dTs_ins, dTs0, Gamma_phiT, g_T
+        PRINT *, ' wx_pbl_split, dqsatsrf_ins, Gamma_phiQ, g_q ', dqsatsrf_ins, Gamma_phiQ, g_q
       ENDIF
 
@@ -634,7 +634,7 @@
 
       IF (prt_level >=10) THEN
-        print *, ' wx_pbl_split, dqsatsrf0, QQ_b ', dqsatsrf0, QQ_b
-        print *, ' wx_pbl_split, phiT0_b, phiT, dTs ', phiT0_b, phiT, dTs
-        print *, ' wx_pbl_split, phiQ0_b, phiQ, dqsatsrf ', phiQ0_b, phiQ, dqsatsrf
+        PRINT *, ' wx_pbl_split, dqsatsrf0, QQ_b ', dqsatsrf0, QQ_b
+        PRINT *, ' wx_pbl_split, phiT0_b, phiT, dTs ', phiT0_b, phiT, dTs
+        PRINT *, ' wx_pbl_split, phiQ0_b, phiQ, dqsatsrf ', phiQ0_b, phiQ, dqsatsrf
       ENDIF
     ELSE
@@ -671,16 +671,16 @@
 
     !!  Do j = 1,knon
-    !!     print *,'XXXsplit : j, q1_x(j), AQ_x(j), BQ_x(j), phiQ_x(j) ', j, q1_x(j), AQ_x(j), BQ_x(j), phiQ_x(j)
-    !!     print *,'XXXsplit : j, q1_w(j), AQ_w(j), BQ_w(j), phiQ_w(j) ', j, q1_w(j), AQ_w(j), BQ_w(j), phiQ_w(j)
+    !!     PRINT *,'XXXsplit : j, q1_x(j), AQ_x(j), BQ_x(j), phiQ_x(j) ', j, q1_x(j), AQ_x(j), BQ_x(j), phiQ_x(j)
+    !!     PRINT *,'XXXsplit : j, q1_w(j), AQ_w(j), BQ_w(j), phiQ_w(j) ', j, q1_w(j), AQ_w(j), BQ_w(j), phiQ_w(j)
     !!  ENDDO
 
     IF (prt_level >=10) THEN
-      print *, ' wx_pbl_split, phiT, dphiT, dTs ', phiT, dphiT, dTs
-      print *, ' wx_pbl_split, phiQ, dphiQ, dqsatsrf ', phiQ, dphiQ, dqsatsrf
+      PRINT *, ' wx_pbl_split, phiT, dphiT, dTs ', phiT, dphiT, dTs
+      PRINT *, ' wx_pbl_split, phiQ, dphiQ, dqsatsrf ', phiQ, dphiQ, dqsatsrf
     ENDIF
 
     IF (prt_level >=10) THEN
-      !!          print *,' wx_pbl_split, verif dqsatsrf = beta dqsatdT0 dTs '
-      !!          print *,' wx_pbl_split, dqsatsrf, dqsatdT0*dTs ', dqsatsrf, dqsatdT0*dTs
+      !!          PRINT *,' wx_pbl_split, verif dqsatsrf = beta dqsatdT0 dTs '
+      !!          PRINT *,' wx_pbl_split, dqsatsrf, dqsatdT0*dTs ', dqsatsrf, dqsatdT0*dTs
     ENDIF
 
@@ -809,5 +809,5 @@
     !!   L_v(1:knon) = RLvtt
     IF (prt_level >=10) THEN
-      print *, ' AAAA wx_pbl_check, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
+      PRINT *, ' AAAA wx_pbl_check, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
     ENDIF ! (prt_level >=10 )
 
@@ -829,30 +829,30 @@
       DO j = 1, knon
 
-        print *, 'wx_pbl_check: Kech_h, Kech_q ', Kech_h(j), Kech_q(j)
+        PRINT *, 'wx_pbl_check: Kech_h, Kech_q ', Kech_h(j), Kech_q(j)
 
         Ta(j) = (AcoefT(j) + BcoefT(j) * phiT_b9(j) * dtime) / C_p(j)
         qa(j) = AcoefQ(j) + BcoefQ(j) * phiQ_b9(j) * dtime
-        print *, 'wx_pbl_check: j, Ta, qa ', Ta(j), qa(j)
+        PRINT *, 'wx_pbl_check: j, Ta, qa ', Ta(j), qa(j)
 
         qsat_bs(j) = qsat01(j) + dqsatdT01(j) * (Ts_b9(j) - Ts0_b9(j))
 
-        print *, 'wx_pbl_check: qsat01, qsat_bs ', j, qsat01(j), qsat_bs(j)
+        PRINT *, 'wx_pbl_check: qsat01, qsat_bs ', j, qsat01(j), qsat_bs(j)
 
         Ts_x(j) = Ts_b9(j) - sigw(j) * dTs9(j)
         Ts_w(j) = Ts_b9(j) + sigx(j) * dTs9(j)
-        print *, 'wx_pbl_check: j, Ts_b9, Ts_w, Ts_x ', j, Ts_b9(j), Ts_w(j), Ts_x(j)
+        PRINT *, 'wx_pbl_check: j, Ts_b9, Ts_w, Ts_x ', j, Ts_b9(j), Ts_w(j), Ts_x(j)
 
         qsat_x(j) = qsat0_x(j) + dqsatdT0_x(j) * (Ts_x(j) - Ts0_x(j))
         qsat_w(j) = qsat0_w(j) + dqsatdT0_w(j) * (Ts_w(j) - Ts0_w(j))
 
-        print *, 'wx_pbl_check: qsat0_w, qsat0_x, qsat_w, qsat_x ', qsat0_w(j), qsat0_x(j), qsat_w(j), qsat_x(j)
+        PRINT *, 'wx_pbl_check: qsat0_w, qsat0_x, qsat_w, qsat_x ', qsat0_w(j), qsat0_x(j), qsat_w(j), qsat_x(j)
 
         T1_x(j) = (AcoefT_x(j) + BcoefT_x(j) * phiT_x9(j) * dtime) / C_p(j)
         T1_w(j) = (AcoefT_w(j) + BcoefT_w(j) * phiT_w9(j) * dtime) / C_p(j)
-        print *, 'wx_pbl_check: j, T1_w, T1_x ', j, T1_w(j), T1_x(j)
+        PRINT *, 'wx_pbl_check: j, T1_w, T1_x ', j, T1_w(j), T1_x(j)
 
         q1_x(j) = AQ_x(j) + BQ_x(j) * phiQ_x9(j) * dtime
         q1_w(j) = AQ_w(j) + BQ_w(j) * phiQ_w9(j) * dtime
-        print *, 'wx_pbl_check: j, q1_w, q1_x ', j, q1_w(j), q1_x(j)
+        PRINT *, 'wx_pbl_check: j, q1_w, q1_x ', j, q1_w(j), q1_x(j)
 
         qsatsrf_x(j) = beta(j) * qsat_x(j)
@@ -861,16 +861,16 @@
 
         dqsatsrf1 = qsatsrf_w(j) - qsatsrf_x(j)
-        print *, 'wx_pbl_check: j, qsatsrf_w, qsatsrf_x, dqsatsrf1, dqsatsrf9 ', &
+        PRINT *, 'wx_pbl_check: j, qsatsrf_w, qsatsrf_x, dqsatsrf1, dqsatsrf9 ', &
                 qsatsrf_w(j), qsatsrf_x(j), dqsatsrf1, dqsatsrf9(j)
 
         qsurf_x(j) = (1 - beta(j)) * q1_x(j) + qsatsrf_x(j)
         qsurf_w(j) = (1 - beta(j)) * q1_w(j) + qsatsrf_w(j)
-        print *, 'wx_pbl_check: j, qsurf_w, qsurf_x ', j, qsurf_w(j), qsurf_x(j)
+        PRINT *, 'wx_pbl_check: j, qsurf_w, qsurf_x ', j, qsurf_w(j), qsurf_x(j)
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
         !  Test qsat01 = qsat0    et   dqsatdT01 = dqsatdT0
         !------------------------------------------------------------------------------------------------------
-        print *, 'wx_pbl_check: j, qsat01(j), qsat0(j) ', j, qsat01(j), qsat0(j)
-        print *, 'wx_pbl_check: j, dqsatdT01(j), dqsatdT0(j) ', j, dqsatdT01(j), dqsatdT0(j)
+        PRINT *, 'wx_pbl_check: j, qsat01(j), qsat0(j) ', j, qsat01(j), qsat0(j)
+        PRINT *, 'wx_pbl_check: j, dqsatdT01(j), dqsatdT0(j) ', j, dqsatdT01(j), dqsatdT0(j)
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -879,6 +879,6 @@
         Kech_Q_sx1 = Kech_q_x(j) / (1. - beta(j) * Kech_q_x(j) * BQ_x(j) * dtime)
         Kech_Q_sw1 = Kech_q_w(j) / (1. - beta(j) * Kech_q_w(j) * BQ_w(j) * dtime)
-        print *, 'wx_pbl_check: j, Kech_Q_sx1, Kech_Q_sx(j)', j, Kech_Q_sx1, Kech_Q_sx(j)
-        print *, 'wx_pbl_check: j, Kech_Q_sw1, Kech_Q_sw(j)', j, Kech_Q_sw1, Kech_Q_sw(j)
+        PRINT *, 'wx_pbl_check: j, Kech_Q_sx1, Kech_Q_sx(j)', j, Kech_Q_sx1, Kech_Q_sx(j)
+        PRINT *, 'wx_pbl_check: j, Kech_Q_sw1, Kech_Q_sw(j)', j, Kech_Q_sw1, Kech_Q_sw(j)
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -893,6 +893,6 @@
         phiT_x2 = Kech_T_px(j) * (AcoefT_x(j) - C_p(j) * Ts_x(j))
         phiT_w2 = Kech_T_pw(j) * (AcoefT_w(j) - C_p(j) * Ts_w(j))
-        print *, 'wx_pbl_check: j, phiT_w1, phiT_w2, phiT_w9 ', j, phiT_w1, phiT_w2, phiT_w9(j)
-        print *, 'wx_pbl_check: j, phiT_x1, phiT_x2, phiT_x9 ', j, phiT_x1, phiT_x2, phiT_x9(j)
+        PRINT *, 'wx_pbl_check: j, phiT_w1, phiT_w2, phiT_w9 ', j, phiT_w1, phiT_w2, phiT_w9(j)
+        PRINT *, 'wx_pbl_check: j, phiT_x1, phiT_x2, phiT_x9 ', j, phiT_x1, phiT_x2, phiT_x9(j)
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -913,6 +913,6 @@
         phiq_x3 = Kech_q_x(j) * (q1_x(j) - qsurf_x(j))
         phiq_w3 = Kech_q_w(j) * (q1_w(j) - qsurf_w(j))
-        print *, 'wx_pbl_check: j, phiQ_w1, phiQ_w2, phiQ_w3, phiQ_w9 ', j, phiQ_w1, phiQ_w2, phiQ_w3, phiQ_w9(j)
-        print *, 'wx_pbl_check: j, phiQ_x1, phiQ_x2, phiQ_x3, phiQ_x9 ', j, phiQ_x1, phiQ_x2, phiQ_x3, phiQ_x9(j)
+        PRINT *, 'wx_pbl_check: j, phiQ_w1, phiQ_w2, phiQ_w3, phiQ_w9 ', j, phiQ_w1, phiQ_w2, phiQ_w3, phiQ_w9(j)
+        PRINT *, 'wx_pbl_check: j, phiQ_x1, phiQ_x2, phiQ_x3, phiQ_x9 ', j, phiQ_x1, phiQ_x2, phiQ_x3, phiQ_x9(j)
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -920,5 +920,5 @@
         !--------------------------------------------------------------
         phiT_b1 = Kech_h(j) * C_p(j) * (Ta(j) - Ts_b9(j))
-        print *, 'wx_pbl_check: j, phiT_b1, PhiT_b9 ', j, phiT_b1, PhiT_b9(j)
+        PRINT *, 'wx_pbl_check: j, phiT_b1, PhiT_b9 ', j, phiT_b1, PhiT_b9(j)
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -927,5 +927,5 @@
         evap_pot = Kech_q(j) * (qa(j) - qsat_bs(j))
         phiQ_b1 = beta(j) * Kech_q(j) * (qa(j) - qsat_bs(j))
-        print *, 'wx_pbl_check: j, beta, evap_pot, phiQ_b1, PhiQ_b9 ', j, beta(j), evap_pot, phiQ_b1, PhiQ_b9(j)
+        PRINT *, 'wx_pbl_check: j, beta, evap_pot, phiQ_b1, PhiQ_b9 ', j, beta(j), evap_pot, phiQ_b1, PhiQ_b9(j)
 
       ENDDO  ! j = 1, knon
@@ -1051,7 +1051,7 @@
 
     IF (prt_level >=10) THEN
-      print *, '->wx_pbl_dts_check, HTphiT_b, HTphiQ_b, HTRn_b ', &
+      PRINT *, '->wx_pbl_dts_check, HTphiT_b, HTphiQ_b, HTRn_b ', &
               HTphiT_b, HTphiQ_b, HTRn_b
-      print *, '->wx_pbl_dts_check, dd_HTphiT, dd_HTphiQ, dd_HTRn ', &
+      PRINT *, '->wx_pbl_dts_check, dd_HTphiT, dd_HTphiQ, dd_HTRn ', &
               dd_HTphiT, dd_HTphiQ, dd_HTRn
     ENDIF ! (prt_level >=10 )
@@ -1059,5 +1059,5 @@
     ! Compute the three qsat and dqsatdTs
     ! ---------------------------------------------
-    !!      print *,' AAAA wx_pbl_dts_check, C_p(j), qsat0(j), Ts0(j) : ',  &
+    !!      PRINT *,' AAAA wx_pbl_dts_check, C_p(j), qsat0(j), Ts0(j) : ',  &
     !!                                      (C_p(j), qsat0(j), Ts0(j), j = 1,knon)
 
@@ -1069,5 +1069,5 @@
         Ts_x(j) = Ts_b9(j) - sigw(j) * dTs9(j)
         Ts_w(j) = Ts_b9(j) + sigx(j) * dTs9(j)
-        print *, 'wx_pbl_dts_check: j, Ts_b9, Ts_w, Ts_x ', j, Ts_b9(j), Ts_w(j), Ts_x(j)
+        PRINT *, 'wx_pbl_dts_check: j, Ts_b9, Ts_w, Ts_x ', j, Ts_b9(j), Ts_w(j), Ts_x(j)
 
         qsat_x(j) = qsat0_x(j) + dqsatdT0_x(j) * (Ts_x(j) - Ts0_x(j))
@@ -1076,9 +1076,9 @@
         T1_x(j) = (AcoefT_x(j) + BcoefT_x(j) * phiT_x9(j) * dtime) / C_p(j)
         T1_w(j) = (AcoefT_w(j) + BcoefT_w(j) * phiT_w9(j) * dtime) / C_p(j)
-        print *, 'wx_pbl_dts_check: j, T1_w, T1_x ', j, T1_w(j), T1_x(j)
+        PRINT *, 'wx_pbl_dts_check: j, T1_w, T1_x ', j, T1_w(j), T1_x(j)
 
         q1_x(j) = AQ_x(j) + BQ_x(j) * phiQ_x9(j) * dtime
         q1_w(j) = AQ_w(j) + BQ_w(j) * phiQ_w9(j) * dtime
-        print *, 'wx_pbl_dts_check: j, q1_w, q1_x ', j, q1_w(j), q1_x(j)
+        PRINT *, 'wx_pbl_dts_check: j, q1_w, q1_x ', j, q1_w(j), q1_x(j)
 
         Rn_x(j) = eps_1 * Rsigma * T1_x(j)**4 - Rsigma * Ts_x(j)**4
@@ -1091,5 +1091,5 @@
                 + dd_HTRn(j) / HTphiT_b(j) * (phiT_b9(j) - phiT0_b9(j))
 
-        print *, 'wx_pbl_dts_check, dphiT, L_v*dphiQ, dRn, dTs ', &
+        PRINT *, 'wx_pbl_dts_check, dphiT, L_v*dphiQ, dRn, dTs ', &
                 phiT_w9(j) - phiT_x9(j), L_v(j) * (phiQ_w9(j) - phiQ_x9(j)), dRn(j), dTs9(j)
 
@@ -1100,8 +1100,8 @@
         !  Test phiQ_w-phiQ0_w = -beta*Kech_Q_sw*dqsatdT_w*(Ts_w-Ts0_w)
         !--------------------------------------------------------------
-        print *, 'wx_pbl_dts_check: beta(j), Kech_Q_sw(j), dqsatdT0_w(j), Ts_w(j), Ts0_w(j) ', &
+        PRINT *, 'wx_pbl_dts_check: beta(j), Kech_Q_sw(j), dqsatdT0_w(j), Ts_w(j), Ts0_w(j) ', &
                 beta(j), Kech_Q_sw(j), dqsatdT0_w(j), Ts_w(j), Ts0_w(j)
         phiQ_w_m_phiQ0_w = -beta(j) * Kech_Q_sw(j) * dqsatdT0_w(j) * (Ts_w(j) - Ts0_w(j))
-        print *, 'wx_pbl_dts_check: j, phiQ_w9-phiQ0_w, phiQ_w_m_phiQ0_w ', &
+        PRINT *, 'wx_pbl_dts_check: j, phiQ_w9-phiQ0_w, phiQ_w_m_phiQ0_w ', &
                 j, phiQ_w9(j) - phiQ0_w(j), phiQ_w_m_phiQ0_w
 
@@ -1110,5 +1110,5 @@
         !--------------------------------------------------------------
         phiQ_x_m_phiQ0_x = -beta(j) * Kech_Q_sx(j) * dqsatdT0_x(j) * (Ts_x(j) - Ts0_x(j))
-        print *, 'wx_pbl_dts_check: j, phiQ_x9-phiQ0_x, phiQ_x_m_phiQ0_x ', &
+        PRINT *, 'wx_pbl_dts_check: j, phiQ_x9-phiQ0_x, phiQ_x_m_phiQ0_x ', &
                 j, phiQ_x9(j) - phiQ0_x(j), phiQ_x_m_phiQ0_x
 
@@ -1119,5 +1119,5 @@
         dphiT_m_dphiT0 = -(HTphiT_b(j) + (sigx(j) - sigw(j)) * dd_HTphiT(j)) * (dTs9(j) - dTs09(j)) &
                 - dd_HTphiT(j) * (Ts_b9(j) - Ts0_b9(j))
-        print *, 'wx_pbl_dts_check: j, dphiT-dphiT09, dphiT_m_dphiT0 ', j, dphiT - dphiT09(j), dphiT_m_dphiT0
+        PRINT *, 'wx_pbl_dts_check: j, dphiT-dphiT09, dphiT_m_dphiT0 ', j, dphiT - dphiT09(j), dphiT_m_dphiT0
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1127,5 +1127,5 @@
         dphiQ_m_dphiQ0 = -(HTphiQ_b(j) + (sigx(j) - sigw(j)) * dd_HTphiQ(j)) * (dTs9(j) - dTs09(j)) &
                 - dd_HTphiQ(j) * (Ts_b9(j) - Ts0_b9(j))
-        print *, 'wx_pbl_dts_check: j, dphiQ-dphiQ09, dphiQ_m_dphiQ0 ', j, dphiQ - dphiQ09(j), dphiQ_m_dphiQ0
+        PRINT *, 'wx_pbl_dts_check: j, dphiQ-dphiQ09, dphiQ_m_dphiQ0 ', j, dphiQ - dphiQ09(j), dphiQ_m_dphiQ0
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1134,5 +1134,5 @@
         dRn_m_dRn0 = -(HTRn_b(j) + (sigx(j) - sigw(j)) * dd_HTRn(j)) * (dTs9(j) - dTs09(j)) &
                 - dd_HTRn(j) * (Ts_b9(j) - Ts0_b9(j))
-        print *, 'wx_pbl_dts_check: j, dRn-dRn09, dRn_m_dRn0 ', j, dRn - dRn09(j), dRn_m_dRn0
+        PRINT *, 'wx_pbl_dts_check: j, dRn-dRn09, dRn_m_dRn0 ', j, dRn - dRn09(j), dRn_m_dRn0
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1140,5 +1140,5 @@
         !-------------------------------------------------------------------------------
         phiTb_m_phiT0b = -sigx(j) * sigw(j) * dd_HTphiT(j) * (dTs9(j) - dTs09(j)) - HTphiT_b(j) * (Ts_b9(j) - Ts0_b9(j))
-        print *, 'wx_pbl_dts_check: j, phiT_b9-phiT0_b9, phiTb_m_phiT0b ', j, phiT_b9(j) - phiT0_b9(j), phiTb_m_phiT0b
+        PRINT *, 'wx_pbl_dts_check: j, phiT_b9-phiT0_b9, phiTb_m_phiT0b ', j, phiT_b9(j) - phiT0_b9(j), phiTb_m_phiT0b
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1148,5 +1148,5 @@
         err_phiT_x(j) = Kech_h_x(j) * C_p(j) * (T1_x(j) - Ts_x(j)) - phiT_x9(j)
         err_phiT_w(j) = Kech_h_w(j) * C_p(j) * (T1_w(j) - Ts_w(j)) - phiT_w9(j)
-        print *, 'wx_pbl_dts_check: j, phiT_w9, phiT_x9, err_phiT_w, err_phiT_x ', &
+        PRINT *, 'wx_pbl_dts_check: j, phiT_w9, phiT_x9, err_phiT_w, err_phiT_x ', &
                 j, phiT_w9(j), phiT_x9(j), err_phiT_w(j), err_phiT_x(j)
         dphiT = phiT_w9(j) - phiT_x9(j)
@@ -1156,5 +1156,5 @@
                 ) * (dTs9(j) - dTs09(j)) &
                 + dd_HTphiT(j) / HTphiT_b(j) * (phiT_b9(j) - phiT0_b9(j))
-        print *, 'wx_pbl_dts_check: j, dphiT, dphiT_H ', j, dphiT, dphiT_H
+        PRINT *, 'wx_pbl_dts_check: j, dphiT, dphiT_H ', j, dphiT, dphiT_H
 
         !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -1171,5 +1171,5 @@
                 ) * (dTs9(j) - dTs09(j)) &
                 + dd_HTphiQ(j) / HTphiT_b(j) * (phiT_b9(j) - phiT0_b9(j))
-        print *, 'wx_pbl_dts_check: j, dphiQ, dphiQ_H ', j, dphiQ, dphiQ_H
+        PRINT *, 'wx_pbl_dts_check: j, dphiQ, dphiQ_H ', j, dphiQ, dphiQ_H
 
         !  phiT_b = sigw phiT_w + sigx phiT_x                     dphiT = phiT_w - phiT_x
@@ -1183,5 +1183,5 @@
         Ta(j) = (AcoefT(j) + BcoefT(j) * phiT_b9(j) * dtime) / C_p(j)
         err2_phiT_b(j) = Kech_h(j) * C_p(j) * (Ta(j) - Ts_b9(j)) - phiT_b9(j)
-        print *, 'wx_pbl_dts_check: j, Ta, phiT_b9, err2_phiT_b ', &
+        PRINT *, 'wx_pbl_dts_check: j, Ta, phiT_b9, err2_phiT_b ', &
                 j, Ta(j), phiT_b9(j), err2_phiT_b(j)
 
@@ -1210,5 +1210,5 @@
 
       qsat_bs = qsat0(j) + dqsatdT0(j) * (Ts(j) - Ts0(j))
-      !!  print *,'wx_evappot : Kech_q, qsat_bs, qa, evap_pot ', Kech_q(j), qsat_bs, q1(j), evap_pot(j)
+      !!  PRINT *,'wx_evappot : Kech_q, qsat_bs, qa, evap_pot ', Kech_q(j), qsat_bs, q1(j), evap_pot(j)
     ENDDO
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_var_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_var_mod.F90	(revision 5160)
@@ -395,5 +395,5 @@
       C_p(j) = RCpd
 
-      !      print *,' AAAA wx_pbl0, C_p(j), qsat0(j), Ts0(j) : ', C_p(j), qsat0(j), Ts0(j)
+      !      PRINT *,' AAAA wx_pbl0, C_p(j), qsat0(j), Ts0(j) : ', C_p(j), qsat0(j), Ts0(j)
     ENDDO
     DO j = 1, knon
@@ -456,9 +456,9 @@
       dd_Km = Kech_m_w(j) - Kech_m_x(j)
       IF (prt_level >=10) THEN
-        print *, ' mod_wind_x, mod_wind_w ', mod_wind_x, mod_wind_w
-        print *, ' rho1 ', rho1
-        print *, ' ycdragh_x(j),ycdragm_x(j) ', ycdragh_x(j), ycdragm_x(j)
-        print *, ' ycdragh_w(j),ycdragm_w(j) ', ycdragh_w(j), ycdragm_w(j)
-        print *, ' dd_Kh: ', dd_Kh
+        PRINT *, ' mod_wind_x, mod_wind_w ', mod_wind_x, mod_wind_w
+        PRINT *, ' rho1 ', rho1
+        PRINT *, ' ycdragh_x(j),ycdragm_x(j) ', ycdragh_x(j), ycdragm_x(j)
+        PRINT *, ' ycdragh_w(j),ycdragm_w(j) ', ycdragh_w(j), ycdragm_w(j)
+        PRINT *, ' dd_Kh: ', dd_Kh
       ENDIF
 
@@ -521,8 +521,8 @@
 
       IF (prt_level >=10) THEN
-        print *, 'Variables pour la fusion : Kech_T_px(j)', Kech_T_px(j)
-        print *, 'Variables pour la fusion : Kech_T_pw(j)', Kech_T_pw(j)
-        print *, 'Variables pour la fusion : Kech_Tp(j)', Kech_Tp(j)
-        print *, 'Variables pour la fusion : Kech_h(j)', Kech_h(j)
+        PRINT *, 'Variables pour la fusion : Kech_T_px(j)', Kech_T_px(j)
+        PRINT *, 'Variables pour la fusion : Kech_T_pw(j)', Kech_T_pw(j)
+        PRINT *, 'Variables pour la fusion : Kech_Tp(j)', Kech_Tp(j)
+        PRINT *, 'Variables pour la fusion : Kech_h(j)', Kech_h(j)
       ENDIF
 
@@ -563,5 +563,5 @@
       KxKwQs(j) = Kech_Q_sx(j) * Kech_Q_sw(j)
 
-      !!  print *,'BBBBwx_prelim_beta : beta ', beta(j)
+      !!  PRINT *,'BBBBwx_prelim_beta : beta ', beta(j)
 
     ENDDO ! j = 1, knon
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/add_phys_tend_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/add_phys_tend_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/add_phys_tend_mod.F90	(revision 5160)
@@ -269,9 +269,9 @@
      debug_level=10
      IF (first) THEN
-        print *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
+        PRINT *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
         first=.FALSE.
      endif
 
-!  print *,'add_phys_tend: paprs ',paprs
+!  PRINT *,'add_phys_tend: paprs ',paprs
 ! When in diagnostic mode, save initial values of out variables
   IF (diag_mode == 1) THEN
@@ -746,9 +746,9 @@
      debug_level=10
      IF (first) THEN
-        print *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
+        PRINT *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
         first=.FALSE.
      endif
 
-!  print *,'add_phys_tend: paprs ',paprs
+!  PRINT *,'add_phys_tend: paprs ',paprs
 !======================================================================
 ! Diagnostics for energy conservation tests
@@ -813,7 +813,7 @@
     d_ek_col(:) = (zek_col(:,2)-zek_col(:,1))/phys_tstep
 
-   print *,'zdu ', zdu
-   print *,'zdv ', zdv
-   print *,'d_ek_col, zek_col(2), zek_col(1) ',d_ek_col(1), zek_col(1,2), zek_col(1,1)
+   PRINT *,'zdu ', zdu
+   PRINT *,'zdv ', zdv
+   PRINT *,'d_ek_col, zek_col(2), zek_col(1) ',d_ek_col(1), zek_col(1,2), zek_col(1,1)
 
     d_h_dair_col(:) = (zh_dair_col(:,2)-zh_dair_col(:,1))/phys_tstep
@@ -937,5 +937,5 @@
 bilh_ok=0
 
-!!print *,'prt_level:',prt_level,' fl_ebil:',fl_ebil,' fl_cor_ebil:',fl_cor_ebil
+!!PRINT *,'prt_level:',prt_level,' fl_ebil:',fl_ebil,' fl_cor_ebil:',fl_cor_ebil
 IF ( (fl_ebil > 0) .AND. (klon == 1)) THEN
   bilq_bnd = 0.
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/calcul_REGDYN.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/calcul_REGDYN.h	(revision 5159)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/calcul_REGDYN.h
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/calwake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/calwake.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/calwake.F90	(revision 5160)
@@ -143,5 +143,5 @@
 
   IF (prt_level >= 10) THEN
-    print *, '-> calwake, wake_s, wgen input ', wake_s(1), wgen(1)
+    PRINT *, '-> calwake, wake_s, wgen input ', wake_s(1), wgen(1)
   ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/chem.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/chem.h	(revision 5159)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/chem.h
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_enthalpmix.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_enthalpmix.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_enthalpmix.F90	(revision 5160)
@@ -78,5 +78,5 @@
 
 
-!!  print *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
+!!  PRINT *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
   plim2p(:) = min(plim2(:),plim1(:)-dpmin)
   j1(:)=nd
@@ -122,5 +122,5 @@
   END DO
 
-!!  print *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
+!!  PRINT *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
 
   DO j = 1, nd
@@ -135,5 +135,5 @@
         dpw(i) = dpw(i) + wi(i, j)
 
-!!  print *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
+!!  PRINT *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
 
       END IF
@@ -167,5 +167,5 @@
 
 
-!!  print *,'cv3_vertmix, rdcp ', rdcp  !jyg
+!!  PRINT *,'cv3_vertmix, rdcp ', rdcp  !jyg
 
 
@@ -233,5 +233,5 @@
   END DO
 
-!!  print *,' cv3_vertmix->'  !jyg
+!!  PRINT *,' cv3_vertmix->'  !jyg
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_estatmix.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_estatmix.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_estatmix.F90	(revision 5160)
@@ -81,5 +81,5 @@
 
 
-!!  print *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
+!!  PRINT *,' ->cv3_vertmix, plim1,plim2 ', plim1,plim2   !jyg
   plim2p(:) = min(plim2(:),plim1(:)-dpmin)
   j1(:)=nd
@@ -122,5 +122,5 @@
   END DO
 
-!!  print *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
+!!  PRINT *,'cv3_vertmix, j1,j2,coef ', j1,j2,coef  !jyg
 
   DO j = 1, nd
@@ -135,5 +135,5 @@
         dpw(i) = dpw(i) + wi(i, j)
 
-!!  print *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
+!!  PRINT *,'cv3_vertmix, j, wi(1,j),dpw ', j, wi(1,j),dpw  !jyg
 
       END IF
@@ -167,5 +167,5 @@
 
 
-!!  print *,'cv3_vertmix, rdcp ', rdcp  !jyg
+!!  PRINT *,'cv3_vertmix, rdcp ', rdcp  !jyg
 
   DO i = 1, len
@@ -216,5 +216,5 @@
   END DO
 
-!!  print *,' cv3_vertmix->'  !jyg
+!!  PRINT *,' cv3_vertmix->'  !jyg
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90	(revision 5160)
@@ -202,6 +202,6 @@
   INTEGER il
 
-!    print *,'cv3_incrcount : noconv_stop ',noconv_stop
-!    print *,'cv3_incrcount in, sig(1,nd) ',sig(1,nd)
+!    PRINT *,'cv3_incrcount : noconv_stop ',noconv_stop
+!    PRINT *,'cv3_incrcount in, sig(1,nd) ',sig(1,nd)
     IF(ok_convstop) THEN
       DO il = 1, len
@@ -215,5 +215,5 @@
       END DO
     ENDIF  ! (ok_convstop)
-!    print *,'cv3_incrcount out, sig(1,nd) ',sig(1,nd)
+!    PRINT *,'cv3_incrcount out, sig(1,nd) ',sig(1,nd)
 
 
@@ -280,5 +280,5 @@
                  (p(i,k-1)-p(i,k))/ph(i, k)        !convect3
 
-! c        print *,' gz(',k,')',gz(i,k),' tvx',tvx,' tvy ',tvy
+! c        PRINT *,' gz(',k,')',gz(i,k),' tvx',tvx,' tvy ',tvy
 
 ! ori         gz(i,k)=gz(i,k-1)+hrd*(tv(i,k-1)+tv(i,k))
@@ -611,5 +611,5 @@
   ENDIF
   IF (prt_level >= 10) THEN
-    print *,'cv3_feed : iflag(1), pfeed(1), plcl(1), wghti(1,k) ', &
+    PRINT *,'cv3_feed : iflag(1), pfeed(1), plcl(1), wghti(1,k) ', &
                         iflag(1), pfeed(1), plcl(1), (wghti(1,k),k=1,10)
   ENDIF
@@ -1582,5 +1582,5 @@
 #endif
   IF (prt_level >= 10) THEN
-    print *,'cv3_undilute2.0. icvflag_Tpa, t(1,k), q(1,k), qs(1,k) ', &
+    PRINT *,'cv3_undilute2.0. icvflag_Tpa, t(1,k), q(1,k), qs(1,k) ', &
                         icvflag_Tpa, (k, t(1,k), q(1,k), qs(1,k), k = 1,nl)
   ENDIF
@@ -1775,6 +1775,6 @@
             ENDIF ! (tg .gt. Tx)
 
-!!     print *,' j, k, Um, U, Ux, aa, bb, discr, dd, ddelta ', j, k, Um, U, Ux, aa, bb, discr, dd, ddelta
-!!     print *,' j, k, ah0(i), ahg, tg, qg, tp(i,k), ff ', j, k, ah0(i), ahg, tg, qg, tp(i,k), ff
+!!     PRINT *,' j, k, Um, U, Ux, aa, bb, discr, dd, ddelta ', j, k, Um, U, Ux, aa, bb, discr, dd, ddelta
+!!     PRINT *,' j, k, ah0(i), ahg, tg, qg, tp(i,k), ff ', j, k, ah0(i), ahg, tg, qg, tp(i,k), ff
           END IF ! (k>=(icbs(i)+1))
         END DO ! i = 1, ncum
@@ -1839,5 +1839,5 @@
             Tp(i,k) = tg + (ah0(i) - ahg)/ &
                     (cpd + (cl-cpd)*qta(i,k-1) + (lv(i,k)+frac(i,k)*lf(i,k))*dqgdT)
-!!   print *,'undilute2 iterations k, Tp(i,k), ah0(i), ahg ', &
+!!   PRINT *,'undilute2 iterations k, Tp(i,k), ah0(i), ahg ', &
 !!                                 k, Tp(i,k), ah0(i), ahg
           END IF ! (k>=(icbs(i)+1))
@@ -2216,5 +2216,5 @@
 !   =========================================================================
   IF (prt_level >= 10) THEN
-    print *,'cv3_undilute2.1. tp(1,k), tvp(1,k) ', &
+    PRINT *,'cv3_undilute2.1. tp(1,k), tvp(1,k) ', &
                           (k, tp(1,k), tvp(1,k), k = 1,nl)
   ENDIF
@@ -3696,5 +3696,5 @@
 
 ! ------------------------------------------------------
-IF (prt_level >= 10) print *,' ->cv3_unsat, iflag(1) ', iflag(1)
+IF (prt_level >= 10) PRINT *,' ->cv3_unsat, iflag(1) ', iflag(1)
 
 smallestreal=tiny(smallestreal)
@@ -4114,5 +4114,5 @@
 !    water(il,i)=revap*revap
 !    prec(il,i)=revap*revap
-!!        print *,' i,b6,c6,revap,evap(il,i),water(il,i),wdtrain(il) ', &
+!!        PRINT *,' i,b6,c6,revap,evap(il,i),water(il,i),wdtrain(il) ', &
 !!                 i,b6,c6,revap,evap(il,i),water(il,i),wdtrain(il)
 !!---end jyg---
@@ -4139,7 +4139,7 @@
           b6 = bfac*50.*sigd(il)*(ph(il,i)-ph(il,i+1))*sigt*afac1
           c6 = prec(il, i+1) + 0.5*bfac*wdtrain(il)
-! print *,'bfac,sigd(il),sigt,afac1 ',bfac,sigd(il),sigt,afac1
-! print *,'prec(il,i+1),wdtrain(il) ',prec(il,i+1),wdtrain(il)
-! print *,'b6,c6,b6*b6+4.*c6 ',b6,c6,b6*b6+4.*c6
+! PRINT *,'bfac,sigd(il),sigt,afac1 ',bfac,sigd(il),sigt,afac1
+! PRINT *,'prec(il,i+1),wdtrain(il) ',prec(il,i+1),wdtrain(il)
+! PRINT *,'b6,c6,b6*b6+4.*c6 ',b6,c6,b6*b6+4.*c6
           IF (c6>b6*b6+1.E-20) THEN
             revap = 2.*c6/(b6+sqrt(b6*b6+4.*c6))
@@ -4163,5 +4163,5 @@
 !JYG---   Dans tous les cas, evaporation = [tt ce qui entre dans la couche i]
 ! moins [tt ce qui sort de la couche i]
-! print *, 'evap avec ice'
+! PRINT *, 'evap avec ice'
           evap(il, i) = (wdtrain(il)+sigd(il)*wt(il,i)*(prec(il,i+1)-prec(il,i))) / &
                         (sigd(il)*(ph(il,i)-ph(il,i+1))*100.)
@@ -4227,5 +4227,5 @@
             water(il, i) = 0.
           END IF
-! print *, 'evap sans ice'
+! PRINT *, 'evap sans ice'
           evap(il, i) = (wdtrain(il)+sigd(il)*wt(il,i)*(water(il,i+1)-water(il,i)))/ &
                         (sigd(il)*(ph(il,i)-ph(il,i+1))*100.)
@@ -5645,5 +5645,5 @@
 !-----------------------------------------------------------
 
-!!   print *,'yield, i, amp1, ad', i, amp1(1), ad(1)
+!!   PRINT *,'yield, i, amp1, ad', i, amp1(1), ad(1)
 
     DO il = 1, ncum
@@ -6798,5 +6798,5 @@
 
     IF (prt_level >= 5) THEN
-      print *,' CV3_YIELD : alpha_qpos ',alpha_qpos(1)
+      PRINT *,' CV3_YIELD : alpha_qpos ',alpha_qpos(1)
     ENDIF
 
@@ -7022,5 +7022,5 @@
           END IF
         END IF
-! c        print *,'cbmf',il,i,k,cbmf(il),wghti(il,k)
+! c        PRINT *,'cbmf',il,i,k,cbmf(il),wghti(il,k)
       END DO
     END DO
@@ -7035,5 +7035,5 @@
           dnwd(il, i) = dnwd(il, i) + dn1(il, k, i)
         END IF
-! c         print *,'upwd',il,i,k,inb(il),upwd(il,i),m(il,k),up1(il,k,i)
+! c         PRINT *,'upwd',il,i,k,inb(il),upwd(il,i),m(il,k),up1(il,k,i)
       END DO
     END DO
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3p_mixing.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3p_mixing.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3p_mixing.F90	(revision 5160)
@@ -278,5 +278,5 @@
           ELSE IF (j > i) THEN
             IF (prt_level >= 10) THEN
-              print *,'cv3p_mixing i, j, Sij given by the no-precip eq. ', i, j, Sij(il,i,j)
+              PRINT *,'cv3p_mixing i, j, Sij given by the no-precip eq. ', i, j, Sij(il,i,j)
             ENDIF
           END IF ! new ! IF ((i>=icb(il)) .AND. (i<=inb(il)) .AND. (j>=(icb(il)-1)) &
@@ -476,7 +476,7 @@
 !jygdebug<
     IF (prt_level >= 10) THEN
-      print *,'cv3p_mixing i, nent(i), icb, inb ',i, nent(igout,i), icb(igout), inb(igout)
+      PRINT *,'cv3p_mixing i, nent(i), icb, inb ',i, nent(igout,i), icb(igout), inb(igout)
       IF (nent(igout,i) > 0) THEN
-        print *,'i,(j,Sij(i,j),j=icb-1,inb) ',i,(j,Sij(igout,i,j),j=icb(igout)-1,inb(igout))
+        PRINT *,'i,(j,Sij(i,j),j=icb-1,inb) ',i,(j,Sij(igout,i,j),j=icb(igout)-1,inb(igout))
       ENDIF
     ENDIF
@@ -848,5 +848,5 @@
             END IF
 
-! print *,h(il,j)-hent(il,i,j),LV(il,j)*rs(il,j)/(cpd*rrv*t(il,j)*
+! PRINT *,h(il,j)-hent(il,i,j),LV(il,j)*rs(il,j)/(cpd*rrv*t(il,j)*
 ! :         t(il,j))
 
@@ -865,5 +865,5 @@
 !IM 301008 end
 
-! print *,'mix : i,j,hent(il,i,j),Sigij(il,i,j) ',
+! PRINT *,'mix : i,j,hent(il,i,j),Sigij(il,i,j) ',
 ! :               i,j,hent(il,i,j),Sigij(il,i,j)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_driver.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_driver.F90	(revision 5160)
@@ -491,5 +491,5 @@
   ! --- SET CONSTANTS AND PARAMETERS
   ! -------------------------------------------------------------------
-  ! print *, '-> cv_driver'      !jyg
+  ! PRINT *, '-> cv_driver'      !jyg
   ! -- set simulation flags:
   ! (common cvflag)
@@ -1227,5 +1227,5 @@
   END IF ! ncum>0
 
-  ! print *, 'fin cv_driver ->'      !jyg
+  ! PRINT *, 'fin cv_driver ->'      !jyg
 
 END SUBROUTINE cv_driver
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cva_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cva_driver.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cva_driver.F90	(revision 5160)
@@ -666,6 +666,6 @@
 
 
-! print *, 't1, t1_wake ',(k,t1(1,k),t1_wake(1,k),k=1,nd)
-! print *, 'q1, q1_wake ',(k,q1(1,k),q1_wake(1,k),k=1,nd)
+! PRINT *, 't1, t1_wake ',(k,t1(1,k),t1_wake(1,k),k=1,nd)
+! PRINT *, 'q1, q1_wake ',(k,q1(1,k),q1_wake(1,k),k=1,nd)
 
 ! -------------------------------------------------------------------
@@ -912,5 +912,5 @@
   END IF
 
-! print *, 'cv3_feed-> iflag1, plcl1 ',iflag1(1),plcl1(1)
+! PRINT *, 'cv3_feed-> iflag1, plcl1 ',iflag1(1),plcl1(1)
 
 ! --------------------------------------------------------------------
@@ -1013,5 +1013,5 @@
 ! -------------------------------------------------------------------
 
-! print *,' avant triggering, iflag_con ',iflag_con
+! PRINT *,' avant triggering, iflag_con ',iflag_con
 
   IF (iflag_con==3) THEN
@@ -1344,5 +1344,5 @@
     END IF
 
-! print *,'cv_closure-> cape ',cape(1)
+! PRINT *,'cv_closure-> cape ',cape(1)
 
 ! -------------------------------------------------------------------
@@ -1559,6 +1559,6 @@
 #endif   
 
-! print *,'cv_unsat-> mp ',mp
-! print *,'cv_unsat-> water ',water
+! PRINT *,'cv_unsat-> mp ',mp
+! PRINT *,'cv_unsat-> water ',water
 ! -------------------------------------------------------------------
 ! --- YIELD
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/ini_undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/ini_undefSTD.F90	(revision 5159)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/ini_undefSTD.F90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_chem.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_chem.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_chem.f90	(revision 5160)
@@ -0,0 +1,1 @@
+link ../phylmd/lmdz_chem.f90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_chem.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_chem.h	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_chem.h	(revision 5160)
@@ -0,0 +1,1 @@
+link ../phylmd/chem.h
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_concvl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_concvl.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_concvl.F90	(revision 5160)
@@ -500,5 +500,5 @@
 #endif 
 
-! print *, '-> cv_driver'      !jyg
+! PRINT *, '-> cv_driver'      !jyg
     CALL cv_driver(klon, klev, klevp1, ntra, iflag_con, &
                    t, q, qs, u, v, tra, &
@@ -524,5 +524,5 @@
 #endif
                     )
-!           print *, 'cv_driver ->'      !jyg
+!           PRINT *, 'cv_driver ->'      !jyg
 
 #ifdef ISO
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_ini_undefstd.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_ini_undefstd.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_ini_undefstd.f90	(revision 5160)
@@ -0,0 +1,1 @@
+link ../phylmd/lmdz_ini_undefstd.f90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_moy_undefstd.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_moy_undefstd.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_moy_undefstd.f90	(revision 5160)
@@ -0,0 +1,1 @@
+link ../phylmd/lmdz_moy_undefstd.f90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_plevel_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_plevel_new.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_plevel_new.f90	(revision 5160)
@@ -0,0 +1,1 @@
+link ../phylmd/lmdz_plevel_new.f90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_undefstd.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_undefstd.f90	(revision 5160)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_undefstd.f90	(revision 5160)
@@ -0,0 +1,1 @@
+link ../phylmd/lmdz_undefstd.f90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_wake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_wake.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_wake.F90	(revision 5160)
@@ -1096,5 +1096,5 @@
 
     DO i = 1, klon
-      ! c       print *,' isubstep,wk_adv(i),cstar(i),wape(i) ',
+      ! c       PRINT *,' isubstep,wk_adv(i),cstar(i),wape(i) ',
       ! c     $           isubstep,wk_adv(i),cstar(i),wape(i)
       IF (wk_adv(i) .AND. cstar(i)>0.01) THEN
@@ -1176,11 +1176,11 @@
 
       IF (prt_level >= 10) THEN
-        print *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1) ', &
+        PRINT *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1) ', &
                        cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1)
-        print *,'wake, wdens(1), awdens(1), act(1), d_awdens(1) ', &
+        PRINT *,'wake, wdens(1), awdens(1), act(1), d_awdens(1) ', &
                        wdens(1), awdens(1), act(1), d_awdens(1)
-        print *,'wake, wgen, -(wdens-awdens)*tau_wk_inv, -2.*wdens*gfl*drdt_pos, d_wdens ', &
+        PRINT *,'wake, wgen, -(wdens-awdens)*tau_wk_inv, -2.*wdens*gfl*drdt_pos, d_wdens ', &
                        wgen(1), -(wdens(1)-awdens(1))*tau_wk_inv(1), -2.*wdens(1)*gfl(1)*drdt_pos, d_wdens(1)
-        print *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
+        PRINT *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
                        d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1)
       ENDIF
@@ -1319,5 +1319,5 @@
       END DO
     END DO
-!!    print *,'omg(igout,k) ', (k,omg(igout,k),k=1,klev)
+!!    PRINT *,'omg(igout,k) ', (k,omg(igout,k),k=1,klev)
     ! cc nrlmd
     ! c      DO i=1,klon
@@ -2327,18 +2327,18 @@
     DO i = 1, klon
       IF (ok_qx_qw(i)) THEN
-        !! print *,'wake, hw0(i), dthmin(i) ', hw0(i), dthmin(i)
-        !! print *,'wake, 2.*sum_dth(i)/(hw0(i)*dthmin(i)) ', &
+        !! PRINT *,'wake, hw0(i), dthmin(i) ', hw0(i), dthmin(i)
+        !! PRINT *,'wake, 2.*sum_dth(i)/(hw0(i)*dthmin(i)) ', &
         !!                2.*sum_dth(i)/(hw0(i)*dthmin(i))
-        !! print *,'wake, sum_half_dth(i), sum_dth(i) ', &
+        !! PRINT *,'wake, sum_half_dth(i), sum_dth(i) ', &
         !!                sum_half_dth(i), sum_dth(i)
         IF ((hw0(i) < 1.) .OR. (dthmin(i) >= -delta_t_min) ) THEN
           wape2(i) = -1.
-          !! print *,'wake, rej 1'
+          !! PRINT *,'wake, rej 1'
         ELSE IF (iflag_wk_check_trgl==1.AND.abs(2.*sum_dth(i)/(hw0(i)*dthmin(i)) - 1.) > 0.5) THEN
           wape2(i) = -1.
-          !! print *,'wake, rej 2'
+          !! PRINT *,'wake, rej 2'
         ELSE IF (abs(sum_half_dth(i)) < 0.5*abs(sum_dth(i)) ) THEN
           wape2(i) = -1.
-          !! print *,'wake, rej 3'
+          !! PRINT *,'wake, rej 3'
         END IF
       END IF
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/moy_undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/moy_undefSTD.F90	(revision 5159)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/moy_undefSTD.F90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5160)
@@ -93,4 +93,8 @@
     USE phys_output_var_mod, ONLY:      cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv
     USE phys_output_var_mod, ONLY: cloud_cover_sw, cloud_cover_sw_s2
+    USE lmdz_plevel_new, ONLY: plevel_new
+    USE lmdz_moy_undefstd, ONLY: moy_undefstd
+    USE lmdz_undefstd, ONLY: undefstd
+    USE lmdz_ini_undefstd, ONLY: ini_undefstd
 
     USE lmdz_geometry,      ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
@@ -106,5 +110,5 @@
     USE paramLMDZ_phy_mod
 
-        USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
+    USE lmdz_phytracr_spl, ONLY: phytracr_spl, phytracr_spl_out_init
     USE phys_output_write_spl_mod
     USE phytrac_mod, ONLY: phytrac_init, phytrac
@@ -428,4 +432,5 @@
 
     USE lmdz_yomcst
+    USE lmdz_phys_constants, ONLY: dobson_u
 
     IMPLICIT NONE
@@ -902,5 +907,4 @@
     REAL zmasse(klon, nbp_lev),exner(klon, nbp_lev)
     !     (column-density of mass of air in a cell, in kg m-2)
-    REAL, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
 
     !IM sorties
@@ -925,9 +929,6 @@
     EXTERNAL suphel    ! initialiser certaines constantes
     EXTERNAL transp    ! transport total de l'eau et de l'energie
-    !IM
+
     EXTERNAL haut2bas  !variables de haut en bas
-    EXTERNAL ini_undefSTD  !initialise a 0 une variable a 1 niveau de pression
-    EXTERNAL undefSTD !somme les valeurs definies d'1 var a 1 niveau de pression
-    !     EXTERNAL moy_undefSTD  !moyenne d'1 var a 1 niveau de pression
     ! EXTERNAL moyglo_aire
     ! moyenne globale d'1 var ponderee par l'aire de la maille (moyglo_pondaire)
@@ -1655,5 +1656,5 @@
     ENDIF
 
-    IF (prt_level>=1) print *,'CONVERGENCE PHYSIQUE THERM 1 '
+    IF (prt_level>=1) PRINT *,'CONVERGENCE PHYSIQUE THERM 1 '
 
     !======================================================================
@@ -1804,9 +1805,9 @@
        IF (nbapp_cv == 0) nbapp_cv=86400./phys_tstep
        IF (nbapp_wk == 0) nbapp_wk=86400./phys_tstep
-       print *,'physiq, nbapp_cv, nbapp_wk ',nbapp_cv,nbapp_wk
+       PRINT *,'physiq, nbapp_cv, nbapp_wk ',nbapp_cv,nbapp_wk
        IF (MOD(NINT(86400./phys_tstep),nbapp_cv)==0) THEN
           cvpas_0 = NINT( 86400./phys_tstep)/nbapp_cv
           cvpas = cvpas_0
-       print *,'physiq, cvpas ',cvpas
+       PRINT *,'physiq, cvpas ',cvpas
        ELSE 
           WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
@@ -1820,5 +1821,5 @@
        IF (MOD(NINT(86400./phys_tstep),nbapp_wk)==0) THEN
           wkpas = NINT( 86400./phys_tstep)/nbapp_wk
-!       print *,'physiq, wkpas ',wkpas
+!       PRINT *,'physiq, wkpas ',wkpas
        ELSE 
           WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
@@ -3214,7 +3215,7 @@
 !!jyg       IF (prt_level .ge. 2 .AND. mod(iflag_pbl_split,2) .EQ. 1) THEN
        IF (prt_level >= 2 .AND. mod(iflag_pbl_split,10) >= 1) THEN
-          print *,'debut du splitting de la PBL, wake_s = ', wake_s(:)
-          print *,'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:,1)
-          print *,'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:,1)
+          PRINT *,'debut du splitting de la PBL, wake_s = ', wake_s(:)
+          PRINT *,'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:,1)
+          PRINT *,'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:,1)
        ENDIF
        ! !!
@@ -3574,5 +3575,5 @@
 
 !!jyg    IF (MOD(itapcv,cvpas).EQ.0) THEN
-!!    print *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
+!!    PRINT *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
 !!                       itapcv, cvpas, itap-1, cvpas_0
     IF (MOD(itapcv,cvpas)==0 .OR. MOD(itap-1,cvpas_0)==0) THEN
@@ -3805,5 +3806,5 @@
        !>jyg
 
-!!      print *,'physiq. q_w(1,k), q_x(1,k) ', &
+!!      PRINT *,'physiq. q_w(1,k), q_x(1,k) ', &
 !!             (k, q_w(1,k), q_x(1,k),k=1,25)
 
@@ -4025,5 +4026,5 @@
                    abs(d_q_con(i,k)) > dqcon_multistep_max) THEN
                  cvpas = 1
-!!                 print *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
+!!                 PRINT *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
 !!                                   i,k,d_t_con(i,k),d_q_con(i,k)
                ENDIF
@@ -4177,5 +4178,5 @@
     ENDIF
     IF (mod(itap,1000) == 0) THEN
-      print *,' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
+      PRINT *,' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
     ENDIF
 
@@ -4451,7 +4452,7 @@
 
        IF (prt_level >= 10) THEN
-         print *,' physiq, after calwake, wake_s: ',wake_s(:)
-         print *,' physiq, after calwake, wake_deltat: ',wake_deltat(:,1)
-         print *,' physiq, after calwake, wake_deltaq: ',wake_deltaq(:,1)
+         PRINT *,' physiq, after calwake, wake_s: ',wake_s(:)
+         PRINT *,' physiq, after calwake, wake_deltat: ',wake_deltat(:,1)
+         PRINT *,' physiq, after calwake, wake_deltaq: ',wake_deltaq(:,1)
        ENDIF
 
@@ -4933,5 +4934,5 @@
     !-------------------------------------------------------------------------
     IF (prt_level >=10) THEN
-       print *,'itap, ->fisrtilp ',itap
+       PRINT *,'itap, ->fisrtilp ',itap
     ENDIF
 
@@ -5932,5 +5933,5 @@
 
           IF (prt_level >=10) THEN
-             print *,' ->radlwsw, number 1 '
+             PRINT *,' ->radlwsw, number 1 '
           ENDIF
 
@@ -6011,5 +6012,5 @@
 
                 IF (prt_level >=10) THEN
-                   print *,' ->radlwsw, number 2 '
+                   PRINT *,' ->radlwsw, number 2 '
                 ENDIF
 
@@ -6195,5 +6196,5 @@
 
     IF (prt_level >=10) THEN
-       print *,' CALL orography ? ', ok_orodr
+       PRINT *,' CALL orography ? ', ok_orodr
     ENDIF
 
@@ -6447,7 +6448,7 @@
        flh2o=1
        IF(flag_verbose_strataer) THEN
-          print *,'IN physiq_mod: ok_qemiss =yes (',ok_qemiss,'), flh2o=',flh2o
-          print *,'IN physiq_mod: flag_emit=',flag_emit,', nErupt=',nErupt
-          print *,'IN physiq_mod: nAerErupt=',nAerErupt
+          PRINT *,'IN physiq_mod: ok_qemiss =yes (',ok_qemiss,'), flh2o=',flh2o
+          PRINT *,'IN physiq_mod: flag_emit=',flag_emit,', nErupt=',nErupt
+          PRINT *,'IN physiq_mod: nAerErupt=',nAerErupt
        ENDIF
        
@@ -6460,5 +6461,5 @@
                   day_cur<(day_emit_vol(ieru)+injdur)) THEN
                 
-                IF(flag_verbose_strataer) print *,'IN physiq_mod: date=',year_cur,mth_cur,day_cur
+                IF(flag_verbose_strataer) PRINT *,'IN physiq_mod: date=',year_cur,mth_cur,day_cur
                 ! initialisation of q tendency emission
                 d_q_emiss(:,:)=0.
@@ -6475,5 +6476,5 @@
                     nAerErupt+1,0)
                 
-                IF(flag_verbose_strataer) print *,'IN physiq_mod: min max d_q_emiss=',&
+                IF(flag_verbose_strataer) PRINT *,'IN physiq_mod: min max d_q_emiss=',&
                      minval(d_q_emiss),maxval(d_q_emiss)
                 
@@ -7057,5 +7058,5 @@
 
     IF (prt_level >=10) THEN
-       print *,'Convertir les incrementations en tendances '
+       PRINT *,'Convertir les incrementations en tendances '
     ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/plevel_new.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/plevel_new.F90	(revision 5159)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/plevel_new.F90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/reevap.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/reevap.F90	(revision 5159)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/reevap.F90	(revision 5160)
@@ -41,5 +41,5 @@
     ivapcur= iqWIsoPha(ixt,ivap)
     isolcur= iqWIsoPha(ixt,isol)
-!print *,'rrevap ; fl_cor_ebil:',fl_cor_ebil,' iflag_ice_thermo:',iflag_ice_thermo,' RVTMP2',RVTMP2
+!PRINT *,'rrevap ; fl_cor_ebil:',fl_cor_ebil,' iflag_ice_thermo:',iflag_ice_thermo,' RVTMP2',RVTMP2
     DO k = 1, klev  ! re-evaporation de l'eau liquide nuageuse
        DO i = 1, klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/undefSTD.F90	(revision 5159)
+++ 	(revision )
@@ -1,1 +1,0 @@
-link ../phylmd/undefSTD.F90
