Index: trunk/NEMO/TOP_SRC/SED/sedwri.F90
===================================================================
--- trunk/NEMO/TOP_SRC/SED/sedwri.F90	(revision 1179)
+++ trunk/NEMO/TOP_SRC/SED/sedwri.F90	(revision 1250)
@@ -129,8 +129,8 @@
          ENDDO
       ENDDO
-      CALL unpack_arr( jpoce, trcsedi(1:jpi,1:jpj,1:jpksed,12)  , iarroce(1:jpoce), &
+      CALL unpack_arr( jpoce, flxsedi3d(1:jpi,1:jpj,1:jpksed,1)  , iarroce(1:jpoce), &
          &                   zdta(1:jpoce,1:jpksed)  )
       
-      CALL unpack_arr( jpoce, trcsedi(1:jpi,1:jpj,1:jpksed,13)  , iarroce(1:jpoce), &
+      CALL unpack_arr( jpoce, flxsedi3d(1:jpi,1:jpj,1:jpksed,2)  , iarroce(1:jpoce), &
          &                   co3por(1:jpoce,1:jpksed)  )
       
@@ -144,5 +144,5 @@
          ENDDO
       ENDDO
-      CALL unpack_arr( jpoce, trcsedi(1:jpi,1:jpj,1:jpksed,14)  , iarroce(1:jpoce), &
+      CALL unpack_arr( jpoce, flxsedi3d(1:jpi,1:jpj,1:jpksed,3)  , iarroce(1:jpoce), &
          &                   zdta(1:jpoce,1:jpksed)  )
       
@@ -164,11 +164,11 @@
       ENDDO
 
-      CALL unpack_arr( jpoce, flxsedi(1:jpi,1:jpj,1), iarroce(1:jpoce), zflx(1:jpoce,1)  )
-      CALL unpack_arr( jpoce, flxsedi(1:jpi,1:jpj,2), iarroce(1:jpoce), zflx(1:jpoce,2)  )
-      CALL unpack_arr( jpoce, flxsedi(1:jpi,1:jpj,3), iarroce(1:jpoce), zflx(1:jpoce,3)  )
-      CALL unpack_arr( jpoce, flxsedi(1:jpi,1:jpj,4), iarroce(1:jpoce), zflx(1:jpoce,4)  )
-      CALL unpack_arr( jpoce, flxsedi(1:jpi,1:jpj,5), iarroce(1:jpoce), zflx(1:jpoce,5)  )
-      CALL unpack_arr( jpoce, flxsedi(1:jpi,1:jpj,6), iarroce(1:jpoce), zflx(1:jpoce,6)  )
-      CALL unpack_arr( jpoce, flxsedi(1:jpi,1:jpj,7), iarroce(1:jpoce), zflx(1:jpoce,8)  )
+      CALL unpack_arr( jpoce, flxsedi2d(1:jpi,1:jpj,1), iarroce(1:jpoce), zflx(1:jpoce,1)  )
+      CALL unpack_arr( jpoce, flxsedi2d(1:jpi,1:jpj,2), iarroce(1:jpoce), zflx(1:jpoce,2)  )
+      CALL unpack_arr( jpoce, flxsedi2d(1:jpi,1:jpj,3), iarroce(1:jpoce), zflx(1:jpoce,3)  )
+      CALL unpack_arr( jpoce, flxsedi2d(1:jpi,1:jpj,4), iarroce(1:jpoce), zflx(1:jpoce,4)  )
+      CALL unpack_arr( jpoce, flxsedi2d(1:jpi,1:jpj,5), iarroce(1:jpoce), zflx(1:jpoce,5)  )
+      CALL unpack_arr( jpoce, flxsedi2d(1:jpi,1:jpj,6), iarroce(1:jpoce), zflx(1:jpoce,6)  )
+      CALL unpack_arr( jpoce, flxsedi2d(1:jpi,1:jpj,7), iarroce(1:jpoce), zflx(1:jpoce,8)  )
 
 
@@ -191,7 +191,7 @@
 
          DO jn = 1, jptrased
-            cltra  = sedtrc3d(jn)   ! short title for 3D diagnostic
-            cltral = sedtrc3l(jn)   ! long title for 3D diagnostic
-            cltrau = sedtrc3u(jn)   ! UNIT for 3D diagnostic
+            cltra  = sedtrcd(jn)   ! short title for sediment variable
+            cltral = sedtrcl(jn)   ! long title for  sediment variable
+            cltrau = sedtrcu(jn)   ! unit for  sediment variable
 
             CALL histdef( nised, cltra,cltral,cltrau, jpi, jpj, nhorised, &
@@ -199,9 +199,19 @@
          ENDDO
 
+         ! 3D diagnostic
+         DO jn = 1, jpdia3dsed
+            cltra  = seddia3d(jn)   ! short title for 3D diagnostic
+            cltral = seddia3l(jn)   ! long title for 3D diagnostic
+            cltrau = seddia3u(jn)   ! UNIT for 3D diagnostic
+
+            CALL histdef( nised, cltra,cltral,cltrau, jpi, jpj, nhorised, &
+               &          ipk, 1, ipk, ndepsed, 32, clop, zsto, zout  )
+         ENDDO
+
          !Fluxes
-         DO jn = 1, jpflxsed
-            cltra  = sedtrc2d(jn)   ! short title for 3D diagnostic
-            cltral = sedtrc2l(jn)   ! long title for 3D diagnostic
-            cltrau = sedtrc2u(jn)   ! UNIT for 3D diagnostic
+         DO jn = 1, jpdia2dsed
+            cltra  = seddia2d(jn)   ! short title for 2D diagnostic
+            cltral = seddia2l(jn)   ! long title for 2D diagnostic
+            cltrau = seddia2u(jn)   ! UNIT for 2D diagnostic
             
             CALL histdef( nised, cltra,cltral,cltrau, jpi, jpj, nhorised, &
@@ -221,11 +231,16 @@
          ! ---------------------
           DO jn = 1, jptrased
-             cltra = sedtrc3d(jn) ! short title for 3D diagnostic
+             cltra = sedtrcd(jn) ! short title for 3D diagnostic
              CALL histwrite( nised, cltra, it, trcsedi(:,:,:,jn), ndimt52, ndext52 )
           END DO
 
-          DO jn = 1, jpflxsed
-             cltra = sedtrc2d(jn) ! short title for 2D diagnostic
-             CALL histwrite( nised, cltra, it, flxsedi(:,:,jn  ), ndimt51, ndext51 )
+          DO jn = 1, jpdia3dsed
+             cltra = seddia3d(jn) ! short title for 3D diagnostic
+             CALL histwrite( nised, cltra, it, flxsedi3d(:,:,:,jn), ndimt52, ndext52 )
+          END DO
+
+          DO jn = 1, jpdia2dsed
+             cltra = seddia2d(jn) ! short title for 2D diagnostic
+             CALL histwrite( nised, cltra, it, flxsedi2d(:,:,jn  ), ndimt51, ndext51 )
           END DO
 
@@ -253,7 +268,13 @@
 #else
    !!======================================================================
-   !! MODULE sedwri :   Dummy module 
-   !!======================================================================
-
+   !! MODULE sedwri  :   Dummy module
+   !!======================================================================
+CONTAINS
+   SUBROUTINE sed_wri( kt )         ! Empty routine
+      INTEGER, INTENT(in) :: kt
+      WRITE(*,*) 'sed_adv: You should not have seen this print! error?', kt
+   END SUBROUTINE sed_wri
+
+   !!======================================================================
 #endif
 
