Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcsms_idtra.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcsms_idtra.F90	(revision 6828)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcsms_idtra.F90	(revision 6829)
@@ -133,12 +133,9 @@
                DO ji = 2,jpim1
             
-                 IF (trn(ji,jj,jk,jn) > 0.0) THEN
+                 !! IF (trn(ji,jj,jk,jn) > 0.0) THEN
                     WTEMP = trn(ji,jj,jk,jn) * (1. - FDEC )
                     tra(ji,jj,jk,jn) = (tra(ji,jj,jk,jn) - WTEMP/rdt ) * &
                                      tmask(ji,jj,jk)
-                 ELSE
-                    trn(ji,jj,jk,jn) = 0.0
-                    tra(ji,jj,jk,jn) = 0.0
-                 ENDIF 
+                 !! ENDIF 
               ENDDO 
             ENDDO
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcsed_medusa.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcsed_medusa.F90	(revision 6828)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcsed_medusa.F90	(revision 6829)
@@ -23,12 +23,16 @@
    !! AXY (10/02/09)
    USE iom
-   !! USE trc_nam_dia         ! JPALM 13-11-2015 -- if iom_use for diag
-   !! USE trc_nam_iom_medusa  ! JPALM 13-11-2015 -- if iom_use for diag
-   USE fldread         !  time interpolation
+   !! USE trc_nam_dia                   ! JPALM 13-11-2015 -- if iom_use for diag
+   !! USE trc_nam_iom_medusa            ! JPALM 13-11-2015 -- if iom_use for diag
+   USE fldread                          !  time interpolation
    USE lbclnk
-   USE prtctl_trc      ! Print control for debbuging
+   USE prtctl_trc                       ! Print control for debbuging
    !! JPALM (27-06-2016): add lk_oasis for CO2 and DMS coupling with atm
    USE sbc_oce, ONLY: lk_oasis
    USE oce,     ONLY: Dust_in_cpl
+   !! Check Dust dep
+# if defined key_debug_medusa   
+   !! USE trcrst, ONLY: trc_rst_dia_stat   !! variable stat
+# endif
 
 
@@ -49,7 +53,7 @@
       sedfeinput = 1.e-9_wp  ,         &
       dustsolub  = 0.014_wp
-
-   INTEGER , PARAMETER :: nbtimes = 365  !: maximum number of times record in a file
-   INTEGER  :: ntimes_dust               ! number of time steps in a file
+   REAL(wp), PARAMETER :: Fe_dust_mratio = 0.035   !! Fe:dust mass ratio = 0.035
+   INTEGER , PARAMETER ::        nbtimes = 365     !: maximum number of times record in a file
+   INTEGER  :: ntimes_dust                         ! number of time steps in a file
 
    INTEGER ::                          &
@@ -98,6 +102,4 @@
 
       !! AXY (10/02/09)
-      !! REAL(wp), DIMENSION(jpi,jpj)     ::   zsidep    !! Si deposition
-      !! REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zirondep  !! Fe deposition
       REAL(wp) ::   rfact2
 
@@ -106,6 +108,4 @@
       !! JPALM - 26-11-2015 -add iom_use for diagnostic
        REAL(wp), POINTER, DIMENSION(:,:  ) :: zw2d
-      !! JPALM -- 20-07-2016 --
-      REAL(wp), PARAMETER :: Fe_dust_mratio = 0.035   !! Fe:dust mass ratio = 0.035
       !!---------------------------------------------------------------------
       !!
@@ -150,10 +150,9 @@
       !! IF (kt == nittrc000 ) CALL trc_sed_medusa_sbc 
 
-      !! JPALM -- 20-07-2016 -- change the dust dep conversion.
-      !!                     now all dust dep forcings and coupling are in SI units : 
-      !!                     kg-dust/m2/s instead of g-Fe/m2/month.
-      !!                     and we convert them here into mmol-Fe/m2/day
-      !!                     what will be changed into mmol-Fe/m3/d in trcbio_med
-      !!
+      !! JPALM -- 20-07-2016 -- adapt dust forcing fields reading and conversion
+      !!                     To read dust dep in kg-dust/m2/s instead of g-Fe/m2/month 
+      !!                     So all forcings and coupling dust dep are in the same SI units
+      !!                     and then convert in mmol-Fe/m2/day
+
       IF( bdustfer ) THEN
          IF( kt == nittrc000 .OR. ( kt /= nittrc000 .AND. ntimes_dust > 1 ) ) THEN
@@ -167,17 +166,33 @@
       ENDIF
       !!
-
       zirondep(:,:) = 0.e0     !! Initialisation of deposition variables
-      zirondep(:,:) = dust(:,:) * Fe_dust_mratio / xfe_mass * 1.e6 * 86400  !! mmol-Fe/m2/d
-
-      !!
-      !! JPALM -- 20-07-2016 -- previous Fe and Si deposition.
-      !!                     not used --> commented.
-      !!                     but may want to use it later on.
-      !!
-      !! Iron and Si deposition at the surface 
+      zirondep(:,:) = dust(:,:) * Fe_dust_mratio / xfe_mass * 1.e6 * 86400.  !! mmol-Fe/m2/d
+      
+      !! JPALM -- 20-07-2016 -- Zirondep and zsidep are not used.
+      !!                     So comment out the following lines. but keep them
+      !!                     as we may want to used them later on
+      !!================================================     
+      !!
+      !! zirondep(:,:,:) = 0.e0     !! Initialisation of deposition variables
+      !! zsidep  (:,:)   = 0.e0
+      !!
+      !! Iron and Si deposition at the surface
       !! -------------------------------------
       !!
       !! DO jj = 1, jpj
+      !!    DO ji = 1, jpi
+      !!       zirondep(ji,jj,1) = (dustsolub * dust(ji,jj) / (55.85 * rmtss) + 3.e-10 / ryyss) &
+      !!       & * rfact2 / fse3t(ji,jj,1)
+      !!       zsidep  (ji,jj)   = 8.8 * 0.075 * dust(ji,jj) * rfact2 / &
+      !!       & (fse3t(ji,jj,1) * 28.1 * rmtss)
+      !!    END DO
+      !! END DO
+
+      ! sedimentation of detrital nitrogen : upstream scheme
+      ! ----------------------------------------------------
+      !
+      zwork(:,:,:) = 0.e0        ! initialisation of sinking variable
+      ! for detrital nitrogen sedimentation only - jpdet
+      zwork(:,:,1  ) = 0.e0      ! surface value set to zero
       !!    DO ji = 1, jpi
       !!       zirondep(ji,jj,1) = (dustsolub * dust(ji,jj) / (55.85 * rmtss) + 3.e-10 / ryyss) &
@@ -218,8 +233,8 @@
                IF (lk_iomput .AND. .NOT. ln_diatrc) THEN
                      IF( med_diag%DSED%dgsave ) THEN
-                         zw2d(ji,jj) = zw2d(ji,jj) + ztra * fse3t(ji,jj,jk) * 86400
+                         zw2d(ji,jj) = zw2d(ji,jj) + ztra * fse3t(ji,jj,jk) * 86400.
                       ENDIF   
                ELSE IF( ln_diatrc )  THEN
-                    trc2d(ji,jj,8) = trc2d(ji,jj,8) + ztra * fse3t(ji,jj,jk) * 86400
+                    trc2d(ji,jj,8) = trc2d(ji,jj,8) + ztra * fse3t(ji,jj,jk) * 86400.
                ENDIF    
                 
@@ -328,12 +343,14 @@
       INTEGER  :: numdust
       INTEGER  :: ierr 
+      INTEGER  :: jfld                ! dummy loop arguments
       INTEGER  :: ios                 ! Local integer output status for namelist read
-      INTEGER  :: isrow             ! index for ORCA1 starting row
+      INTEGER  :: isrow               ! index for ORCA1 starting row
       REAL(wp) :: ztimes_dust
       REAL(wp), DIMENSION(nbtimes) :: zsteps                 ! times records
       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zdust
       !
-      CHARACTER(len=100) ::  cn_dir          ! Root directory for location of ssr files
-      TYPE(FLD_N) ::   sn_dust               ! informations about the fields to be read
+      CHARACTER(len=100)         ::  cn_dir       ! Root directory for location of ssr files
+      TYPE(FLD_N), DIMENSION(1)  ::   slf_d       ! array of namelist informations on the fields to read
+      TYPE(FLD_N)                ::   sn_dust     ! informations about the fields to be read
       !
       NAMELIST/nammedsbc/cn_dir, sn_dust, bdustfer 
@@ -354,8 +371,8 @@
 
       IF(lwp) THEN
-         WRITE(numout,*) ' '
-         WRITE(numout,*) ' namelist : nammedsbc '
-         WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~ '
-         WRITE(numout,*) '    dust input from the atmosphere           bdustfer     = ', bdustfer
+          WRITE(numout,*) ' '
+          WRITE(numout,*) ' namelist : nammedsbc '
+          WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~ '
+          WRITE(numout,*) '    dust input from the atmosphere bdustfer     = ', bdustfer
       END IF
 
@@ -370,29 +387,24 @@
          !!ALLOCATE( dust(jpi,jpj) )    ! allocation
          !
+         slf_d(1) = sn_dust                          ! store namelist information in an array
+         !
          ALLOCATE( sf_dust(1), STAT=ierr )           !* allocate and fill sf_sst (forcing structure) with sn_sst
          IF( ierr > 0 )   CALL ctl_stop( 'STOP', 'trc_sed_medusa_sbc: unable to allocate sf_dust structure' )
-         !
-         CALL fld_fill( sf_dust, (/ sn_dust /), cn_dir, 'trc_sed_medusa_sbc', 'Atmospheric dust deposition', 'nammedsed' )
-                                   ALLOCATE( sf_dust(1)%fnow(jpi,jpj,1)   )
-         IF( sn_dust%ln_tint )     ALLOCATE( sf_dust(1)%fdta(jpi,jpj,1,2) )
-         !
-         IF( Agrif_Root() ) THEN   !  Only on the master grid
-            ! Get total input dust ; need to compute total atmospheric supply of Si in a year
-            CALL iom_open (  TRIM( sn_dust%clname ) , numdust )
-            CALL iom_gettime( numdust, zsteps, kntime=ntimes_dust)  ! get number of record in file
-            ALLOCATE( zdust(jpi,jpj,ntimes_dust) )
-            DO jm = 1, ntimes_dust
-               CALL iom_get( numdust, jpdom_data, TRIM( sn_dust%clvar ), zdust(:,:,jm), jm )
-            END DO
-            CALL iom_close( numdust )
-            DEALLOCATE( zdust)
-         ENDIF
+         ALLOCATE( sf_dust(1)%fnow(jpi,jpj,1))
+         IF( slf_d(1)%ln_tint )     ALLOCATE( sf_dust(1)%fdta(jpi,jpj,1,2) )
+         !
+         CALL fld_fill( sf_dust, slf_d, cn_dir, 'trc_sed_medusa_sbc', 'Atmospheric dust deposition', 'nammedsed' )
          !
          CALL fld_read( kt, 1, sf_dust )
          dust(:,:) = sf_dust(1)%fnow(:,:,1)
          !
+      ELSEIF (lk_oasis) THEN
+         dust = Dust_in_cpl
       ELSE
          dust(:,:) = 0.0
       END IF
+      !
+      zirondep(:,:) = 0.e0     !! Initialisation of deposition variables
+      zirondep(:,:) = dust(:,:) * Fe_dust_mratio / xfe_mass * 1.e6 * 86400.      !! mmol-Fe/m2/d
       !
       IF( nn_timing == 1 )  CALL timing_stop('trc_sed_medusa_sbc')
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 6828)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 6829)
@@ -414,4 +414,8 @@
       call trc_rst_dia_stat(zn_dms_srf(:,:), 'DMS surf')
       call trc_rst_dia_stat(zn_co2_flx(:,:), 'CO2 flux')
+      !!
+      IF(lwp) WRITE(numout,*) ' MEDUSA averaged prop. for dust and iron dep.'
+      call trc_rst_dia_stat(dust(:,:), 'Dust dep')
+      call trc_rst_dia_stat(zirondep(:,:), 'Iron dep')
       !! 
 #endif
