Index: namico_lmdz/simple_physics/phyparam/param/lw.F
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/param/lw.F	(revision 4198)
+++ 	(revision )
@@ -1,218 +1,0 @@
-      SUBROUTINE lw(ngrid,nlayer,coefir,emissiv,
-     $             pp,ps_rad,ptsurf,pt,
-     $             pfluxir,pdtlw,
-     $             lwrite)
-      USE phys_const
-      IMPLICIT NONE
-c=======================================================================
-c
-c   calcul de l'evolution de la temperature sous l'effet du rayonnement
-c   infra-rouge.
-c   Pour simplifier, les transmissions sont precalculees et ne
-c   dependent que de l'altitude.
-c
-c   arguments:
-c   ----------
-c
-c   entree:
-c   -------
-c      ngrid             nombres de points de la grille horizontale
-c      nlayer              nombre de couches
-c      ptsurf(ngrid)     temperature de la surface
-c      pt(ngrid,nlayer)    temperature des couches
-c      pp(ngrid,nlayer+1)  pression entre les couches
-c      lwrite            variable logique pour sorties
-c
-c   sortie:
-c   -------
-c      pdtlw(ngrid,nlayer) taux de refroidissement
-c      pfluxir(ngrid)    flux infrarouge sur le sol
-c
-c=======================================================================
-
-c   declarations:
-c   -------------
-
-c   arguments:
-c   ----------
-
-      INTEGER ngrid,nlayer
-      REAL coefir,emissiv(ngrid),ps_rad
-      REAL ptsurf(ngrid),pt(ngrid,nlayer),pp(ngrid,nlayer+1)
-      REAL pdtlw(ngrid,nlayer),pfluxir(ngrid)
-      LOGICAL lwrite
-
-c   variables locales:
-c   ------------------
-
-      INTEGER nlevel,ilev,ig,i,il
-      REAL zplanck(ngrid,nlayer+1),zcoef
-      REAL zfluxup(ngrid,nlayer+1),zfluxdn(ngrid,nlayer+1)
-      REAL zflux(ngrid,nlayer+1)
-      REAL zlwtr1(ngrid),zlwtr2(ngrid)
-      REAL zup(ngrid,nlayer+1),zdup(ngrid)
-      REAL stephan
-
-      LOGICAL lstrong
-      SAVE lstrong,stephan
-      DATA lstrong/.true./
-!$OMP THREADPRIVATE(lstrong,stephan)
-
-c-----------------------------------------------------------------------
-c   initialisations:
-c   ----------------
-
-      nlevel=nlayer+1
-      stephan=5.67e-08
-
-c-----------------------------------------------------------------------
-c   2. calcul des quantites d'absorbants:
-c   -------------------------------------
-
-c   absorption forte
-      IF(lstrong) THEN
-         DO ilev=1,nlevel
-            DO ig=1,ngrid
-               zup(ig,ilev)=pp(ig,ilev)*pp(ig,ilev)/(2.*g)
-            ENDDO
-         ENDDO
-         IF(lwrite) THEN
-            DO ilev=1,nlayer
-             PRINT*,' up(',ilev,')  =  ',zup(ngrid/2+1,ilev)
-            ENDDO
-         ENDIF
-         zcoef=-log(coefir)/sqrt(ps_rad*ps_rad/(2.*g))
-
-c   absorption faible
-      ELSE
-         DO ilev=1,nlevel
-            DO ig=1,ngrid
-               zup(ig,ilev)=pp(ig,ilev)
-            ENDDO
-         ENDDO
-         zcoef=-log(coefir)/ps_rad
-      ENDIF
-
-
-c-----------------------------------------------------------------------
-c   2. calcul de la fonction de corps noir:
-c   ---------------------------------------
-
-      DO ilev=1,nlayer
-         DO ig=1,ngrid
-            zplanck(ig,ilev)=pt(ig,ilev)*pt(ig,ilev)
-            zplanck(ig,ilev)=stephan*
-     $      zplanck(ig,ilev)*zplanck(ig,ilev)
-		 ENDDO
-      ENDDO
-
-c-----------------------------------------------------------------------
-c   4. flux descendants:
-c   --------------------
-
-      DO ilev=1,nlayer
-         DO ig=1,ngrid
-            zfluxdn(ig,ilev)=0.
-		 ENDDO
-         DO ig=1,ngrid
-            zdup(ig)=zup(ig,ilev)-zup(ig,nlevel)
-         ENDDO
-         CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
-
-         DO il=nlayer,ilev,-1
-            zlwtr2(:)=zlwtr1(:)
-            DO ig=1,ngrid
-               zdup(ig)=zup(ig,ilev)-zup(ig,il)
-            ENDDO
-            CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
-            DO ig=1,ngrid
-               zfluxdn(ig,ilev)=zfluxdn(ig,ilev)+
-     $         zplanck(ig,il)*(zlwtr1(ig)-zlwtr2(ig))
-			ENDDO
-		 ENDDO
-      ENDDO
-
-      DO ig=1,ngrid
-         zfluxdn(ig,nlevel)=0.
-         pfluxir(ig)=emissiv(ig)*zfluxdn(ig,1)
-      ENDDO
-
-      DO ig=1,ngrid
-         zfluxup(ig,1)=ptsurf(ig)*ptsurf(ig)
-         zfluxup(ig,1)=emissiv(ig)*stephan*zfluxup(ig,1)*zfluxup(ig,1)
-     $   +(1.-emissiv(ig))*zfluxdn(ig,1)
-      ENDDO
-
-c-----------------------------------------------------------------------
-c   3. flux montants:
-c   ------------------
-
-      DO ilev=1,nlayer
-         DO ig=1,ngrid
-            zdup(ig)=zup(ig,1)-zup(ig,ilev+1)
-         ENDDO
-         CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
-         DO ig=1,ngrid
-            zfluxup(ig,ilev+1)=zfluxup(ig,1)*zlwtr1(ig)
-		 ENDDO
-         DO il=1,ilev
-            zlwtr2(:)=zlwtr1(:)
-            DO ig=1,ngrid
-               zdup(ig)=zup(ig,il+1)-zup(ig,ilev+1)
-            ENDDO
-            CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
-            DO ig=1,ngrid
-               zfluxup(ig,ilev+1)=zfluxup(ig,ilev+1)+
-     $         zplanck(ig,il)*(zlwtr1(ig)-zlwtr2(ig))
-			ENDDO
-         ENDDO
-
-      ENDDO
-
-c-----------------------------------------------------------------------
-c   5. calcul des flux nets:
-c   ------------------------
-
-      DO ilev=1,nlevel
-         DO ig=1,ngrid
-            zflux(ig,ilev)=zfluxup(ig,ilev)-zfluxdn(ig,ilev)
-		 ENDDO
-      ENDDO
-
-c-----------------------------------------------------------------------
-c   6. Calcul des taux de refroidissement:
-c   --------------------------------------
-   
-      DO ilev=1,nlayer
-         DO ig=1,ngrid
-            pdtlw(ig,ilev)=(zflux(ig,ilev+1)-zflux(ig,ilev))*
-     $           g/(cpp*(pp(ig,ilev+1)-pp(ig,ilev)))
-		 ENDDO
-      ENDDO
-
-c-----------------------------------------------------------------------
-c   10. sorties eventuelles:
-c   ------------------------
-
-      IF (lwrite) THEN
-
-         PRINT*
-         PRINT*,'Diagnostique rayonnement thermique'
-         PRINT*
-         PRINT*,'temperature     ',
-     $   'flux montant    flux desc.     taux de refroid.'
-         i=ngrid/2+1
-         WRITE(6,9000) ptsurf(i)
-         DO ilev=1,nlayer
-            WRITE(6,'(i4,4e18.4)') ilev,pt(i,ilev),
-     $      zfluxup(i,ilev),zfluxdn(i,ilev),pdtlw(i,ilev)
-		 ENDDO
-         WRITE(6,9000) zfluxup(i,nlevel),zfluxdn(i,nlevel)
-
-      ENDIF
-
-c-----------------------------------------------------------------------
-
-      RETURN
-9000  FORMAT(4e18.4)
-      END
Index: namico_lmdz/simple_physics/phyparam/param/lwtr.F
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/param/lwtr.F	(revision 4198)
+++ 	(revision )
@@ -1,18 +1,0 @@
-      SUBROUTINE lwtr(ngrid,coef,lstrong,dup,transm)
-      IMPLICIT NONE
-      INTEGER ngrid
-      REAL coef
-      LOGICAL lstrong
-      REAL dup(ngrid),transm(ngrid)
-      INTEGER ig
-      IF(lstrong) THEN
-         DO ig=1,ngrid
-            transm(ig)=exp(-coef*sqrt(dup(ig)))
-         ENDDO
-      ELSE
-         DO ig=1,ngrid
-            transm(ig)=exp(-coef*dup(ig))
-         ENDDO
-      ENDIF
-      RETURN
-      END
Index: /dynamico_lmdz/simple_physics/phyparam/param/phyparam.F
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/param/phyparam.F	(revision 4198)
+++ /dynamico_lmdz/simple_physics/phyparam/param/phyparam.F	(revision 4199)
@@ -15,4 +15,6 @@
       USE vdif_mod, ONLY : vdif
       USE radiative, ONLY : mucorr, sw
+      USE radiative_lw, ONLY : lw
+
 c     
       IMPLICIT NONE
Index: /dynamico_lmdz/simple_physics/phyparam/physics/astronomy.F90
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/physics/astronomy.F90	(revision 4198)
+++ /dynamico_lmdz/simple_physics/phyparam/physics/astronomy.F90	(revision 4199)
@@ -85,5 +85,5 @@
        WRITELOG(*,*) 'distance au soleil (en unite astronomique) :',pdist_sol
        WRITELOG(*,*) 'declinaison (en degres) :',pdecli*180./pi
-       CALL flush_log
+       LOG_INFO('solarlong')
     ENDIF
     
@@ -168,5 +168,5 @@
     WRITELOG(*,*) 'longitude solaire du perihelie timeperi = ',timeperi
     
-    CALL flush_log
+    LOG_INFO('iniorbit')
     
   END SUBROUTINE iniorbit
Index: /dynamico_lmdz/simple_physics/phyparam/physics/logging.F90
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/physics/logging.F90	(revision 4198)
+++ /dynamico_lmdz/simple_physics/phyparam/physics/logging.F90	(revision 4199)
@@ -11,6 +11,7 @@
 
   INTERFACE 
-     SUBROUTINE plugin(buf)
-       CHARACTER(*), INTENT(IN) :: buf(:)
+     SUBROUTINE plugin(lev, tag, buf)
+       INTEGER, INTENT(IN) :: lev
+       CHARACTER(*), INTENT(IN) :: tag, buf(:)
      END SUBROUTINE plugin
   END INTERFACE
@@ -23,18 +24,23 @@
   INTEGER :: logging_lineno=0
 
+  INTEGER, PARAMETER, PUBLIC :: log_level_dbg=0, log_level_info=1
+
   PUBLIC :: logging_buf, logging_lineno, flush_log, flush_plugin
 
 CONTAINS
 
-  SUBROUTINE flush_log
-    CALL flush_plugin(logging_buf(1:logging_lineno))
+  SUBROUTINE flush_log(lev,tag)
+    INTEGER, INTENT(IN) :: lev
+    CHARACTER(*), INTENT(IN) :: tag
+    CALL flush_plugin(lev, TRIM(tag), logging_buf(1:logging_lineno))
     logging_lineno=0
   END SUBROUTINE flush_log
 
-  SUBROUTINE default_flush_plugin(buf)
-    CHARACTER(*), INTENT(IN) :: buf(:)
+  SUBROUTINE default_flush_plugin(lev, tag, buf)
+    INTEGER, INTENT(IN) :: lev
+    CHARACTER(*), INTENT(IN) :: tag, buf(:)
     INTEGER :: i
     DO i=1, SIZE(buf)
-       PRINT *, 'INFO : ', TRIM(buf(i))
+       PRINT *, '[INFO ',tag,']', TRIM(buf(i))
     END DO
   END SUBROUTINE default_flush_plugin
Index: /dynamico_lmdz/simple_physics/phyparam/physics/radiative.F90
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/physics/radiative.F90	(revision 4198)
+++ /dynamico_lmdz/simple_physics/phyparam/physics/radiative.F90	(revision 4199)
@@ -5,5 +5,5 @@
   PRIVATE
 
-  PUBLIC :: mucorr, sw
+  PUBLIC :: mucorr, sw, lwtr
 
 CONTAINS
@@ -343,3 +343,22 @@
     END SUBROUTINE sw
 
+    PURE SUBROUTINE lwtr(ngrid,coef,lstrong,dup,transm)
+      INTEGER, INTENT(IN) :: ngrid
+      REAL,    INTENT(IN) :: coef
+      LOGICAL, INTENT(IN) :: lstrong
+      REAL,    INTENT(IN) :: dup(ngrid)
+      REAL,    INTENT(OUT) :: transm(ngrid)
+      INTEGER ig
+      IF(lstrong) THEN
+         DO ig=1,ngrid
+            transm(ig)=exp(-coef*sqrt(dup(ig)))
+         ENDDO
+      ELSE
+         DO ig=1,ngrid
+            transm(ig)=exp(-coef*dup(ig))
+         ENDDO
+      ENDIF
+      
+    END SUBROUTINE lwtr
+
 END MODULE radiative
Index: /dynamico_lmdz/simple_physics/phyparam/physics/radiative_lw.F90
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/physics/radiative_lw.F90	(revision 4199)
+++ /dynamico_lmdz/simple_physics/phyparam/physics/radiative_lw.F90	(revision 4199)
@@ -0,0 +1,244 @@
+MODULE radiative_lw
+
+#include "use_logging.h"
+
+  IMPLICIT NONE
+  SAVE
+  
+  PRIVATE
+  
+  PUBLIC :: lw
+  
+  LOGICAL, PARAMETER :: lstrong=.TRUE.
+  REAL, PARAMETER :: stephan=5.67e-08
+  
+CONTAINS
+  
+  SUBROUTINE lw(ngrid,nlayer,coefir,emissiv, &
+       pp,ps_rad,ptsurf,pt,              &
+       pfluxir,pdtlw,                    &
+       lwrite)
+    USE phys_const, ONLY : cpp, g
+    !=======================================================================
+    !
+    !   calcul de l'evolution de la temperature sous l'effet du rayonnement
+    !   infra-rouge.
+    !   Pour simplifier, les transmissions sont precalculees et ne
+    !   dependent que de l'altitude.
+    !
+    !   arguments:
+    !   ----------
+    !
+    !   entree:
+    !   -------
+    !      ngrid             nombres de points de la grille horizontale
+    !      nlayer              nombre de couches
+    !      ptsurf(ngrid)     temperature de la surface
+    !      pt(ngrid,nlayer)    temperature des couches
+    !      pp(ngrid,nlayer+1)  pression entre les couches
+    !      lwrite            variable logique pour sorties
+    !
+    !   sortie:
+    !   -------
+    !      pdtlw(ngrid,nlayer) taux de refroidissement
+    !      pfluxir(ngrid)    flux infrarouge sur le sol
+    !
+    !=======================================================================
+    
+    !   declarations:
+    !   -------------
+    
+    !   arguments:
+    !   ----------
+    
+    INTEGER, INTENT(IN)  ::  ngrid,nlayer
+    REAL,    INTENT(IN)  :: coefir,emissiv(ngrid),ps_rad
+    REAL,    INTENT(IN)  ::  ptsurf(ngrid),pt(ngrid,nlayer),pp(ngrid,nlayer+1)
+    REAL,    INTENT(OUT) ::  pdtlw(ngrid,nlayer),pfluxir(ngrid)
+    LOGICAL, INTENT(IN)  :: lwrite
+    
+    !   variables locales:
+    !   ------------------
+    
+    INTEGER nlevel,ilev,ig,i,il
+    REAL zplanck(ngrid,nlayer+1),zcoef
+    REAL zfluxup(ngrid,nlayer+1),zfluxdn(ngrid,nlayer+1)
+    REAL zflux(ngrid,nlayer+1)
+    REAL zlwtr1(ngrid),zlwtr2(ngrid)
+    REAL zup(ngrid,nlayer+1),zdup(ngrid)
+
+    CHARACTER(:), PARAMETER :: tag='rad/lw'
+    !-----------------------------------------------------------------------
+    !   initialisations:
+    !   ----------------
+    
+    nlevel=nlayer+1
+    
+    !-----------------------------------------------------------------------
+    !   2. calcul des quantites d'absorbants:
+    !   -------------------------------------
+    
+    !   absorption forte
+    IF(lstrong) THEN
+       DO ilev=1,nlevel
+          DO ig=1,ngrid
+             zup(ig,ilev)=pp(ig,ilev)*pp(ig,ilev)/(2.*g)
+          ENDDO
+       ENDDO
+       IF(lwrite) THEN
+          DO ilev=1,nlayer
+             WRITELOG(*,*) ' up(',ilev,')  =  ',zup(ngrid/2+1,ilev)
+          ENDDO
+          LOG_DBG(tag)
+       ENDIF
+       zcoef=-log(coefir)/sqrt(ps_rad*ps_rad/(2.*g))
+       
+       !   absorption faible
+    ELSE
+       DO ilev=1,nlevel
+          DO ig=1,ngrid
+             zup(ig,ilev)=pp(ig,ilev)
+          ENDDO
+       ENDDO
+       zcoef=-log(coefir)/ps_rad
+    ENDIF
+    
+    
+    !-----------------------------------------------------------------------
+    !   2. calcul de la fonction de corps noir:
+    !   ---------------------------------------
+    
+    DO ilev=1,nlayer
+       DO ig=1,ngrid
+          zplanck(ig,ilev)=pt(ig,ilev)*pt(ig,ilev)
+          zplanck(ig,ilev)=stephan* &
+               zplanck(ig,ilev)*zplanck(ig,ilev)
+       ENDDO
+    ENDDO
+    
+    !-----------------------------------------------------------------------
+    !   4. flux descendants:
+    !   --------------------
+    
+    DO ilev=1,nlayer
+       DO ig=1,ngrid
+          zfluxdn(ig,ilev)=0.
+       ENDDO
+       DO ig=1,ngrid
+          zdup(ig)=zup(ig,ilev)-zup(ig,nlevel)
+       ENDDO
+       CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
+       
+       DO il=nlayer,ilev,-1
+          zlwtr2(:)=zlwtr1(:)
+          DO ig=1,ngrid
+             zdup(ig)=zup(ig,ilev)-zup(ig,il)
+          ENDDO
+          CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
+          DO ig=1,ngrid
+             zfluxdn(ig,ilev)=zfluxdn(ig,ilev)+ &
+                  zplanck(ig,il)*(zlwtr1(ig)-zlwtr2(ig))
+          ENDDO
+       ENDDO
+    ENDDO
+    
+    DO ig=1,ngrid
+       zfluxdn(ig,nlevel)=0.
+       pfluxir(ig)=emissiv(ig)*zfluxdn(ig,1)
+    ENDDO
+    
+    DO ig=1,ngrid
+       zfluxup(ig,1)=ptsurf(ig)*ptsurf(ig)
+       zfluxup(ig,1)=emissiv(ig)*stephan*zfluxup(ig,1)*zfluxup(ig,1) &
+            +(1.-emissiv(ig))*zfluxdn(ig,1)
+    ENDDO
+    
+    !-----------------------------------------------------------------------
+    !   3. flux montants:
+    !   ------------------
+    
+    DO ilev=1,nlayer
+       DO ig=1,ngrid
+          zdup(ig)=zup(ig,1)-zup(ig,ilev+1)
+       ENDDO
+       CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
+       DO ig=1,ngrid
+          zfluxup(ig,ilev+1)=zfluxup(ig,1)*zlwtr1(ig)
+       ENDDO
+       DO il=1,ilev
+          zlwtr2(:)=zlwtr1(:)
+          DO ig=1,ngrid
+             zdup(ig)=zup(ig,il+1)-zup(ig,ilev+1)
+          ENDDO
+          CALL lwtr(ngrid,zcoef,lstrong,zdup,zlwtr1)
+          DO ig=1,ngrid
+             zfluxup(ig,ilev+1)=zfluxup(ig,ilev+1)+ &
+                  zplanck(ig,il)*(zlwtr1(ig)-zlwtr2(ig))
+          ENDDO
+       ENDDO
+       
+    ENDDO
+
+    !-----------------------------------------------------------------------
+    !   5. calcul des flux nets:
+    !   ------------------------
+    
+    DO ilev=1,nlevel
+       DO ig=1,ngrid
+          zflux(ig,ilev)=zfluxup(ig,ilev)-zfluxdn(ig,ilev)
+       ENDDO
+    ENDDO
+    
+    !-----------------------------------------------------------------------
+    !   6. Calcul des taux de refroidissement:
+    !   --------------------------------------
+    
+    DO ilev=1,nlayer
+       DO ig=1,ngrid
+          pdtlw(ig,ilev)=(zflux(ig,ilev+1)-zflux(ig,ilev))* &
+               g/(cpp*(pp(ig,ilev+1)-pp(ig,ilev)))
+       ENDDO
+    ENDDO
+    
+    !-----------------------------------------------------------------------
+    !   10. sorties eventuelles:
+    !   ------------------------
+    
+    IF (lwrite) THEN       
+       WRITELOG(*,*) 'Diagnostique rayonnement thermique'
+       WRITELOG(*,*) 'temperature     ', &
+          'flux montant    flux desc.     taux de refroid.'
+       i=ngrid/2+1
+       WRITELOG(6,'(4e18.4)') ptsurf(i)
+       DO ilev=1,nlayer
+          WRITELOG(6,'(i4,4e18.4)') ilev,pt(i,ilev), &
+               zfluxup(i,ilev),zfluxdn(i,ilev),pdtlw(i,ilev)
+       ENDDO
+       WRITELOG(6,'(4e18.4)') zfluxup(i,nlevel),zfluxdn(i,nlevel)       
+       LOG_DBG(tag)
+    ENDIF
+
+!-----------------------------------------------------------------------
+    
+  END SUBROUTINE lw
+
+  PURE SUBROUTINE lwtr(ngrid,coef,lstrong,dup,transm)
+    INTEGER, INTENT(IN) :: ngrid
+    REAL,    INTENT(IN) :: coef
+    LOGICAL, INTENT(IN) :: lstrong
+    REAL,    INTENT(IN) :: dup(ngrid)
+    REAL,    INTENT(OUT) :: transm(ngrid)
+    INTEGER ig
+    IF(lstrong) THEN
+       DO ig=1,ngrid
+          transm(ig)=exp(-coef*sqrt(dup(ig)))
+       ENDDO
+    ELSE
+       DO ig=1,ngrid
+          transm(ig)=exp(-coef*dup(ig))
+       ENDDO
+    ENDIF
+    
+  END SUBROUTINE lwtr
+  
+END MODULE radiative_lw
Index: /dynamico_lmdz/simple_physics/phyparam/physics/use_logging.h
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/physics/use_logging.h	(revision 4198)
+++ /dynamico_lmdz/simple_physics/phyparam/physics/use_logging.h	(revision 4199)
@@ -1,2 +1,4 @@
    USE logging
 #define WRITELOG(junk, fmt) logging_lineno = logging_lineno+1 ; WRITE(logging_buf(logging_lineno), fmt)
+#define LOG_INFO(tag) CALL flush_log(log_level_info, tag)
+#define LOG_DBG(tag) CALL flush_log(log_level_dbg, tag)
Index: /dynamico_lmdz/simple_physics/phyparam/physics/vdif_mod.F90
===================================================================
--- /dynamico_lmdz/simple_physics/phyparam/physics/vdif_mod.F90	(revision 4198)
+++ /dynamico_lmdz/simple_physics/phyparam/physics/vdif_mod.F90	(revision 4199)
@@ -262,5 +262,5 @@
                zb0(ig,ilev)
        ENDDO
-       CALL flush_log
+       LOG_DBG('vdif')
     ENDIF
     
@@ -300,5 +300,5 @@
           PRINT*,zkv(ngrid/2+1,ilev),zkh(ngrid/2+1,ilev)
        ENDDO
-       CALL flush_log
+       LOG_DBG('vdif')
     ENDIF
     
