Index: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/lib_mpp.F90
===================================================================
--- NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/lib_mpp.F90	(revision 10292)
+++ NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/lib_mpp.F90	(revision 10297)
@@ -158,10 +158,14 @@
 
    ! Communications summary report
-   CHARACTER(len=128), DIMENSION(:), ALLOCATABLE ::   crname                       !: names of calling routines
+   CHARACTER(len=128), DIMENSION(:), ALLOCATABLE ::   crname_lbc                   !: names of lbc_lnk calling routines
+   CHARACTER(len=128), DIMENSION(:), ALLOCATABLE ::   crname_glb                   !: names of global comm  calling routines
    INTEGER, PUBLIC                               ::   ncom_stp = 0                 !: copy of time step # istp
+   INTEGER, PUBLIC                               ::   ncom_fsbc = 1                !: copy of sbc time step # nn_fsbc
+   INTEGER, PUBLIC                               ::   ncom_dttrc = 1               !: copy of top time step # nn_dttrc
    INTEGER, PUBLIC , DIMENSION(:,:), ALLOCATABLE ::   ncomm_sequence               !: size of communicated arrays (halos)
-   INTEGER, PUBLIC                               ::   n_sequence = 0               !: # of communicated arrays
-   LOGICAL                                       ::   l_comm_report_done = .false. !: print report only once
-   
+   INTEGER, PUBLIC                               ::   n_sequence_lbc = 0           !: # of communicated arraysvia lbc
+   INTEGER, PUBLIC                               ::   n_sequence_glb = 0           !: # of global communications
+   INTEGER, PUBLIC                               ::   numcom = -1                  !: logical unit for communicaton report
+
    ! timing summary report
    REAL(wp), PUBLIC ::  waiting_time = 0._wp, compute_time = 0._wp, elapsed_time = 0._wp
@@ -577,61 +581,4 @@
    END SUBROUTINE mppscatter
 
-   !!----------------------------------------------------------------------
-   !!    ***  mppmax_a_int, mppmax_int, mppmax_a_real, mppmax_real  ***
-   !!   
-   !!----------------------------------------------------------------------
-   !!
-   SUBROUTINE mppmax_a_int( ktab, kdim, kcom )
-      !!----------------------------------------------------------------------
-      INTEGER , INTENT(in   )                  ::   kdim   ! size of array
-      INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab   ! input array
-      INTEGER , INTENT(in   ), OPTIONAL        ::   kcom   !
-      INTEGER :: ierror, ilocalcomm   ! temporary integer
-      INTEGER, DIMENSION(kdim) ::   iwork
-      !!----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ktab, iwork, kdim, mpi_integer, mpi_max, ilocalcomm, ierror )
-      ktab(:) = iwork(:)
-   END SUBROUTINE mppmax_a_int
-   !!
-   SUBROUTINE mppmax_int( ktab, kcom )
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT(inout)           ::   ktab   ! ???
-      INTEGER, INTENT(in   ), OPTIONAL ::   kcom   ! ???
-      INTEGER ::   ierror, iwork, ilocalcomm   ! temporary integer
-      !!----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_max, ilocalcomm, ierror )
-      ktab = iwork
-   END SUBROUTINE mppmax_int
-   !!
-   SUBROUTINE mppmax_a_real( ptab, kdim, kcom )
-      !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(kdim), INTENT(inout) ::   ptab
-      INTEGER                  , INTENT(in   ) ::   kdim
-      INTEGER , OPTIONAL       , INTENT(in   ) ::   kcom
-      INTEGER :: ierror, ilocalcomm
-      REAL(wp), DIMENSION(kdim) ::  zwork
-      !!----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ptab, zwork, kdim, mpi_double_precision, mpi_max, ilocalcomm, ierror )
-      ptab(:) = zwork(:)
-   END SUBROUTINE mppmax_a_real
-   !!
-   SUBROUTINE mppmax_real( ptab, kcom )
-      !!----------------------------------------------------------------------
-      REAL(wp), INTENT(inout)           ::   ptab   ! ???
-      INTEGER , INTENT(in   ), OPTIONAL ::   kcom   ! ???
-      INTEGER  ::   ierror, ilocalcomm
-      REAL(wp) ::   zwork
-      !!----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom!
-      CALL mpi_allreduce( ptab, zwork, 1, mpi_double_precision, mpi_max, ilocalcomm, ierror )
-      ptab = zwork
-   END SUBROUTINE mppmax_real
    !!
    SUBROUTINE mpp_ilor( ld_switch, ldlast, kcom )
@@ -656,6 +603,37 @@
 
    END SUBROUTINE mpp_ilor
-
-
+   
+   !!----------------------------------------------------------------------
+   !!    ***  mppmax_a_int, mppmax_int, mppmax_a_real, mppmax_real  ***
+   !!   
+   !!----------------------------------------------------------------------
+   !!
+#  define OPERATION_MAX
+#  define INTEGER_TYPE
+#  define DIM_0d
+#     define ROUTINE_ALLREDUCE           mppmax_int
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_0d
+#  define DIM_1d
+#     define ROUTINE_ALLREDUCE           mppmax_a_int
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_1d
+#  undef INTEGER_TYPE
+!
+#  define REAL_TYPE
+#  define DIM_0d
+#     define ROUTINE_ALLREDUCE           mppmax_real
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_0d
+#  define DIM_1d
+#     define ROUTINE_ALLREDUCE           mppmax_a_real
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_1d
+#  undef REAL_TYPE
+#  undef OPERATION_MAX
    !!----------------------------------------------------------------------
    !!    ***  mppmin_a_int, mppmin_int, mppmin_a_real, mppmin_real  ***
@@ -663,59 +641,31 @@
    !!----------------------------------------------------------------------
    !!
-   SUBROUTINE mppmin_a_int( ktab, kdim, kcom )
-      !!----------------------------------------------------------------------
-      INTEGER , INTENT( in  )                  ::   kdim   ! size of array
-      INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab   ! input array
-      INTEGER , INTENT( in  ), OPTIONAL        ::   kcom   ! input array
-      !!
-      INTEGER ::   ierror, ilocalcomm   ! temporary integer
-      INTEGER, DIMENSION(kdim) ::   iwork
-      !!----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ktab, iwork, kdim, mpi_integer, mpi_min, ilocalcomm, ierror )
-      ktab(:) = iwork(:)
-   END SUBROUTINE mppmin_a_int
-   !!
-   SUBROUTINE mppmin_int( ktab, kcom )
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT(inout) ::   ktab      ! ???
-      INTEGER , INTENT( in  ), OPTIONAL        ::   kcom        ! input array
-      !!
-      INTEGER ::  ierror, iwork, ilocalcomm
-      !!----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_min, ilocalcomm, ierror )
-      ktab = iwork
-   END SUBROUTINE mppmin_int
-   !!
-   SUBROUTINE mppmin_a_real( ptab, kdim, kcom )
-      !!----------------------------------------------------------------------
-      INTEGER , INTENT(in   )                  ::   kdim
-      REAL(wp), INTENT(inout), DIMENSION(kdim) ::   ptab
-      INTEGER , INTENT(in   ), OPTIONAL        ::   kcom
-      INTEGER :: ierror, ilocalcomm
-      REAL(wp), DIMENSION(kdim) ::   zwork
-      !!-----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ptab, zwork, kdim, mpi_double_precision, mpi_min, ilocalcomm, ierror )
-      ptab(:) = zwork(:)
-   END SUBROUTINE mppmin_a_real
-   !!
-   SUBROUTINE mppmin_real( ptab, kcom )
-      !!-----------------------------------------------------------------------
-      REAL(wp), INTENT(inout)           ::   ptab        !
-      INTEGER , INTENT(in   ), OPTIONAL :: kcom
-      INTEGER  ::   ierror, ilocalcomm
-      REAL(wp) ::   zwork
-      !!-----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ptab, zwork, 1, mpi_double_precision, mpi_min, ilocalcomm, ierror )
-      ptab = zwork
-   END SUBROUTINE mppmin_real
-
+#  define OPERATION_MIN
+#  define INTEGER_TYPE
+#  define DIM_0d
+#     define ROUTINE_ALLREDUCE           mppmin_int
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_0d
+#  define DIM_1d
+#     define ROUTINE_ALLREDUCE           mppmin_a_int
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_1d
+#  undef INTEGER_TYPE
+!
+#  define REAL_TYPE
+#  define DIM_0d
+#     define ROUTINE_ALLREDUCE           mppmin_real
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_0d
+#  define DIM_1d
+#     define ROUTINE_ALLREDUCE           mppmin_a_real
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_1d
+#  undef REAL_TYPE
+#  undef OPERATION_MIN
 
    !!----------------------------------------------------------------------
@@ -725,78 +675,46 @@
    !!----------------------------------------------------------------------
    !!
-   SUBROUTINE mppsum_a_int( ktab, kdim )
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT(in   )                   ::   kdim   ! ???
-      INTEGER, INTENT(inout), DIMENSION (kdim) ::   ktab   ! ???
-      INTEGER :: ierror
-      INTEGER, DIMENSION (kdim) ::  iwork
-      !!----------------------------------------------------------------------
-      CALL mpi_allreduce( ktab, iwork, kdim, mpi_integer, mpi_sum, mpi_comm_oce, ierror )
-      ktab(:) = iwork(:)
-   END SUBROUTINE mppsum_a_int
-   !!
-   SUBROUTINE mppsum_int( ktab )
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT(inout) ::   ktab
-      INTEGER :: ierror, iwork
-      !!----------------------------------------------------------------------
-      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_sum, mpi_comm_oce, ierror )
-      ktab = iwork
-   END SUBROUTINE mppsum_int
-   !!
-   SUBROUTINE mppsum_a_real( ptab, kdim, kcom )
-      !!-----------------------------------------------------------------------
-      INTEGER                  , INTENT(in   ) ::   kdim   ! size of ptab
-      REAL(wp), DIMENSION(kdim), INTENT(inout) ::   ptab   ! input array
-      INTEGER , OPTIONAL       , INTENT(in   ) ::   kcom   ! specific communicator
-      INTEGER  ::   ierror, ilocalcomm    ! local integer
-      REAL(wp) ::   zwork(kdim)           ! local workspace
-      !!-----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ptab, zwork, kdim, mpi_double_precision, mpi_sum, ilocalcomm, ierror )
-      ptab(:) = zwork(:)
-   END SUBROUTINE mppsum_a_real
-   !!
-   SUBROUTINE mppsum_real( ptab, kcom )
-      !!-----------------------------------------------------------------------
-      REAL(wp)          , INTENT(inout)           ::   ptab   ! input scalar
-      INTEGER , OPTIONAL, INTENT(in   ) ::   kcom
-      INTEGER  ::   ierror, ilocalcomm
-      REAL(wp) ::   zwork
-      !!-----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL mpi_allreduce( ptab, zwork, 1, mpi_double_precision, mpi_sum, ilocalcomm, ierror )
-      ptab = zwork
-   END SUBROUTINE mppsum_real
-   !!
-   SUBROUTINE mppsum_realdd( ytab, kcom )
-      !!-----------------------------------------------------------------------
-      COMPLEX(wp)          , INTENT(inout) ::   ytab    ! input scalar
-      INTEGER    , OPTIONAL, INTENT(in   ) ::   kcom
-      INTEGER     ::   ierror, ilocalcomm
-      COMPLEX(wp) ::   zwork
-      !!-----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL MPI_ALLREDUCE( ytab, zwork, 1, MPI_DOUBLE_COMPLEX, MPI_SUMDD, ilocalcomm, ierror )
-      ytab = zwork
-   END SUBROUTINE mppsum_realdd
-   !!
-   SUBROUTINE mppsum_a_realdd( ytab, kdim, kcom )
-      !!----------------------------------------------------------------------
-      INTEGER                     , INTENT(in   ) ::   kdim   ! size of ytab
-      COMPLEX(wp), DIMENSION(kdim), INTENT(inout) ::   ytab   ! input array
-      INTEGER    , OPTIONAL       , INTENT(in   ) ::   kcom
-      INTEGER:: ierror, ilocalcomm    ! local integer
-      COMPLEX(wp), DIMENSION(kdim) :: zwork     ! temporary workspace
-      !!-----------------------------------------------------------------------
-      ilocalcomm = mpi_comm_oce
-      IF( PRESENT(kcom) )   ilocalcomm = kcom
-      CALL MPI_ALLREDUCE( ytab, zwork, kdim, MPI_DOUBLE_COMPLEX, MPI_SUMDD, ilocalcomm, ierror )
-      ytab(:) = zwork(:)
-   END SUBROUTINE mppsum_a_realdd
-   
+#  define OPERATION_SUM
+#  define INTEGER_TYPE
+#  define DIM_0d
+#     define ROUTINE_ALLREDUCE           mppsum_int
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_0d
+#  define DIM_1d
+#     define ROUTINE_ALLREDUCE           mppsum_a_int
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_1d
+#  undef INTEGER_TYPE
+!
+#  define REAL_TYPE
+#  define DIM_0d
+#     define ROUTINE_ALLREDUCE           mppsum_real
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_0d
+#  define DIM_1d
+#     define ROUTINE_ALLREDUCE           mppsum_a_real
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_1d
+#  undef REAL_TYPE
+#  undef OPERATION_SUM
+
+#  define OPERATION_SUM_DD
+#  define COMPLEX_TYPE
+#  define DIM_0d
+#     define ROUTINE_ALLREDUCE           mppsum_realdd
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_0d
+#  define DIM_1d
+#     define ROUTINE_ALLREDUCE           mppsum_a_realdd
+#     include "mpp_allreduce_generic.h90"
+#     undef ROUTINE_ALLREDUCE
+#  undef DIM_1d
+#  undef COMPLEX_TYPE
+#  undef OPERATION_SUM_DD
 
    SUBROUTINE mppmax_real_multiple( pt1d, kdim, kcom  )
@@ -1117,5 +1035,5 @@
          l_znl_root = .FALSE.
          kwork (1) = nimpp
-         CALL mpp_min ( kwork(1), kcom = ncomm_znl)
+         CALL mpp_min ( 'lib_mpp', kwork(1), kcom = ncomm_znl)
          IF ( nimpp == kwork(1)) l_znl_root = .TRUE.
       END IF
Index: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mpp_lnk_generic.h90
===================================================================
--- NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mpp_lnk_generic.h90	(revision 10292)
+++ NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mpp_lnk_generic.h90	(revision 10297)
@@ -63,4 +63,5 @@
       INTEGER  ::   ml_req1, ml_req2, ml_err     ! for key_mpi_isend
       INTEGER  ::   ierr
+      INTEGER  ::   icom_freq
       REAL(wp) ::   zland
       INTEGER , DIMENSION(MPI_STATUS_SIZE)      ::   ml_stat        ! for key_mpi_isend
@@ -153,26 +154,32 @@
       !
       IF( narea == 1 ) THEN
-         IF ( ncom_stp == nit000 ) THEN
+
+         ! find the smallest common frequency: default = frequency product, if multiple, choose the larger of the 2 frequency
+         icom_freq = ncom_fsbc * ncom_dttrc
+         IF( MOD( MAX(ncom_fsbc,ncom_dttrc), MIN(ncom_fsbc,ncom_dttrc) ) == 0 ) icom_freq = MAX(ncom_fsbc,ncom_dttrc)
+         
+         IF ( ncom_stp == nit000+icom_freq ) THEN   ! avoid to count extra communications in potential initializations at nit000
             IF( .NOT. ALLOCATED( ncomm_sequence) ) THEN
                ALLOCATE( ncomm_sequence(2000,2), STAT=ierr )
                IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'lnk_generic, cannot allocate ncomm_sequence' )
-               ALLOCATE( crname(2000), STAT=ierr )
+               ALLOCATE( crname_lbc(2000), STAT=ierr )
                IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'lnk_generic, cannot allocate crname' )
             ENDIF
-            n_sequence = n_sequence + 1
-            IF( n_sequence > 2000 ) CALL ctl_stop( 'STOP', 'lnk_generic, increase ncomm_sequence first dimension' )
-            ncomm_sequence(n_sequence,1) = ipk*ipl   ! size of 3rd and 4th dimensions
-            ncomm_sequence(n_sequence,2) = ipf       ! number of arrays to be treated (multi)
-            crname(n_sequence) = cdname              ! keep the name of the calling routine
-         ELSE IF ( ncom_stp == (nit000+1) ) THEN
-            IF ( .NOT. l_comm_report_done ) THEN
-               WRITE(numout,*) ' '
-               WRITE(numout,*) ' -----------------------------------------------'
-               WRITE(numout,*) ' Communication pattern report (first time step):'
-               WRITE(numout,*) ' -----------------------------------------------'
-               WRITE(numout,*) ' '
-               WRITE(numout,'(A,I4)') ' Exchanged halos : ', n_sequence
+            n_sequence_lbc = n_sequence_lbc + 1
+            IF( n_sequence_lbc > 2000 ) CALL ctl_stop( 'STOP', 'lnk_generic, increase ncomm_sequence first dimension' )
+            ncomm_sequence(n_sequence_lbc,1) = ipk*ipl   ! size of 3rd and 4th dimensions
+            ncomm_sequence(n_sequence_lbc,2) = ipf       ! number of arrays to be treated (multi)
+            crname_lbc    (n_sequence_lbc)   = cdname    ! keep the name of the calling routine
+         ELSE IF ( ncom_stp == (nit000+2*icom_freq) ) THEN
+            IF ( numcom == -1 ) THEN
+               CALL ctl_opn( numcom, 'communication_report.txt', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea )
+               WRITE(numcom,*) ' '
+               WRITE(numcom,*) ' ------------------------------------------------------------'
+               WRITE(numcom,*) ' Communication pattern report (second oce+sbc+top time step):'
+               WRITE(numcom,*) ' ------------------------------------------------------------'
+               WRITE(numcom,*) ' '
+               WRITE(numcom,'(A,I4)') ' Exchanged halos : ', n_sequence_lbc
                jj = 0; jk = 0; jf = 0; jh = 0
-               DO ji = 1, n_sequence
+               DO ji = 1, n_sequence_lbc
                   IF ( ncomm_sequence(ji,1) .GT. 1 ) jk = jk + 1
                   IF ( ncomm_sequence(ji,2) .GT. 1 ) jf = jf + 1
@@ -180,25 +187,40 @@
                   jh = MAX (jh, ncomm_sequence(ji,1)*ncomm_sequence(ji,2))
                END DO
-               WRITE(numout,'(A,I3)') ' 3D Exchanged halos : ', jk
-               WRITE(numout,'(A,I3)') ' Multi arrays exchanged halos : ', jf
-               WRITE(numout,'(A,I3)') '   from which 3D : ', jj
-               WRITE(numout,'(A,I10)') ' Array max size : ', jh*jpi*jpj
-               WRITE(numout,*) ' '
-               WRITE(numout,*) ' lbc_lnk called'
+               WRITE(numcom,'(A,I3)') ' 3D Exchanged halos : ', jk
+               WRITE(numcom,'(A,I3)') ' Multi arrays exchanged halos : ', jf
+               WRITE(numcom,'(A,I3)') '   from which 3D : ', jj
+               WRITE(numcom,'(A,I10)') ' Array max size : ', jh*jpi*jpj
+               WRITE(numcom,*) ' '
+               WRITE(numcom,*) ' lbc_lnk called'
                jj = 1
-               DO ji = 2, n_sequence
-                  IF( crname(ji-1) /= crname(ji) ) THEN
-                    WRITE(numout,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname(ji-1))
+               DO ji = 2, n_sequence_lbc
+                  IF( crname_lbc(ji-1) /= crname_lbc(ji) ) THEN
+                    WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_lbc(ji-1))
                     jj = 0
                   END IF
                   jj = jj + 1 
                END DO
-               WRITE(numout,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname(n_sequence))
-               WRITE(numout,*) ' '
-               WRITE(numout,*) ' -----------------------------------------------'
-               WRITE(numout,*) ' '
+               WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_lbc(n_sequence_lbc))
+               WRITE(numcom,*) ' '
+               IF ( n_sequence_glb > 0 ) THEN
+                  WRITE(numcom,'(A,I4)') ' Global communications : ', n_sequence_glb
+                  jj = 1
+                  DO ji = 2, n_sequence_glb
+                     IF( crname_glb(ji-1) /= crname_glb(ji) ) THEN
+                       WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_glb(ji-1))
+                       jj = 0
+                     END IF
+                     jj = jj + 1 
+                  END DO
+                  WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_glb(n_sequence_glb))
+                  DEALLOCATE(crname_glb)
+               ELSE
+                  WRITE(numcom,*) ' No MPI global communication '
+               ENDIF
+               WRITE(numcom,*) ' '
+               WRITE(numcom,*) ' -----------------------------------------------'
+               WRITE(numcom,*) ' '
                DEALLOCATE(ncomm_sequence)
-               DEALLOCATE(crname)
-               l_comm_report_done = .TRUE.
+               DEALLOCATE(crname_lbc)
             ENDIF
          ENDIF
Index: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90
===================================================================
--- NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90	(revision 10292)
+++ NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90	(revision 10297)
@@ -173,5 +173,5 @@
          &       ilej(jpni,jpnj), ildj(jpni,jpnj), ioso(jpni,jpnj), iowe(jpni,jpnj),   &
          &       STAT=ierr )
-      CALL mpp_sum( ierr )
+      CALL mpp_sum( 'mppini', ierr )
       IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'mpp_init: unable to allocate standard ocean arrays' )
       
