Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 5982)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 6022)
@@ -69,5 +69,5 @@
 # if defined key_iomput
       USE iom
-      USE trcnam_medusa                ! JPALM 13-11-2015 -- if iom_use for diag
+      USE trcnam_medusa         ! JPALM 13-11-2015 -- if iom_use for diag
       !!USE trc_nam_iom_medusa  ! JPALM 13-11-2015 -- if iom_use for diag
 # endif
@@ -354,4 +354,7 @@
       REAL(wp), POINTER, DIMENSION(:,:  ) :: f_TDIC2d, f_TALK2d, f_kw6602d, f_pp02d, f_o2flux2d, f_o2sat2d
       REAL(wp), POINTER, DIMENSION(:,:  ) :: dms_surf2d, dms_andr2d, dms_simo2d, dms_aran2d, dms_hall2d
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: iben_n2d, iben_fe2d, iben_c2d, iben_si2d, iben_ca2d, oben_n2d
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: oben_fe2d, oben_c2d, oben_si2d, oben_ca2d, sfr_ocal2d
+      REAL(wp), POINTER, DIMENSION(:,:  ) :: sfr_oarg2d, lyso_ca2d 
 # endif
       !! 2D var for diagnostics.
@@ -434,4 +437,10 @@
       ffastc(:,:)  = 0.0        !! organic carbon
       ffastca(:,:) = 0.0        !! biogenic calcium carbonate
+      !!
+      fsedn(:,:)   = 0.0        !! Seafloor flux of N 
+      fsedsi(:,:)  = 0.0        !! Seafloor flux of Si
+      fsedfe(:,:)  = 0.0        !! Seafloor flux of Fe
+      fsedc(:,:)   = 0.0        !! Seafloor flux of C
+      fsedca(:,:)  = 0.0        !! Seafloor flux of CaCO3
       !!
       fregenfast(:,:)   = 0.0   !! integrated  N regeneration (fast detritus)
@@ -522,5 +531,5 @@
       !! -----------------------------
       !! Juju :: add kt condition !!
-      IF( lk_iomput .AND. .NOT.  ln_diatrc ) THEN   
+      IF( lk_iomput .AND. .NOT.  ln_diatrc ) THEN 
       !!
       if ( kt == nittrc000 )   CALL trc_nam_iom_medusa !! initialise iom_use test
@@ -831,5 +840,59 @@
          CALL wrk_alloc( jpi, jpj,    f_o2sat2d   )
          f_o2sat2d(:,:)      = 0.0      !!
-      ENDIF   
+      ENDIF 
+      !!
+      IF( med_diag%IBEN_N%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    iben_n2d  )
+         iben_n2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%IBEN_FE%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,   iben_fe2d   )
+         iben_fe2d(:,:)      = 0.0     !!
+      ENDIF
+      IF( med_diag%IBEN_C%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,   iben_c2d   )
+         iben_c2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%IBEN_SI%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,   iben_si2d   )
+         iben_si2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%IBEN_CA%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,   iben_ca2d   )
+         iben_ca2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%OBEN_N%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    oben_n2d  )
+         oben_n2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%OBEN_FE%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    oben_fe2d  )
+         oben_fe2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%OBEN_C%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    oben_c2d  )
+         oben_c2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%OBEN_SI%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    oben_si2d  )
+         oben_si2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%OBEN_CA%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    oben_ca2d  )
+         oben_ca2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%SFR_OCAL%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    sfr_ocal2d  )
+         sfr_ocal2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%SFR_OARG%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    sfr_oarg2d  )
+         sfr_oarg2d(:,:)      = 0.0      !!
+      ENDIF
+      IF( med_diag%LYSO_CA%dgsave ) THEN
+         CALL wrk_alloc( jpi, jpj,    lyso_ca2d  )
+         lyso_ca2d(:,:)      = 0.0      !!
+      ENDIF
+      !!  
       IF (jdms .eq. 1) THEN
          IF( med_diag%DMS_SURF%dgsave ) THEN
@@ -1047,35 +1110,4 @@
                      f3_omarg(ji,jj,jk) = f_omarg(ji,jj)
                      !!
-                     !! store 2D outputs
-                     IF ( lk_iomput .and.(jk.eq.1) ) THEN
-                        IF( med_diag%ATM_PCO2%dgsave ) THEN
-                            f_pco2a2d(ji,jj) = f_pco2a
-                        ENDIF
-                        IF( med_diag%OCN_PCO2%dgsave ) THEN
-                            f_pco2w2d(ji,jj) = f_pco2w
-                        ENDIF
-                        IF( med_diag%CO2FLUX%dgsave ) THEN
-                            f_co2flux2d(ji,jj) = f_co2flux
-                        ENDIF
-                        IF( med_diag%TCO2%dgsave ) THEN
-                             f_TDIC2d(ji,jj) = f_TDIC 
-                        ENDIF
-                        IF( med_diag%TALK%dgsave ) THEN
-                             f_TALK2d(ji,jj) = f_TALK 
-                        ENDIF
-                        IF( med_diag%KW660%dgsave ) THEN
-                             f_kw6602d(ji,jj) = f_kw660 
-                        ENDIF
-                        IF( med_diag%ATM_PP0%dgsave ) THEN
-                            f_pp02d(ji,jj) = f_pp0 
-                        ENDIF
-                        IF( med_diag%O2FLUX%dgsave ) THEN
-                             f_o2flux2d(ji,jj) = f_o2flux 
-                        ENDIF
-                        IF( med_diag%O2SAT%dgsave ) THEN
-                             f_o2sat2d(ji,jj) = f_o2sat 
-                        ENDIF                     
-                     ENDIF                     
-                     !!
                      !! CCD calculation: calcite
                      if (i2_omcal(ji,jj) .eq. 0 .and. f_omcal(ji,jj) .lt. 1.0) then
@@ -1314,6 +1346,6 @@
                   ENDIF
 # endif
-              ENDIF
-              
+               ENDIF
+
                CALL flush(numout)
 
@@ -1506,8 +1538,44 @@
                          dms_hall2d(ji,jj) = dms_hall
                        ENDIF
+#   if defined key_debug_medusa
+                       IF (lwp) write (numout,*) 'trc_bio_medusa: finnish calculating dms'
+                     CALL flush(numout)
+#   endif 
                      ENDIF
                      !! End iom
                   ENDIF
                   !! End DMS Loop
+                  !!
+                  !! store 2D outputs
+                  IF ( lk_iomput ) THEN
+                      IF( med_diag%ATM_PCO2%dgsave ) THEN
+                         f_pco2a2d(ji,jj) = f_pco2a
+                      ENDIF
+                      IF( med_diag%OCN_PCO2%dgsave ) THEN
+                         f_pco2w2d(ji,jj) = f_pco2w
+                      ENDIF
+                      IF( med_diag%CO2FLUX%dgsave ) THEN
+                         f_co2flux2d(ji,jj) = f_co2flux
+                      ENDIF
+                      IF( med_diag%TCO2%dgsave ) THEN
+                         f_TDIC2d(ji,jj) = f_TDIC
+                      ENDIF
+                      IF( med_diag%TALK%dgsave ) THEN
+                         f_TALK2d(ji,jj) = f_TALK
+                      ENDIF
+                      IF( med_diag%KW660%dgsave ) THEN
+                         f_kw6602d(ji,jj) = f_kw660
+                      ENDIF
+                      IF( med_diag%ATM_PP0%dgsave ) THEN
+                         f_pp02d(ji,jj) = f_pp0
+                      ENDIF
+                      IF( med_diag%O2FLUX%dgsave ) THEN
+                         f_o2flux2d(ji,jj) = f_o2flux
+                      ENDIF
+                      IF( med_diag%O2SAT%dgsave ) THEN
+                         f_o2sat2d(ji,jj) = f_o2sat
+                      ENDIF
+                  ENDIF
+                  !! 
                endif
                !! End jk = 1 loop within ROAM key 
@@ -3443,4 +3511,11 @@
                endif               
 
+#   if defined key_debug_medusa
+               IF (lwp) write (numout,*) '------'
+               IF (lwp) write (numout,*) 'trc_bio_medusa: end all calculations'
+               IF (lwp) write (numout,*) 'trc_bio_medusa: now outputs'
+                     CALL flush(numout)
+#   endif
+
 # if defined key_axy_nancheck
                !!----------------------------------------------------------------------
@@ -3525,4 +3600,8 @@
          !!
          !! ** 2D diagnostics
+#   if defined key_debug_medusa
+                     IF (lwp) write (numout,*) 'trc_bio_medusa: diag in ij-jj-jk loop'
+                     CALL flush(numout)
+#   endif
                   IF ( med_diag%PRN%dgsave ) THEN
                       fprn2d(ji,jj) = fprn2d(ji,jj) + (fprn  * zphn * fthk) 
@@ -3675,7 +3754,47 @@
                          ffastca2d(ji,jj) =   &
                             ffastca(ji,jj)/MAX(ffastc(ji,jj), rsmall)
-                     ENDIF                     
+                     ENDIF
+                 ELSE IF (jk.eq.(mbathy(ji,jj)-1)) THEN
+                     IF( med_diag%IBEN_N%dgsave ) THEN
+                         iben_n2d(ji,jj) = f_sbenin_n(ji,jj)  + f_fbenin_n(ji,jj)
+                     ENDIF
+                     IF( med_diag%IBEN_FE%dgsave ) THEN
+                         iben_fe2d(ji,jj) = f_sbenin_fe(ji,jj) + f_fbenin_fe(ji,jj)
+                     ENDIF
+                     IF( med_diag%IBEN_C%dgsave ) THEN
+                         iben_c2d(ji,jj) = f_sbenin_c(ji,jj)  + f_fbenin_c(ji,jj)
+                     ENDIF
+                     IF( med_diag%IBEN_SI%dgsave ) THEN
+                         iben_si2d(ji,jj) = f_fbenin_si(ji,jj)
+                     ENDIF
+                     IF( med_diag%IBEN_CA%dgsave ) THEN
+                         iben_ca2d(ji,jj) = f_fbenin_ca(ji,jj)
+                     ENDIF
+                     IF( med_diag%OBEN_N%dgsave ) THEN
+                         oben_n2d(ji,jj) = f_benout_n(ji,jj)
+                     ENDIF
+                     IF( med_diag%OBEN_FE%dgsave ) THEN
+                         oben_fe2d(ji,jj) = f_benout_fe(ji,jj)
+                     ENDIF
+                     IF( med_diag%OBEN_C%dgsave ) THEN
+                         oben_c2d(ji,jj) = f_benout_c(ji,jj)
+                     ENDIF
+                     IF( med_diag%OBEN_SI%dgsave ) THEN
+                         oben_si2d(ji,jj) = f_benout_si(ji,jj)
+                     ENDIF
+                     IF( med_diag%OBEN_CA%dgsave ) THEN
+                         oben_ca2d(ji,jj) = f_benout_ca(ji,jj)
+                     ENDIF
+                     IF( med_diag%SFR_OCAL%dgsave ) THEN
+                         sfr_ocal2d(ji,jj) = f3_omcal(ji,jj,jk)
+                     ENDIF
+                     IF( med_diag%SFR_OARG%dgsave ) THEN
+                         sfr_oarg2d(ji,jj) =  f3_omarg(ji,jj,jk)
+                     ENDIF
+                     IF( med_diag%LYSO_CA%dgsave ) THEN
+                         lyso_ca2d(ji,jj) = f_benout_lyso_ca(ji,jj)
+                     ENDIF
                  ENDIF
-                !!
+                !! !! end bathy-1 diags
                 !!
                   IF( med_diag%RIV_N%dgsave ) THEN
@@ -3780,4 +3899,5 @@
                       !CALL iom_put( "TPP3"  , tpp3d )
                   ENDIF
+
                   IF( med_diag%REMIN3N%dgsave ) THEN
                       remin3dn(ji,jj,jk) = fregen + (freminn * fthk)  !! remineralisation
@@ -3786,5 +3906,5 @@
                   !! IF( med_diag%PH3%dgsave ) THEN
                   !!     CALL iom_put( "PH3"  , f3_pH )
-                  !!  ENDIF
+                  !! ENDIF
                   !! IF( med_diag%OM_CAL3%dgsave ) THEN
                   !!     CALL iom_put( "OM_CAL3"  , f3_omcal )
@@ -3794,4 +3914,8 @@
          !! ** Without using iom_use
                ELSE IF( ln_diatrc ) THEN
+#   if defined key_debug_medusa
+                  IF (lwp) write (numout,*) 'trc_bio_medusa: diag in ij-jj-jk ln_diatrc'
+                  CALL flush(numout)
+#   endif
                   !!----------------------------------------------------------------------
                   !! Prepare 2D diagnostics
@@ -4155,4 +4279,8 @@
                  !!-----------------------------------------
                  IF (jk.eq.1) THEN
+#   if defined key_debug_medusa
+                     IF (lwp) write (numout,*) 'trc_bio_medusa: diag jk = 1'
+                     CALL flush(numout)
+#   endif
                      IF( med_diag%MED_QSR%dgsave ) THEN
                          CALL iom_put( "MED_QSR"  , qsr ) !
@@ -4262,4 +4390,8 @@
 # endif                     
                  ELSE IF (jk.eq.i0100) THEN 
+#   if defined key_debug_medusa
+                     IF (lwp) write (numout,*) 'trc_bio_medusa: diag jk = 100'
+                     CALL flush(numout)
+#   endif
                      IF( med_diag%SDT__100%dgsave ) THEN
                          CALL iom_put( "SDT__100"  , fslownflux )
@@ -4291,4 +4423,8 @@
                      ENDIF                  
                  ELSE IF (jk.eq.i0150) THEN
+#   if defined key_debug_medusa
+                     IF (lwp) write (numout,*) 'trc_bio_medusa: diag jk = 150'
+                     CALL flush(numout)
+#   endif
                      IF( med_diag%BASIN_01%dgsave ) THEN
                          CALL iom_put( "BASIN_01"  , fprn2d )
@@ -4428,4 +4564,8 @@
 # endif                     
                  ELSE IF (jk.eq.i0200) THEN
+#   if defined key_debug_medusa
+                     IF (lwp) write (numout,*) 'trc_bio_medusa: diag jk = 200'
+                     CALL flush(numout)
+#   endif
                      IF( med_diag%SDT__200%dgsave ) THEN
                          CALL iom_put( "SDT__200"  , fslownflux )
@@ -4455,4 +4595,8 @@
 # endif                     
                  ELSE IF (jk.eq.i0500) THEN
+#   if defined key_debug_medusa
+                     IF (lwp) write (numout,*) 'trc_bio_medusa: diag jk = 500'
+                     CALL flush(numout)
+#   endif
                      IF( med_diag%SDT__500%dgsave ) THEN
                          CALL iom_put( "SDT__500"  , fregen2d )
@@ -4485,4 +4629,8 @@
 # endif                      
                  ELSE IF (jk.eq.i1000) THEN
+#   if defined key_debug_medusa
+                     IF (lwp) write (numout,*) 'trc_bio_medusa: diag jk = 1000'
+                     CALL flush(numout)
+#   endif
                      IF( med_diag%SDT_1000%dgsave ) THEN
                          CALL iom_put( "SDT_1000"  , fslownflux )
@@ -4515,66 +4663,4 @@
                      ENDIF 
 # endif                      
-                 ELSE IF (jk.eq.(mbathy(ji,jj)-1)) THEN
-                     IF( med_diag%SEAFLRN%dgsave ) THEN
-                         CALL iom_put( "SEAFLRN"  , fsedn )
-                     ENDIF
-                     IF( med_diag%SEAFLRSI%dgsave ) THEN
-                         CALL iom_put( "SEAFLRSI"  , fsedsi )
-                     ENDIF
-                     IF( med_diag%SEAFLRFE%dgsave ) THEN
-                         CALL iom_put( "SEAFLRFE"  , fsedfe )
-                     ENDIF
-                     IF( med_diag%SEAFLRC%dgsave ) THEN
-                         CALL iom_put( "SEAFLRC"  , fsedc )
-                     ENDIF
-                     IF( med_diag%SEAFLRCA%dgsave ) THEN
-                         CALL iom_put( "SEAFLRCA"  , fsedca )
-                     ENDIF
-# if defined key_roam                     
-                     IF( med_diag%IBEN_N%dgsave ) THEN
-                         zw2d(:,:) = f_sbenin_n(:,:)  + f_fbenin_n(:,:) 
-                         CALL iom_put( "IBEN_N"  , zw2d )
-                     ENDIF
-                     IF( med_diag%IBEN_FE%dgsave ) THEN
-                         zw2d(:,:) = f_sbenin_fe(:,:) + f_fbenin_fe(:,:)
-                         CALL iom_put( "IBEN_FE"  , zw2d )
-                     ENDIF
-                     IF( med_diag%IBEN_C%dgsave ) THEN
-                         zw2d(:,:) = f_sbenin_c(:,:)  + f_fbenin_c(:,:)
-                         CALL iom_put( "IBEN_C"  , zw2d )
-                     ENDIF
-                     IF( med_diag%IBEN_SI%dgsave ) THEN
-                         CALL iom_put( "IBEN_SI"  , f_fbenin_si )
-                     ENDIF
-                     IF( med_diag%IBEN_CA%dgsave ) THEN
-                         CALL iom_put( "IBEN_CA"  , f_fbenin_ca )
-                     ENDIF
-                     IF( med_diag%OBEN_N%dgsave ) THEN
-                         CALL iom_put( "OBEN_N"  , f_benout_n )
-                     ENDIF
-                     IF( med_diag%OBEN_FE%dgsave ) THEN
-                         CALL iom_put( "OBEN_FE"  , f_benout_fe )
-                     ENDIF
-                     IF( med_diag%OBEN_C%dgsave ) THEN
-                         CALL iom_put( "OBEN_C"  , f_benout_c )
-                     ENDIF
-                     IF( med_diag%OBEN_SI%dgsave ) THEN
-                         CALL iom_put( "OBEN_SI"  , f_benout_si )
-                     ENDIF
-                     IF( med_diag%OBEN_CA%dgsave ) THEN
-                         CALL iom_put( "OBEN_CA"  , f_benout_ca )
-                     ENDIF
-                     IF( med_diag%SFR_OCAL%dgsave ) THEN
-                         zw2d(:,:) = f3_omcal(:,:,jk)
-                         CALL iom_put( "SFR_OCAL"  , zw2d )
-                     ENDIF
-                     IF( med_diag%SFR_OARG%dgsave ) THEN
-                         zw2d(:,:) =  f3_omarg(:,:,jk)
-                         CALL iom_put( "SFR_OARG"  , zw2d )
-                     ENDIF  
-                     IF( med_diag%LYSO_CA%dgsave ) THEN
-                         CALL iom_put( "LYSO_CA"  , f_benout_lyso_ca )
-                     ENDIF 
-# endif                     
                  ENDIF
                  !! to do on every k loop :
@@ -4930,4 +5016,8 @@
          !!
          !! ** 2D diagnostics
+#   if defined key_debug_medusa
+         IF (lwp) write (numout,*) 'trc_bio_medusa: export all diag.'
+         CALL flush(numout)
+#   endif
          IF ( med_diag%INVTN%dgsave ) THEN
              CALL iom_put( "INVTN"  , ftot_n )
@@ -5196,4 +5286,20 @@
              CALL wrk_dealloc( jpi, jpj,   freminca2d  )
         ENDIF
+        IF( med_diag%SEAFLRN%dgsave ) THEN
+            CALL iom_put( "SEAFLRN"  , fsedn )
+        ENDIF
+        IF( med_diag%SEAFLRSI%dgsave ) THEN
+            CALL iom_put( "SEAFLRSI"  , fsedsi )
+        ENDIF
+        IF( med_diag%SEAFLRFE%dgsave ) THEN
+            CALL iom_put( "SEAFLRFE"  , fsedfe )
+        ENDIF
+        IF( med_diag%SEAFLRC%dgsave ) THEN
+            CALL iom_put( "SEAFLRC"  , fsedc )
+        ENDIF
+        IF( med_diag%SEAFLRCA%dgsave ) THEN
+            CALL iom_put( "SEAFLRCA"  , fsedca )
+        ENDIF
+
         !!
         !!
@@ -5314,4 +5420,56 @@
             CALL iom_put( "GMEDC"  , gmedc2d )
              CALL wrk_dealloc( jpi, jpj,    gmedc2d  )
+        ENDIF
+        IF( med_diag%IBEN_N%dgsave ) THEN
+           CALL iom_put( "IBEN_N"  , iben_n2d )
+             CALL wrk_dealloc( jpi, jpj,    iben_n2d  )
+        ENDIF
+        IF( med_diag%IBEN_FE%dgsave ) THEN
+           CALL iom_put( "IBEN_FE"  , iben_fe2d )
+             CALL wrk_dealloc( jpi, jpj,   iben_fe2d   )
+        ENDIF
+        IF( med_diag%IBEN_C%dgsave ) THEN
+           CALL iom_put( "IBEN_C"  , iben_c2d )
+             CALL wrk_dealloc( jpi, jpj,   iben_c2d   )
+        ENDIF
+        IF( med_diag%IBEN_SI%dgsave ) THEN
+           CALL iom_put( "IBEN_SI"  , iben_si2d )
+             CALL wrk_dealloc( jpi, jpj,   iben_si2d   )
+        ENDIF
+        IF( med_diag%IBEN_CA%dgsave ) THEN
+           CALL iom_put( "IBEN_CA"  , iben_ca2d )
+             CALL wrk_dealloc( jpi, jpj,   iben_ca2d   )
+        ENDIF
+        IF( med_diag%OBEN_N%dgsave ) THEN
+           CALL iom_put( "OBEN_N"  , oben_n2d )
+             CALL wrk_dealloc( jpi, jpj,    oben_n2d  )
+        ENDIF
+        IF( med_diag%OBEN_FE%dgsave ) THEN
+           CALL iom_put( "OBEN_FE"  , oben_fe2d )
+             CALL wrk_dealloc( jpi, jpj,    oben_fe2d  )
+        ENDIF
+        IF( med_diag%OBEN_C%dgsave ) THEN
+           CALL iom_put( "OBEN_C"  , oben_c2d )
+             CALL wrk_dealloc( jpi, jpj,    oben_c2d  )
+        ENDIF
+        IF( med_diag%OBEN_SI%dgsave ) THEN
+           CALL iom_put( "OBEN_SI"  , oben_si2d )
+             CALL wrk_dealloc( jpi, jpj,    oben_si2d  )
+        ENDIF
+        IF( med_diag%OBEN_CA%dgsave ) THEN
+           CALL iom_put( "OBEN_CA"  , oben_ca2d )
+             CALL wrk_dealloc( jpi, jpj, oben_ca2d     )
+        ENDIF
+        IF( med_diag%SFR_OCAL%dgsave ) THEN
+           CALL iom_put( "SFR_OCAL"  , sfr_ocal2d )
+             CALL wrk_dealloc( jpi, jpj,    sfr_ocal2d  )
+        ENDIF
+        IF( med_diag%SFR_OARG%dgsave ) THEN
+           CALL iom_put( "SFR_OARG"  , sfr_oarg2d )
+             CALL wrk_dealloc( jpi, jpj,    sfr_oarg2d  )
+        ENDIF
+        IF( med_diag%LYSO_CA%dgsave ) THEN
+           CALL iom_put( "LYSO_CA"  , lyso_ca2d )
+             CALL wrk_dealloc( jpi, jpj,    lyso_ca2d  )
         ENDIF
 # endif                   
