Index: NEMO/trunk/src/OCE/TRD/trddyn.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trddyn.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trddyn.F90	(revision 10425)
@@ -129,5 +129,5 @@
                                  END DO
                               END DO
-                              CALL lbc_lnk_multi( z3dx, 'U', -1., z3dy, 'V', -1. )
+                              CALL lbc_lnk_multi( 'trddyn', z3dx, 'U', -1., z3dy, 'V', -1. )
                               CALL iom_put( "utrd_udx", z3dx  )
                               CALL iom_put( "vtrd_vdy", z3dy  )
@@ -165,5 +165,5 @@
 !                                 END DO
 !                              END DO
-!                              CALL lbc_lnk_multi( z3dx, 'U', -1., z3dy, 'V', -1. )
+!                              CALL lbc_lnk_multi( 'trddyn', z3dx, 'U', -1., z3dy, 'V', -1. )
 !                              CALL iom_put( "utrd_bfr", z3dx )
 !                              CALL iom_put( "vtrd_bfr", z3dy )
Index: NEMO/trunk/src/OCE/TRD/trdglo.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdglo.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdglo.F90	(revision 10425)
@@ -249,8 +249,8 @@
          ! ---------------------------------
          IF( lk_mpp ) THEN
-            CALL mpp_sum( peke )
-            CALL mpp_sum( umo , jptot_dyn )
-            CALL mpp_sum( vmo , jptot_dyn )
-            CALL mpp_sum( hke , jptot_dyn )
+            CALL mpp_sum( 'trdglo', peke )
+            CALL mpp_sum( 'trdglo', umo , jptot_dyn )
+            CALL mpp_sum( 'trdglo', vmo , jptot_dyn )
+            CALL mpp_sum( 'trdglo', hke , jptot_dyn )
          ENDIF
 
@@ -392,8 +392,8 @@
          ! -------------------------------
          IF( lk_mpp ) THEN
-            CALL mpp_sum( tmo, jptot_tra )   
-            CALL mpp_sum( smo, jptot_tra )
-            CALL mpp_sum( t2 , jptot_tra )
-            CALL mpp_sum( s2 , jptot_tra )
+            CALL mpp_sum( 'trdglo', tmo, jptot_tra )   
+            CALL mpp_sum( 'trdglo', smo, jptot_tra )
+            CALL mpp_sum( 'trdglo', t2 , jptot_tra )
+            CALL mpp_sum( 'trdglo', s2 , jptot_tra )
          ENDIF
 
@@ -526,5 +526,5 @@
          tvolt = tvolt + SUM( e1e2t(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:) )
       END DO
-      IF( lk_mpp )   CALL mpp_sum( tvolt )   ! sum over the global domain
+      CALL mpp_sum( 'trdglo', tvolt )   ! sum over the global domain
 
       IF(lwp) WRITE(numout,*) '                total ocean volume at T-point   tvolt = ',tvolt
@@ -546,6 +546,6 @@
          END DO
       END DO
-      IF( lk_mpp )   CALL mpp_sum( tvolu )   ! sums over the global domain
-      IF( lk_mpp )   CALL mpp_sum( tvolv )
+      CALL mpp_sum( 'trdglo', tvolu )   ! sums over the global domain
+      CALL mpp_sum( 'trdglo', tvolv )
 
       IF(lwp) THEN
Index: NEMO/trunk/src/OCE/TRD/trdken.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdken.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdken.F90	(revision 10425)
@@ -54,6 +54,6 @@
       ALLOCATE( bu(jpi,jpj,jpk) , bv(jpi,jpj,jpk) , r1_bt(jpi,jpj,jpk) , STAT= trd_ken_alloc )
       !
-      IF( lk_mpp             )   CALL mpp_sum ( trd_ken_alloc )
-      IF( trd_ken_alloc /= 0 )   CALL ctl_warn('trd_ken_alloc: failed to allocate arrays')
+      CALL mpp_sum ( 'trdken', trd_ken_alloc )
+      IF( trd_ken_alloc /= 0 )   CALL ctl_stop( 'STOP', 'trd_ken_alloc: failed to allocate arrays' )
    END FUNCTION trd_ken_alloc
 
@@ -88,5 +88,5 @@
       !!----------------------------------------------------------------------
       !
-      CALL lbc_lnk_multi( putrd, 'U', -1. , pvtrd, 'V', -1. )      ! lateral boundary conditions
+      CALL lbc_lnk_multi( 'trdken', putrd, 'U', -1. , pvtrd, 'V', -1. )      ! lateral boundary conditions
       !
       nkstp = kt
Index: NEMO/trunk/src/OCE/TRD/trdmxl.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdmxl.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdmxl.F90	(revision 10425)
@@ -81,5 +81,5 @@
       ALLOCATE( ndextrd1(jpi*jpj) , STAT=trd_mxl_alloc )
       !
-      IF( lk_mpp             )   CALL mpp_sum ( trd_mxl_alloc )
+      CALL mpp_sum ( 'trdmxl', trd_mxl_alloc )
       IF( trd_mxl_alloc /= 0 )   CALL ctl_warn('trd_mxl_alloc: failed to allocate array ndextrd1')
    END FUNCTION trd_mxl_alloc
@@ -152,5 +152,5 @@
 !!gm to be put juste before the output !
 !      ! Lateral boundary conditions
-!      CALL lbc_lnk_multi( tmltrd(:,:,jl), 'T', 1. , smltrd(:,:,jl), 'T', 1. )
+!      CALL lbc_lnk_multi( 'trdmxl', tmltrd(:,:,jl), 'T', 1. , smltrd(:,:,jl), 'T', 1. )
 !!gm end
 
@@ -470,5 +470,5 @@
          !-- Lateral boundary conditions
          !         ... temperature ...                    ... salinity ...
-         CALL lbc_lnk_multi( ztmltot , 'T', 1., zsmltot , 'T', 1., &
+         CALL lbc_lnk_multi( 'trdmxl', ztmltot , 'T', 1., zsmltot , 'T', 1., &
                   &          ztmlres , 'T', 1., zsmlres , 'T', 1., &
                   &          ztmlatf , 'T', 1., zsmlatf , 'T', 1. )
@@ -521,8 +521,8 @@
          !-- Lateral boundary conditions
          !         ... temperature ...                    ... salinity ...
-         CALL lbc_lnk_multi( ztmltot2, 'T', 1., zsmltot2, 'T', 1., &
+         CALL lbc_lnk_multi( 'trdmxl', ztmltot2, 'T', 1., zsmltot2, 'T', 1., &
                   &          ztmlres2, 'T', 1., zsmlres2, 'T', 1. )
          !
-         CALL lbc_lnk_multi( ztmltrd2(:,:,:), 'T', 1., zsmltrd2(:,:,:), 'T', 1. ) ! /  in the NetCDF trends file
+         CALL lbc_lnk_multi( 'trdmxl', ztmltrd2(:,:,:), 'T', 1., zsmltrd2(:,:,:), 'T', 1. ) ! /  in the NetCDF trends file
          
          ! III.3 Time evolution array swap
Index: NEMO/trunk/src/OCE/TRD/trdmxl_oce.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdmxl_oce.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdmxl_oce.F90	(revision 10425)
@@ -127,6 +127,6 @@
       !
       trdmxl_oce_alloc = MAXVAL( ierr )
-      IF( lk_mpp                )   CALL mpp_sum ( trdmxl_oce_alloc )
-      IF( trdmxl_oce_alloc /= 0 )   CALL ctl_warn('trdmxl_oce_alloc: failed to allocate arrays')
+      CALL mpp_sum ( 'trdmxl_oce', trdmxl_oce_alloc )
+      IF( trdmxl_oce_alloc /= 0 )   CALL ctl_stop( 'STOP', 'trdmxl_oce_alloc: failed to allocate arrays' )
       !
    END FUNCTION trdmxl_oce_alloc
Index: NEMO/trunk/src/OCE/TRD/trdmxl_rst.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdmxl_rst.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdmxl_rst.F90	(revision 10425)
@@ -61,7 +61,5 @@
          IF(lwp) THEN
             WRITE(numout,*)
-            SELECT CASE ( jprstlib )
-            CASE DEFAULT         ;   WRITE(numout,*) '             open ocean restart_mxl NetCDF file: '//clname
-            END SELECT
+            WRITE(numout,*) '             open ocean restart_mxl NetCDF file: '//clname
             IF( kt == nitrst - 1 ) THEN   ;   WRITE(numout,*) '             kt = nitrst - 1 = ', kt,' date= ', ndastp
             ELSE                          ;   WRITE(numout,*) '             kt = '             , kt,' date= ', ndastp
@@ -69,5 +67,5 @@
          ENDIF
 
-         CALL iom_open( TRIM(clpath)//TRIM(clname), nummxlw, ldwrt = .TRUE., kiolib = jprstlib )
+         CALL iom_open( TRIM(clpath)//TRIM(clname), nummxlw, ldwrt = .TRUE. )
       ENDIF
 
@@ -133,5 +131,4 @@
       CHARACTER (len=35) :: charout
       INTEGER ::   jk         ! loop indice
-      INTEGER ::   jlibalt = jprstlib
       LOGICAL ::   llok
       CHARACTER(LEN=256)  ::   clpath   ! full path to restart file
@@ -146,5 +143,5 @@
       clpath = TRIM(cn_ocerst_indir)
       IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/'
-      CALL iom_open( TRIM(clpath)//TRIM(cn_trdrst_in), inum, kiolib = jlibalt ) 
+      CALL iom_open( TRIM(clpath)//TRIM(cn_trdrst_in), inum ) 
 
       IF( ln_trdmxl_instant ) THEN 
Index: NEMO/trunk/src/OCE/TRD/trdpen.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdpen.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdpen.F90	(revision 10425)
@@ -50,6 +50,6 @@
       ALLOCATE( rab_pe(jpi,jpj,jpk,jpts) , STAT= trd_pen_alloc )
       !
-      IF( lk_mpp             )   CALL mpp_sum ( trd_pen_alloc )
-      IF( trd_pen_alloc /= 0 )   CALL ctl_warn( 'trd_pen_alloc: failed to allocate arrays' )
+      CALL mpp_sum ( 'trdpen', trd_pen_alloc )
+      IF( trd_pen_alloc /= 0 )   CALL ctl_stop( 'STOP',  'trd_pen_alloc: failed to allocate arrays'  )
    END FUNCTION trd_pen_alloc
 
Index: NEMO/trunk/src/OCE/TRD/trdtra.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdtra.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdtra.F90	(revision 10425)
@@ -55,6 +55,6 @@
       ALLOCATE( trdtx(jpi,jpj,jpk) , trdty(jpi,jpj,jpk) , trdt(jpi,jpj,jpk) , avt_evd(jpi,jpj,jpk), STAT= trd_tra_alloc )
       !
-      IF( lk_mpp             )   CALL mpp_sum ( trd_tra_alloc )
-      IF( trd_tra_alloc /= 0 )   CALL ctl_warn('trd_tra_alloc: failed to allocate arrays')
+      CALL mpp_sum ( 'trdtra', trd_tra_alloc )
+      IF( trd_tra_alloc /= 0 )   CALL ctl_stop( 'STOP', 'trd_tra_alloc: failed to allocate arrays' )
    END FUNCTION trd_tra_alloc
 
Index: NEMO/trunk/src/OCE/TRD/trdvor.F90
===================================================================
--- NEMO/trunk/src/OCE/TRD/trdvor.F90	(revision 10068)
+++ NEMO/trunk/src/OCE/TRD/trdvor.F90	(revision 10425)
@@ -73,6 +73,6 @@
          &      ndexvor1  (jpi*jpj)                                ,   STAT= trd_vor_alloc )
          !
-      IF( lk_mpp             )   CALL mpp_sum ( trd_vor_alloc )
-      IF( trd_vor_alloc /= 0 )   CALL ctl_warn('trd_vor_alloc: failed to allocate arrays')
+      CALL mpp_sum ( 'trdvor', trd_vor_alloc )
+      IF( trd_vor_alloc /= 0 )   CALL ctl_stop( 'STOP', 'trd_vor_alloc: failed to allocate arrays' )
    END FUNCTION trd_vor_alloc
 
@@ -161,5 +161,5 @@
 
       zudpvor(:,:) = 0._wp                 ;   zvdpvor(:,:) = 0._wp                    ! Initialisation
-      CALL lbc_lnk_multi( putrdvor, 'U', -1. , pvtrdvor, 'V', -1. )      ! lateral boundary condition
+      CALL lbc_lnk_multi( 'trdvor', putrdvor, 'U', -1. , pvtrdvor, 'V', -1. )      ! lateral boundary condition
       
 
@@ -250,5 +250,5 @@
       zvdpvor(:,:) = 0._wp
       !                            ! lateral boundary condition on input momentum trends
-      CALL lbc_lnk_multi( putrdvor, 'U', -1. , pvtrdvor, 'V', -1. )
+      CALL lbc_lnk_multi( 'trdvor', putrdvor, 'U', -1. , pvtrdvor, 'V', -1. )
 
       !  =====================================
@@ -395,5 +395,5 @@
 
          ! Boundary conditions
-         CALL lbc_lnk_multi( vor_avrtot, 'F', 1. , vor_avrres, 'F', 1. )
+         CALL lbc_lnk_multi( 'trdvor', vor_avrtot, 'F', 1. , vor_avrres, 'F', 1. )
 
 
