Index: branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90	(revision 7766)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90	(revision 7894)
@@ -12,4 +12,5 @@
    !!              -   !  2015-11  (J. Palmieri) added iom_use for diags
    !!              -   !  2016-11  (A. Yool) updated diags for CMIP6
+   !!              -   !  2017-03  (A. Yool) minor tidy
    !!----------------------------------------------------------------------
 #if defined key_medusa
@@ -67,5 +68,5 @@
       !
       NAMELIST/natbio/ xxi,xaln,xald,jphy,xvpn,xvpd,          &
-      &    xsin0,xnsi0,xuif,jliebig, jq10,                    &
+      &    xsin0,xnsi0,xuif,jliebig, xq10,                    &
       &    xthetam,xthetamd,xnln,xnld,xsld,xfln,xfld,         &
       &  xgmi,xgme,xkmi,xkme,xphi,xbetan,xbetac,xkc,          &
@@ -136,5 +137,6 @@
 # endif
 
-     IF( ( .NOT.lk_iomput .AND. ln_diatrc ) .OR. ( ln_diatrc .AND. lk_medusa ) ) THEN
+      !! AXY (06/04/17): can this next section be deleted? I think it can
+      IF( ( .NOT.lk_iomput .AND. ln_diatrc ) .OR. ( ln_diatrc .AND. lk_medusa ) ) THEN
          !
          ! Namelist nammeddia
@@ -221,280 +223,158 @@
       ! -------------------------------------------
       
-      xxi         = 0.
-      xaln        = 0.
-      xald        = 0.
-      jphy        = 0
-      xvpn        = 0.
-      xvpd        = 0.
-      xthetam     = 0.
-      xthetamd    = 0.
-!!
-      xsin0       = 0.
-      xnsi0       = 0.
-      xuif        = 0.
-!!
-      jliebig     = 0
-      jq10        = 0.
-      xnln        = 0.
-      xnld        = 0.
-      xsld        = 0.
-      xfln        = 0.
-      xfld        = 0.
-!!
-      xgmi        = 0.
-      xgme        = 0.
-      xkmi        = 0.
-      xkme        = 0.
-      xphi	  = 0.
-      xbetan      = 0.
-      xbetac      = 0.
-      xkc         = 0.
-      xpmipn      = 0.
-      xpmid       = 0.
-      xpmepn      = 0.
-      xpmepd      = 0.
-      xpmezmi     = 0.
-      xpmed       = 0.
-!!
-      xmetapn     = 0.
-      xmetapd     = 0.
-      xmetazmi    = 0.
-      xmetazme    = 0.
-!!
-      jmpn        = 0
-      xmpn        = 0.
-      xkphn       = 0.
-      jmpd        = 0
-      xmpd        = 0.
-      xkphd       = 0.
-      jmzmi       = 0
-      xmzmi       = 0.
-      xkzmi       = 0.
-      jmzme       = 0
-      xmzme       = 0.
-      xkzme       = 0.
-!!
-      jmd         = 0
-      jsfd        = 0
-      xmd         = 0.
-      xmdc        = 0.
-!!
-      xthetapn    = 0.
-      xthetapd    = 0.
-      xthetazmi   = 0.
-      xthetazme   = 0.
-      xthetad     = 0.
-      xrfn        = 0.
-      xrsn        = 0.  !: (NOT USED HERE; RETAINED FOR LOBSTER)
-!!
-      jiron       = 0
-      xfe_mass    = 0.
-      xfe_sol     = 0.
-      xfe_sed     = 0.
-      xLgT        = 0.
-      xk_FeL	  = 0.
-      xk_sc_Fe    = 0.
-!!
-      jexport     = 0
-      jfdfate     = 0
-      jrratio     = 0
-      jocalccd    = 0
-      xridg_r0    = 0.
-      xfdfrac1	  = 0.
-      xfdfrac2	  = 0.
-      xfdfrac3	  = 0.
-      xcaco3a	  = 0.
-      xcaco3b	  = 0.
-      xmassc	  = 0.
-      xmassca	  = 0.
-      xmasssi	  = 0.
-      xprotca	  = 0.
-      xprotsi	  = 0.
-      xfastc	  = 0.
-      xfastca	  = 0.
-      xfastsi	  = 0.
-!!
-      jorgben     = 0
-      jinorgben   = 0
-      xsedn       = 0.
-      xsedfe      = 0.
-      xsedsi      = 0.
-      xsedc       = 0.
-      xsedca      = 0.
-      xburial     = 0.
-!!
-      jriver_n    = 0
-      jriver_si   = 0
-      jriver_c    = 0
-      jriver_alk  = 0
-      jriver_dep  = 1
-!!
-      xsdiss	  = 0.
-!!
-      vsed        = 0.
-      xhr         = 0.
-!!
-      sedlam	  = 0.
-      sedlostpoc  = 0.
-      jpkb	  = 0.
-      jdms        = 0
-      jdms_input  = 0
-      jdms_model  = 0
+!! Primary production and chl related quantities
+      xxi         = 0.  !! conversion factor from gC to mmolN
+      xaln        = 0.  !! Chl-a specific initial slope of P-I curve for non-diatoms
+      xald        = 0.  !! Chl-a specific initial slope of P-I curve for diatoms
+      jphy        = 0   !! phytoplankton T-dependent growth switch
+      xvpn        = 0.  !! maximum growth rate for non-diatoms
+      xvpd        = 0.  !! maximum growth rate for diatoms
+      xthetam     = 0.  !! maximum Chl to C ratio for non-diatoms
+      xthetamd    = 0.  !! maximum Chl to C ratio for diatoms
+!!
+!! Diatom silicon parameters
+      xsin0       = 0.  !! minimum diatom Si:N ratio
+      xnsi0       = 0.  !! minimum diatom N:Si ratio
+      xuif        = 0.  !! hypothetical growth ratio at infinite Si:N ratio
+!!
+!! Nutrient limitation
+      jliebig     = 0   !! Liebig nutrient uptake switch
+      xq10        = 0.  !! specific Q10 value (if jphy = 2) 
+      xnln        = 0.  !! half-sat constant for DIN uptake by non-diatoms
+      xnld        = 0.  !! half-sat constant for DIN uptake by diatoms
+      xsld        = 0.  !! half-sat constant for  Si uptake by diatoms
+      xfln        = 0.  !! half-sat constant for  Fe uptake by non-datoms
+      xfld        = 0.  !! half-sat constant for  Fe uptake by diatoms
+!!
+!! Grazing
+      xgmi        = 0.  !! microzoo maximum growth rate
+      xgme        = 0.  !! mesozoo maximum growth rate
+      xkmi        = 0.  !! microzoo grazing half-sat parameter
+      xkme        = 0.  !! mesozoo grazing half-sat parameter
+      xphi	  = 0.  !! micro/mesozoo grazing inefficiency
+      xbetan      = 0.  !! micro/mesozoo N assimilation efficiency
+      xbetac      = 0.  !! micro/mesozoo C assimilation efficiency
+      xkc         = 0.  !! micro/mesozoo net C growth efficiency
+      xpmipn      = 0.  !! grazing preference of microzoo for non-diatoms
+      xpmid       = 0.  !! grazing preference of microzoo for diatoms
+      xpmepn      = 0.  !! grazing preference of mesozoo for non-diatoms
+      xpmepd      = 0.  !! grazing preference of mesozoo for diatoms
+      xpmezmi     = 0.  !! grazing preference of mesozoo for microzoo
+      xpmed       = 0.  !! grazing preference of mesozoo for detritus
+!!
+!! Metabolic losses
+      xmetapn     = 0.  !! non-diatom metabolic loss rate
+      xmetapd     = 0.  !! diatom     metabolic loss rate
+      xmetazmi    = 0.  !! microzoo   metabolic loss rate
+      xmetazme    = 0.  !! mesozoo    metabolic loss rate
+!!
+!! Mortality/Remineralisation
+      jmpn        = 0   !! non-diatom mortality functional form
+      xmpn        = 0.  !! non-diatom mortality rate
+      xkphn       = 0.  !! non-diatom mortality half-sat constant
+      jmpd        = 0   !! diatom     mortality functional form
+      xmpd        = 0.  !! diatom     mortality rate
+      xkphd       = 0.  !! diatom     mortality half-sat constant
+      jmzmi       = 0   !! microzoo   mortality functional form
+      xmzmi       = 0.  !! microzoo   mortality rate
+      xkzmi       = 0.  !! microzoo   mortality half-sat constant
+      jmzme       = 0   !! mesozoo    mortality functional form
+      xmzme       = 0.  !! mesozoo    mortality rate
+      xkzme       = 0.  !! mesozoo    mortality half-sat constant
+!!
+!! Remineralisation
+      jmd         = 0   !! detritus T-dependent remineralisation switch
+      jsfd        = 0   !! accelerate seafloor detritus remin. switch
+      xmd         = 0.  !! detrital nitrogen remineralisation rate
+      xmdc        = 0.  !! detrital carbon remineralisation rate
+!!
+!! Stochiometric ratios
+      xthetapn    = 0.  !! non-diatom C:N ratio
+      xthetapd    = 0.  !! diatom     C:N ratio
+      xthetazmi   = 0.  !! microzoo   C:N ratio
+      xthetazme   = 0.  !! mesozoo    C:N ratio
+      xthetad     = 0.  !! detritus   C:N ratio (MEDUSA-1 only)
+      xrfn        = 0.  !! phytoplankton Fe:N ratio
+      xrsn        = 0.  !! diatom Si:N ratio (NOT USED HERE; LOBSTER ARTIFACT)
+!!
+!! Iron parameters
+      jiron       = 0   !! iron scavenging submodel switch
+      xfe_mass    = 0.  !! iron atomic mass
+      xfe_sol     = 0.  !! aeolian iron solubility
+      xfe_sed     = 0.  !! sediment iron input
+      xLgT        = 0.  !! total ligand concentration (umol/m3)
+      xk_FeL	  = 0.  !! dissociation constant for (Fe + L)
+      xk_sc_Fe    = 0.  !! scavenging rate of "free" iron
+!!
+!! Fast-sinking detritus parameters
+      jexport     = 0   !! fast detritus remineralisation switch
+      jfdfate     = 0   !! fate of fast detritus at seafloor switch
+      jrratio     = 0   !! rain ratio switch
+      jocalccd    = 0   !! CCD switch
+      xridg_r0    = 0.  !! Ridgwell rain ratio coefficient
+      xfdfrac1	  = 0.  !! fast-sinking fraction of diatom nat. mort. losses
+      xfdfrac2	  = 0.  !! fast-sinking fraction of meszooplankton mort. losses
+      xfdfrac3	  = 0.  !! fast-sinking fraction of diatom silicon grazing losses
+      xcaco3a	  = 0.  !! polar (high latitude) CaCO3 fraction
+      xcaco3b	  = 0.  !! equatorial (low latitude) CaCO3 fraction
+      xmassc	  = 0.  !! organic C mass:mole ratio, C106 H175 O40 N16 P1
+      xmassca	  = 0.  !! calcium carbonate mass:mole ratio, CaCO3
+      xmasssi	  = 0.  !! biogenic silicon mass:mole ratio, (H2SiO3)n
+      xprotca	  = 0.  !! calcium carbonate protection ratio
+      xprotsi	  = 0.  !! biogenic silicon protection ratio
+      xfastc	  = 0.  !! organic C remineralisation length scale
+      xfastca	  = 0.  !! calcium carbonate dissolution length scale
+      xfastsi	  = 0.  !! biogenic silicon dissolution length scale
+!!
+!! Benthic
+      jorgben     = 0   !! does   organic detritus go to the benthos?
+      jinorgben   = 0   !! does inorganic detritus go to the benthos?
+      xsedn       = 0.  !! organic   nitrogen sediment remineralisation rate
+      xsedfe      = 0.  !! organic   iron     sediment remineralisation rate
+      xsedsi      = 0.  !! inorganic silicon  sediment dissolution      rate
+      xsedc       = 0.  !! organic   carbon   sediment remineralisation rate
+      xsedca      = 0.  !! inorganic carbon   sediment dissolution      rate
+      xburial     = 0.  !! burial rate of seafloor detritus
+!!
+!! Riverine inputs
+      jriver_n    = 0   !! riverine N          input?
+      jriver_si   = 0   !! riverine Si         input?
+      jriver_c    = 0   !! riverine C          input?
+      jriver_alk  = 0   !! riverine alkalinity input?
+      jriver_dep  = 1   !! depth of riverine   input?
+!!
+!! Miscellaneous
+      xsdiss	  = 0.  !! diatom frustule dissolution rate
+!!
+!! Gravitational sinking
+      vsed        = 0.  !! detritus gravitational sinking rate
+      xhr         = 0.  !! coeff for Martin's remineralisation profile (LOBSTER)
+!!
+!! Additional parameters
+      sedlam	  = 0.  !! time coeff of POC in sediments (LOBSTER)
+      sedlostpoc  = 0.  !! sediment geol loss for POC (LOBSTER)
+      jpkb	  = 0.  !! vertical layer for diagnostic of the vertical flux (LOBSTER)
+!!
+!! UKESM1 - new DMS parameters  !! Jpalm
+      jdms        = 0   !! include dms diagnostics
+      jdms_input  = 0   !! use instant (0) or diel-avg (1) inputs
+      jdms_model  = 0   !! choice of DMS model passed to atmosphere
+                        !! 1 = ANDR, 2 = SIMO, 3 = ARAN, 4 = HALL
             
       !REWIND(numnatm)
       !READ(numnatm,natbio)
-         ! Namelist natbio
-         ! -------------------
-         REWIND( numnatp_ref )              ! Namelist natbio in reference namelist : MEDUSA diagnostics
-         READ  ( numnatp_ref, natbio, IOSTAT = ios, ERR = 903)
-903      IF( ios /= 0 ) CALL ctl_nam ( ios , 'natbio in reference namelist', lwp )
-
-         REWIND( numnatp_cfg )              ! Namelist natbio in configuration namelist : MEDUSA diagnostics
-         READ  ( numnatp_cfg, natbio, IOSTAT = ios, ERR = 904 )
-904      IF( ios /= 0 ) CALL ctl_nam ( ios , 'natbio in configuration namelist', lwp )
-         IF(lwm) WRITE ( numonp, natbio )
-
-!! Primary production and chl related quantities
-!!       xxi         :  conversion factor from gC to mmolN 
-!!       xaln        :  Chl-a specific initial slope of P-I curve for non-diatoms 
-!!       xald        :  Chl-a specific initial slope of P-I curve for diatoms
-!!       jphy        :  phytoplankton T-dependent growth switch
-!!       xvpn        :  maximum growth rate for non-diatoms
-!!       xvpd        :  maximum growth rate for diatoms
-!!       xthetam     :  maximum Chl to C ratio for non-diatoms      
-!!       xthetamd    :  maximum Chl to C ratio for diatoms      
-!!
-!! Diatom silicon parameters
-!!       xsin0       :  minimum diatom Si:N ratio
-!!       xnsi0       :  minimum diatom N:Si ratio
-!!       xuif        :  hypothetical growth ratio at infinite Si:N ratio
-!!
-!! Nutrient limitation
-!!       jliebig     :  Liebig nutrient uptake switch
-!!       xnln        :  half-sat constant for DIN uptake by non-diatoms 
-!!       xnld        :  half-sat constant for DIN uptake by diatoms 
-!!       xsl         :  half-sat constant for Si uptake by diatoms 
-!!       xfld        :  half-sat constant for Fe uptake by diatoms  
-!!       xfln        :  half-sat constant for Fe uptake by non-datoms 
-!!
-!! Grazing
-!!       xgmi        :  microzoo maximum growth rate 
-!!       xgme        :  mesozoo maximum growth rate 
-!!       xkmi        :  microzoo grazing half-sat parameter
-!!       xkme        :  mesozoo grazing half-sat parameter
-!!       xphi        :  micro/mesozoo grazing inefficiency
-!!       xbetan      :  micro/mesozoo N assimilation efficiency
-!!       xbetac      :  micro/mesozoo C assimilation efficiency
-!!       xkc         :  micro/mesozoo net C growth efficiency
-!!       xpmipn      :  grazing preference of microzoo for non-diatoms
-!!       xpmid       :  grazing preference of microzoo for diatoms
-!!       xpmepn      :  grazing preference of mesozoo for non-diatoms 
-!!       xpmepd      :  grazing preference of mesozoo for diatoms
-!!       xpmezmi     :  grazing preference of mesozoo for microzoo
-!!       xpmed       :  grazing preference of mesozoo for detritus
-!!
-!! Metabolic losses
-!!       xmetapn     :  non-diatom metabolic loss rate
-!!       xmetapd     :  diatom     metabolic loss rate
-!!       xmetazmi    :  microzoo   metabolic loss rate
-!!       xmetazme    :  mesozoo    metabolic loss rate
-!!
-!! Mortality/Remineralisation
-!!       jmpn        :  non-diatom mortality functional form
-!!       xmpn        :  non-diatom mortality rate
-!!       xkphn       :  non-diatom mortality half-sat constant
-!!       jmpd        :  diatom     mortality functional form
-!!       xmpd        :  diatom mortality rate
-!!       xkphd       :  diatom mortality half-sat constant
-!!       jmzmi       :  microzoo   mortality functional form
-!!       xmzmi       :  microzoo mortality rate
-!!       xkzmi       :  microzoo mortality half-sat constant
-!!       jmzme       :  mesozoo    mortality functional form
-!!       xmzme       :  mesozoo mortality rate
-!!       xkzme       :  mesozoo mortality half-sat constant
-!!
-!! Remineralisation
-!!       jmd         :  detritus T-dependent remineralisation switch
-!!       jsfd        :  accelerate seafloor detritus remin. switch
-!!       xmd         :  detrital nitrogen remineralisation rate 
-!!       xmdc        :  detrital carbon remineralisation rate 
-!!
-!! Stochiometric ratios
-!!       xthetapn    :  non-diatom C:N ratio
-!!       xthetapd    :  diatom C:N ratio
-!!       xthetazmi   :  microzoo C:N ratio
-!!       xthetazme   :  mesozoo C:N ratio
-!!       xthetad     :  detritus C:N ratio
-!!       xrfn        :  phytoplankton Fe:N ratio
-!!	 xrsn        :  diatom Si:N ratio (*NOT* used)
-!!
-!! Iron parameters
-!!       jiron       :  iron scavenging submodel switch
-!!       xfe_mass    :  iron atomic mass
-!!	 xfe_sol     :  aeolian iron solubility
-!!	 xfe_sed     :  sediment iron input
-!!	 xLgT	     :  total ligand concentration (umol/m3)
-!!	 xk_FeL	     :  dissociation constant for (Fe + L)
-!!	 xk_sc_Fe    :  scavenging rate of "free" iron
-!!	 
-!! Fast-sinking detritus parameters
-!!       jexport     :  fast detritus remineralisation switch
-!!       jfdfate     :  fate of fast detritus at seafloor switch
-!!       jrratio     :  rain ratio switch
-!!       jocalccd    :  CCD switch
-!!       xridg_r0    :  Ridgwell rain ratio coefficient
-!!       xfdfrac1    :  fast-sinking fraction of diatom nat. mort. losses
-!!       xfdfrac2    :  fast-sinking fraction of meszooplankton mort. losses
-!!       xfdfrac3    :  fast-sinking fraction of diatom silicon grazing losses
-!!       xcaco3a     :  polar (high latitude) CaCO3 fraction
-!!       xcaco3b     :  equatorial (low latitude) CaCO3 fraction
-!!       xmassc      :  organic C mass:mole ratio, C106 H175 O40 N16 P1
-!!       xmassca     :  calcium carbonate mass:mole ratio, CaCO3
-!!       xmasssi     :  biogenic silicon mass:mole ratio, (H2SiO3)n
-!!       xprotca     :  calcium carbonate protection ratio
-!!       xprotsi     :  biogenic silicon protection ratio
-!!       xfastc      :  organic C remineralisation length scale
-!!       xfastca     :  calcium carbonate dissolution length scale
-!!       xfastsi     :  biogenic silicon dissolution length scale
-!!
-!! Benthic 
-!!       jorgben     :  does   organic detritus go to the benthos?
-!!       jinorgben   :  does inorganic detritus go to the benthos?
-!!       xsedn       :  organic   nitrogen sediment remineralisation rate 
-!!       xsedfe      :  organic   iron     sediment remineralisation rate 
-!!       xsedsi      :  inorganic silicon  sediment dissolution      rate 
-!!       xsedc       :  organic   carbon   sediment remineralisation rate 
-!!       xsedca      :  inorganic carbon   sediment dissolution      rate 
-!!       xburial     :  burial rate of seafloor detritus
-!!
-!! Riverine inputs
-!!       jriver_n    :  riverine N          input?
-!!       jriver_si   :  riverine Si         input?
-!!       jriver_c    :  riverine C          input?
-!!       jriver_alk  :  riverine alkalinity input?
-!!       jriver_dep  :  depth of riverine   input?
-!!
-!! Miscellaneous
-!!       xsdiss      :  diatom frustule dissolution rate
-!!
-!! Gravitational sinking      
-!!       vsed        :  detritus gravitational sinking rate 
-!!       xhr         :  coeff for Martin's remineralisation profile
-!!
-!! Additional parameters
-!!       sedlam      :  time coeff of POC in sediments
-!!      sedlostpoc   :  sediment geol loss for POC
-!!       jpkb        :  vertical layer for diagnostic of the vertical flux 
-!!                      NOTE that in LOBSTER it is a first vertical layers where 
-!!                      biology is active  
-!!
-!! UKESM1 - new diagnostics  !! Jpalm
-!!       jdms        :  include dms diagnostics
-!!	 jdms_input  :  use instant (0) or diel-avg (1) inputs
-!!       jdms_model  :  choice of DMS model passed to atmosphere
-!!                      1 = ANDR, 2 = SIMO, 3 = ARAN, 4 = HALL
-!!
+      ! Namelist natbio
+      ! -------------------
+      REWIND( numnatp_ref )     ! Namelist natbio in reference namelist : MEDUSA diagnostics
+      READ  ( numnatp_ref, natbio, IOSTAT = ios, ERR = 903)
+ 903  IF( ios /= 0 ) CALL ctl_nam ( ios , 'natbio in reference namelist', lwp )
+
+      REWIND( numnatp_cfg )     ! Namelist natbio in configuration namelist : MEDUSA diagnostics
+      READ  ( numnatp_cfg, natbio, IOSTAT = ios, ERR = 904 )
+ 904  IF( ios /= 0 ) CALL ctl_nam ( ios , 'natbio in configuration namelist', lwp )
+      IF(lwm) WRITE ( numonp, natbio )
+
       IF(lwp) THEN
-!!
+
 !! AXY (08/11/13): compilation key notification
          WRITE(numout,*) '=== Compilation keys'
@@ -512,11 +392,4 @@
          WRITE(numout,*)     &
          &   ' key_axy_carbchem                                                       = INACTIVE'
-#endif        
-#if defined key_mocsy
-         WRITE(numout,*)     &
-         &   ' key_mocsy                                                              = ACTIVE'
-#else
-         WRITE(numout,*)     &
-         &   ' key_mocsy                                                              = INACTIVE'
 #endif        
 #if defined key_avgqsr_medusa
@@ -601,5 +474,5 @@
          &   ' maximum Chl to C ratio for diatoms,                        xthetamd    = ', xthetamd
          WRITE(numout,*)     &
-         &   ' specific Q10 value (jphy==2),                                  jq10    = ', jq10
+         &   ' specific Q10 value (jphy==2),                                  xq10    = ', xq10
 !!
 !! Diatom silicon parameters
@@ -791,13 +664,4 @@
             WRITE(numout,*)     &
             &   ' Dutkiewicz et al. (2005) iron scavenging                   jiron       = ', jiron
-         elseif (jiron.eq.2) then
-            WRITE(numout,*)     &
-            &   ' Moore et al. (2004) iron scavenging                        jiron       = ', jiron
-         elseif (jiron.eq.3) then
-            WRITE(numout,*)     &
-            &   ' Moore et al. (2008) iron scavenging                        jiron       = ', jiron
-         elseif (jiron.eq.4) then
-            WRITE(numout,*)     &
-            &   ' Galbraith et al. (2010) iron scavenging                    jiron       = ', jiron
          else
             WRITE(numout,*)     &
@@ -1004,5 +868,5 @@
 !!
 !! UKESM1 - new diagnostics  !! Jpalm; AXY (08/07/15)
-         WRITE(numout,*) '=== UKESM1-related parameters'
+         WRITE(numout,*) '=== UKESM1 DMS parameters'
          WRITE(numout,*)     &
          &   ' include DMS diagnostic?,                                   jdms        = ', jdms
@@ -1084,14 +948,14 @@
 
       !READ(numnatm,natroam)
-         ! Namelist natroam
-         ! -------------------
-         REWIND( numnatp_ref )              ! Namelist natroam in reference namelist : MEDUSA diagnostics
-         READ  ( numnatp_ref, natroam, IOSTAT = ios, ERR = 905)
-905      IF( ios /= 0 ) CALL ctl_nam ( ios , 'natroam in reference namelist', lwp )
-
-         REWIND( numnatp_cfg )              ! Namelist natroam in configuration namelist : MEDUSA diagnostics
-         READ  ( numnatp_cfg, natroam, IOSTAT = ios, ERR = 906 )
-906      IF( ios /= 0 ) CALL ctl_nam ( ios , 'natroam in configuration namelist', lwp )
-         IF(lwm) WRITE ( numonp, natroam )
+      ! Namelist natroam
+      ! -------------------
+      REWIND( numnatp_ref )     ! Namelist natroam in reference namelist : MEDUSA diagnostics
+      READ  ( numnatp_ref, natroam, IOSTAT = ios, ERR = 905)
+ 905  IF( ios /= 0 ) CALL ctl_nam ( ios , 'natroam in reference namelist', lwp )
+
+      REWIND( numnatp_cfg )     ! Namelist natroam in configuration namelist : MEDUSA diagnostics
+      READ  ( numnatp_cfg, natroam, IOSTAT = ios, ERR = 906 )
+ 906  IF( ios /= 0 ) CALL ctl_nam ( ios , 'natroam in configuration namelist', lwp )
+      IF(lwm) WRITE ( numonp, natroam )
 
 !! ROAM carbon, alkalinity and oxygen cycle parameters
@@ -1101,10 +965,7 @@
 !!       xthetarem :  oxygen consumption by carbon remineralisation
 !!       xo2min    :  oxygen minimum concentration
-
       IF(lwp) THEN
           WRITE(numout,*) 'natroam'
           WRITE(numout,*) ' '
-!!
-!! ROAM carbon, alkalinity and oxygen cycle parameters
           WRITE(numout,*) '=== ROAM carbon, alkalinity and oxygen cycle parameters'
           WRITE(numout,*)     &
@@ -1136,14 +997,14 @@
 
       !READ(numnatm,natopt)
-         ! Namelist natopt
-         ! -------------------
-         REWIND( numnatp_ref )              ! Namelist natopt in reference namelist : MEDUSA diagnostics
-         READ  ( numnatp_ref, natopt, IOSTAT = ios, ERR = 907)
-907      IF( ios /= 0 ) CALL ctl_nam ( ios , 'natopt in reference namelist', lwp )
-
-         REWIND( numnatp_cfg )              ! Namelist natopt in configuration namelist : MEDUSA diagnostics
-         READ  ( numnatp_cfg, natopt, IOSTAT = ios, ERR = 908 )
-908      IF( ios /= 0 ) CALL ctl_nam ( ios , 'natopt in configuration namelist', lwp )
-         IF(lwm) WRITE ( numonp, natopt )
+      ! Namelist natopt
+      ! -------------------
+      REWIND( numnatp_ref )     ! Namelist natopt in reference namelist : MEDUSA diagnostics
+      READ  ( numnatp_ref, natopt, IOSTAT = ios, ERR = 907)
+ 907  IF( ios /= 0 ) CALL ctl_nam ( ios , 'natopt in reference namelist', lwp )
+      
+      REWIND( numnatp_cfg )     ! Namelist natopt in configuration namelist : MEDUSA diagnostics
+      READ  ( numnatp_cfg, natopt, IOSTAT = ios, ERR = 908 )
+ 908  IF( ios /= 0 ) CALL ctl_nam ( ios , 'natopt in configuration namelist', lwp )
+      IF(lwm) WRITE ( numonp, natopt )
 
       IF(lwp) THEN
@@ -1158,5 +1019,4 @@
          WRITE(numout,*) ' chla/chla+phea ratio            rpig  = ',rpig
          WRITE(numout,*) ' '
-
       ENDIF
 
@@ -1174,5 +1034,5 @@
          endif
          WRITE(numout,*) ' '
-       ENDIF
+      ENDIF
 
    END SUBROUTINE trc_nam_medusa
@@ -1190,5 +1050,4 @@
       !!---------------------------------------------------------------------
       !!
-      !!
       !!----------------------------------------------------------------------            
       !! Variable conventions
@@ -1196,973 +1055,974 @@
       !!
       IF (iom_use("INVTN")) THEN 
-          med_diag%INVTN%dgsave = .TRUE.
-      ELSE 
-          med_diag%INVTN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INVTSI")) THEN 
-          med_diag%INVTSI%dgsave = .TRUE.
-      ELSE 
-          med_diag%INVTSI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INVTFE")) THEN 
-          med_diag%INVTFE%dgsave = .TRUE.
-      ELSE 
-          med_diag%INVTFE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PRN")) THEN 
-          med_diag%PRN%dgsave = .TRUE.
-      ELSE 
-          med_diag%PRN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MPN")) THEN 
-          med_diag%MPN%dgsave = .TRUE.
-      ELSE 
-          med_diag%MPN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PRD")) THEN 
-          med_diag%PRD%dgsave = .TRUE.
-      ELSE 
-          med_diag%PRD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MPD")) THEN 
-          med_diag%MPD%dgsave = .TRUE.
-      ELSE 
-          med_diag%MPD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DSED")) THEN 
-          med_diag%DSED%dgsave = .TRUE.
-      ELSE 
-          med_diag%DSED%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OPAL")) THEN 
-          med_diag%OPAL%dgsave = .TRUE.
-      ELSE 
-          med_diag%OPAL%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OPALDISS")) THEN 
-          med_diag%OPALDISS%dgsave = .TRUE.
-      ELSE 
-          med_diag%OPALDISS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMIPn")) THEN 
-          med_diag%GMIPn%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMIPn%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMID")) THEN 
-          med_diag%GMID%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMID%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MZMI")) THEN 
-          med_diag%MZMI%dgsave = .TRUE.
-      ELSE 
-          med_diag%MZMI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMEPN")) THEN 
-          med_diag%GMEPN%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMEPN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMEPD")) THEN 
-          med_diag%GMEPD%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMEPD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMEZMI")) THEN 
-          med_diag%GMEZMI%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMEZMI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMED")) THEN 
-          med_diag%GMED%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMED%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MZME")) THEN 
-          med_diag%MZME%dgsave = .TRUE.
-      ELSE 
-          med_diag%MZME%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DEXP")) THEN 
-          med_diag%DEXP%dgsave = .TRUE.
-      ELSE 
-          med_diag%DEXP%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DETN")) THEN 
-          med_diag%DETN%dgsave = .TRUE.
-      ELSE 
-          med_diag%DETN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MDET")) THEN 
-          med_diag%MDET%dgsave = .TRUE.
-      ELSE 
-          med_diag%MDET%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("AEOLIAN")) THEN 
-          med_diag%AEOLIAN%dgsave = .TRUE.
-      ELSE 
-          med_diag%AEOLIAN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BENTHIC")) THEN 
-          med_diag%BENTHIC%dgsave = .TRUE.
-      ELSE 
-          med_diag%BENTHIC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SCAVENGE")) THEN 
-          med_diag%SCAVENGE%dgsave = .TRUE.
-      ELSE 
-          med_diag%SCAVENGE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PN_JLIM")) THEN 
-          med_diag%PN_JLIM%dgsave = .TRUE.
-      ELSE 
-          med_diag%PN_JLIM%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PN_NLIM")) THEN 
-          med_diag%PN_NLIM%dgsave = .TRUE.
-      ELSE 
-          med_diag%PN_NLIM%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PN_FELIM")) THEN 
-          med_diag%PN_FELIM%dgsave = .TRUE.
-      ELSE 
-          med_diag%PN_FELIM%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PD_JLIM")) THEN 
-          med_diag%PD_JLIM%dgsave = .TRUE.
-      ELSE 
-          med_diag%PD_JLIM%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PD_NLIM")) THEN 
-          med_diag%PD_NLIM%dgsave = .TRUE.
-      ELSE 
-          med_diag%PD_NLIM%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PD_FELIM")) THEN 
-          med_diag%PD_FELIM%dgsave = .TRUE.
-      ELSE 
-          med_diag%PD_FELIM%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PD_SILIM")) THEN 
-          med_diag%PD_SILIM%dgsave = .TRUE.
-      ELSE 
-          med_diag%PD_SILIM%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PDSILIM2")) THEN 
-          med_diag%PDSILIM2%dgsave = .TRUE.
-      ELSE 
-          med_diag%PDSILIM2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDT__100")) THEN 
-          med_diag%SDT__100%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDT__100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDT__200")) THEN 
-          med_diag%SDT__200%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDT__200%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDT__500")) THEN 
-          med_diag%SDT__500%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDT__500%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDT_1000")) THEN 
-          med_diag%SDT_1000%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDT_1000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("TOTREG_N")) THEN 
-          med_diag%TOTREG_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%TOTREG_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("TOTRG_SI")) THEN 
-          med_diag%TOTRG_SI%dgsave = .TRUE.
-      ELSE 
-          med_diag%TOTRG_SI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REG__100")) THEN 
-          med_diag%REG__100%dgsave = .TRUE.
-      ELSE 
-          med_diag%REG__100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REG__200")) THEN 
-          med_diag%REG__200%dgsave = .TRUE.
-      ELSE 
-          med_diag%REG__200%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REG__500")) THEN 
-          med_diag%REG__500%dgsave = .TRUE.
-      ELSE 
-          med_diag%REG__500%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REG_1000")) THEN 
-          med_diag%REG_1000%dgsave = .TRUE.
-      ELSE 
-          med_diag%REG_1000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FASTN")) THEN 
-          med_diag%FASTN%dgsave = .TRUE.
-      ELSE 
-          med_diag%FASTN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FASTSI")) THEN 
-          med_diag%FASTSI%dgsave = .TRUE.
-      ELSE 
-          med_diag%FASTSI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FASTFE")) THEN 
-          med_diag%FASTFE%dgsave = .TRUE.
-      ELSE 
-          med_diag%FASTFE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FASTC")) THEN 
-          med_diag%FASTC%dgsave = .TRUE.
-      ELSE 
-          med_diag%FASTC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FASTCA")) THEN 
-          med_diag%FASTCA%dgsave = .TRUE.
-      ELSE 
-          med_diag%FASTCA%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDT__100")) THEN 
-          med_diag%FDT__100%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDT__100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDT__200")) THEN 
-          med_diag%FDT__200%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDT__200%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDT__500")) THEN 
-          med_diag%FDT__500%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDT__500%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDT_1000")) THEN 
-          med_diag%FDT_1000%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDT_1000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RG__100F")) THEN 
-          med_diag%RG__100F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RG__100F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RG__200F")) THEN 
-          med_diag%RG__200F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RG__200F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RG__500F")) THEN 
-          med_diag%RG__500F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RG__500F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RG_1000F")) THEN 
-          med_diag%RG_1000F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RG_1000F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDS__100")) THEN 
-          med_diag%FDS__100%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDS__100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDS__200")) THEN 
-          med_diag%FDS__200%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDS__200%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDS__500")) THEN 
-          med_diag%FDS__500%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDS__500%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FDS_1000")) THEN 
-          med_diag%FDS_1000%dgsave = .TRUE.
-      ELSE 
-          med_diag%FDS_1000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RGS_100F")) THEN 
-          med_diag%RGS_100F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RGS_100F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RGS_200F")) THEN 
-          med_diag%RGS_200F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RGS_200F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RGS_500F")) THEN 
-          med_diag%RGS_500F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RGS_500F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RGS1000F")) THEN 
-          med_diag%RGS1000F%dgsave = .TRUE.
-      ELSE 
-          med_diag%RGS1000F%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REMINN")) THEN 
-          med_diag%REMINN%dgsave = .TRUE.
-      ELSE 
-          med_diag%REMINN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REMINSI")) THEN 
-          med_diag%REMINSI%dgsave = .TRUE.
-      ELSE 
-          med_diag%REMINSI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REMINFE")) THEN 
-          med_diag%REMINFE%dgsave = .TRUE.
-      ELSE 
-          med_diag%REMINFE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REMINC")) THEN 
-          med_diag%REMINC%dgsave = .TRUE.
-      ELSE 
-          med_diag%REMINC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REMINCA")) THEN 
-          med_diag%REMINCA%dgsave = .TRUE.
-      ELSE 
-          med_diag%REMINCA%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SEAFLRN")) THEN 
-          med_diag%SEAFLRN%dgsave = .TRUE.
-      ELSE 
-          med_diag%SEAFLRN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SEAFLRSI")) THEN 
-          med_diag%SEAFLRSI%dgsave = .TRUE.
-      ELSE 
-          med_diag%SEAFLRSI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SEAFLRFE")) THEN 
-          med_diag%SEAFLRFE%dgsave = .TRUE.
-      ELSE 
-          med_diag%SEAFLRFE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SEAFLRC")) THEN 
-          med_diag%SEAFLRC%dgsave = .TRUE.
-      ELSE 
-          med_diag%SEAFLRC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SEAFLRCA")) THEN 
-          med_diag%SEAFLRCA%dgsave = .TRUE.
-      ELSE 
-          med_diag%SEAFLRCA%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MED_QSR")) THEN 
-          med_diag%MED_QSR%dgsave = .TRUE.
-      ELSE 
-          med_diag%MED_QSR%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MED_XPAR")) THEN 
-          med_diag%MED_XPAR%dgsave = .TRUE.
-      ELSE 
-          med_diag%MED_XPAR%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INTFLX_N")) THEN 
-          med_diag%INTFLX_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%INTFLX_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INTFLX_SI")) THEN 
-          med_diag%INTFLX_SI%dgsave = .TRUE.
-      ELSE 
-          med_diag%INTFLX_SI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INTFLX_FE")) THEN 
-          med_diag%INTFLX_FE%dgsave = .TRUE.
-      ELSE 
-          med_diag%INTFLX_FE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INT_PN")) THEN 
-          med_diag%INT_PN%dgsave = .TRUE.
-      ELSE 
-          med_diag%INT_PN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INT_PD")) THEN 
-          med_diag%INT_PD%dgsave = .TRUE.
-      ELSE 
-          med_diag%INT_PD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ML_PRN")) THEN 
-          med_diag%ML_PRN%dgsave = .TRUE.
-      ELSE 
-          med_diag%ML_PRN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ML_PRD")) THEN 
-          med_diag%ML_PRD%dgsave = .TRUE.
-      ELSE 
-          med_diag%ML_PRD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCAL_CCD")) THEN 
-          med_diag%OCAL_CCD%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCAL_CCD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCAL_LVL")) THEN 
-          med_diag%OCAL_LVL%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCAL_LVL%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FE_0000")) THEN 
-          med_diag%FE_0000%dgsave = .TRUE.
-      ELSE 
-          med_diag%FE_0000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FE_0100")) THEN 
-          med_diag%FE_0100%dgsave = .TRUE.
-      ELSE 
-          med_diag%FE_0100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FE_0200")) THEN 
-          med_diag%FE_0200%dgsave = .TRUE.
-      ELSE 
-          med_diag%FE_0200%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FE_0500")) THEN 
-          med_diag%FE_0500%dgsave = .TRUE.
-      ELSE 
-          med_diag%FE_0500%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FE_1000")) THEN 
-          med_diag%FE_1000%dgsave = .TRUE.
-      ELSE 
-          med_diag%FE_1000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MED_XZE")) THEN 
-          med_diag%MED_XZE%dgsave = .TRUE.
-      ELSE 
-          med_diag%MED_XZE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("WIND")) THEN 
-          med_diag%WIND%dgsave = .TRUE.
-      ELSE 
-          med_diag%WIND%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ATM_PCO2")) THEN 
-          med_diag%ATM_PCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%ATM_PCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_PH")) THEN 
-          med_diag%OCN_PH%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_PH%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_PCO2")) THEN 
-          med_diag%OCN_PCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_PCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCNH2CO3")) THEN 
-          med_diag%OCNH2CO3%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCNH2CO3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_HCO3")) THEN 
-          med_diag%OCN_HCO3%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_HCO3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_CO3")) THEN 
-          med_diag%OCN_CO3%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_CO3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("CO2FLUX")) THEN 
-          med_diag%CO2FLUX%dgsave = .TRUE.
-      ELSE 
-          med_diag%CO2FLUX%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OM_CAL")) THEN 
-          med_diag%OM_CAL%dgsave = .TRUE.
-      ELSE 
-          med_diag%OM_CAL%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OM_ARG")) THEN 
-          med_diag%OM_ARG%dgsave = .TRUE.
-      ELSE 
-          med_diag%OM_ARG%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("TCO2")) THEN 
-          med_diag%TCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%TCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("TALK")) THEN 
-          med_diag%TALK%dgsave = .TRUE.
-      ELSE 
-          med_diag%TALK%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("KW660")) THEN 
-          med_diag%KW660%dgsave = .TRUE.
-      ELSE 
-          med_diag%KW660%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ATM_PP0")) THEN 
-          med_diag%ATM_PP0%dgsave = .TRUE.
-      ELSE 
-          med_diag%ATM_PP0%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("O2FLUX")) THEN 
-          med_diag%O2FLUX%dgsave = .TRUE.
-      ELSE 
-          med_diag%O2FLUX%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("O2SAT")) THEN 
-          med_diag%O2SAT%dgsave = .TRUE.
-      ELSE 
-          med_diag%O2SAT%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("CAL_CCD")) THEN 
-          med_diag%CAL_CCD%dgsave = .TRUE.
-      ELSE 
-          med_diag%CAL_CCD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ARG_CCD")) THEN 
-          med_diag%ARG_CCD%dgsave = .TRUE.
-      ELSE 
-          med_diag%ARG_CCD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SFR_OCAL")) THEN 
-          med_diag%SFR_OCAL%dgsave = .TRUE.
-      ELSE 
-          med_diag%SFR_OCAL%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SFR_OARG")) THEN 
-          med_diag%SFR_OARG%dgsave = .TRUE.
-      ELSE 
-          med_diag%SFR_OARG%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("N_PROD")) THEN 
-          med_diag%N_PROD%dgsave = .TRUE.
-      ELSE 
-          med_diag%N_PROD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("N_CONS")) THEN 
-          med_diag%N_CONS%dgsave = .TRUE.
-      ELSE 
-          med_diag%N_CONS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("C_PROD")) THEN 
-          med_diag%C_PROD%dgsave = .TRUE.
-      ELSE 
-          med_diag%C_PROD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("C_CONS")) THEN 
-          med_diag%C_CONS%dgsave = .TRUE.
-      ELSE 
-          med_diag%C_CONS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("O2_PROD")) THEN 
-          med_diag%O2_PROD%dgsave = .TRUE.
-      ELSE 
-          med_diag%O2_PROD%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("O2_CONS")) THEN 
-          med_diag%O2_CONS%dgsave = .TRUE.
-      ELSE 
-          med_diag%O2_CONS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("O2_ANOX")) THEN 
-          med_diag%O2_ANOX%dgsave = .TRUE.
-      ELSE 
-          med_diag%O2_ANOX%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RR_0100")) THEN 
-          med_diag%RR_0100%dgsave = .TRUE.
-      ELSE 
-          med_diag%RR_0100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RR_0500")) THEN 
-          med_diag%RR_0500%dgsave = .TRUE.
-      ELSE 
-          med_diag%RR_0500%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RR_1000")) THEN 
-          med_diag%RR_1000%dgsave = .TRUE.
-      ELSE 
-          med_diag%RR_1000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("IBEN_N")) THEN 
-          med_diag%IBEN_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%IBEN_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("IBEN_FE")) THEN 
-          med_diag%IBEN_FE%dgsave = .TRUE.
-      ELSE 
-          med_diag%IBEN_FE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("IBEN_C")) THEN 
-          med_diag%IBEN_C%dgsave = .TRUE.
-      ELSE 
-          med_diag%IBEN_C%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("IBEN_SI")) THEN 
-          med_diag%IBEN_SI%dgsave = .TRUE.
-      ELSE 
-          med_diag%IBEN_SI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("IBEN_CA")) THEN 
-          med_diag%IBEN_CA%dgsave = .TRUE.
-      ELSE 
-          med_diag%IBEN_CA%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OBEN_N")) THEN 
-          med_diag%OBEN_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%OBEN_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OBEN_FE")) THEN 
-          med_diag%OBEN_FE%dgsave = .TRUE.
-      ELSE 
-          med_diag%OBEN_FE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OBEN_C")) THEN 
-          med_diag%OBEN_C%dgsave = .TRUE.
-      ELSE 
-          med_diag%OBEN_C%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OBEN_SI")) THEN 
-          med_diag%OBEN_SI%dgsave = .TRUE.
-      ELSE 
-          med_diag%OBEN_SI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OBEN_CA")) THEN 
-          med_diag%OBEN_CA%dgsave = .TRUE.
-      ELSE 
-          med_diag%OBEN_CA%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BEN_N")) THEN 
-          med_diag%BEN_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%BEN_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BEN_FE")) THEN 
-          med_diag%BEN_FE%dgsave = .TRUE.
-      ELSE 
-          med_diag%BEN_FE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BEN_C")) THEN 
-          med_diag%BEN_C%dgsave = .TRUE.
-      ELSE 
-          med_diag%BEN_C%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BEN_SI")) THEN 
-          med_diag%BEN_SI%dgsave = .TRUE.
-      ELSE 
-          med_diag%BEN_SI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BEN_CA")) THEN 
-          med_diag%BEN_CA%dgsave = .TRUE.
-      ELSE 
-          med_diag%BEN_CA%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RUNOFF")) THEN 
-          med_diag%RUNOFF%dgsave = .TRUE.
-      ELSE 
-          med_diag%RUNOFF%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RIV_N")) THEN 
-          med_diag%RIV_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%RIV_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RIV_SI")) THEN 
-          med_diag%RIV_SI%dgsave = .TRUE.
-      ELSE 
-          med_diag%RIV_SI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RIV_C")) THEN 
-          med_diag%RIV_C%dgsave = .TRUE.
-      ELSE 
-          med_diag%RIV_C%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("RIV_ALK")) THEN 
-          med_diag%RIV_ALK%dgsave = .TRUE.
-      ELSE 
-          med_diag%RIV_ALK%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DETC")) THEN 
-          med_diag%DETC%dgsave = .TRUE.
-      ELSE 
-          med_diag%DETC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDC__100")) THEN 
-          med_diag%SDC__100%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDC__100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDC__200")) THEN 
-          med_diag%SDC__200%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDC__200%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDC__500")) THEN 
-          med_diag%SDC__500%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDC__500%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("SDC_1000")) THEN 
-          med_diag%SDC_1000%dgsave = .TRUE.
-      ELSE 
-          med_diag%SDC_1000%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INVTC")) THEN 
-          med_diag%INVTC%dgsave = .TRUE.
-      ELSE 
-          med_diag%INVTC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INVTALK")) THEN 
-          med_diag%INVTALK%dgsave = .TRUE.
-      ELSE 
-          med_diag%INVTALK%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INVTO2")) THEN 
-          med_diag%INVTO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%INVTO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("LYSO_CA")) THEN 
-          med_diag%LYSO_CA%dgsave = .TRUE.
-      ELSE 
-          med_diag%LYSO_CA%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("COM_RESP")) THEN 
-          med_diag%COM_RESP%dgsave = .TRUE.
-      ELSE 
-          med_diag%COM_RESP%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PN_LLOSS")) THEN 
-          med_diag%PN_LLOSS%dgsave = .TRUE.
-      ELSE 
-          med_diag%PN_LLOSS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PD_LLOSS")) THEN 
-          med_diag%PD_LLOSS%dgsave = .TRUE.
-      ELSE 
-          med_diag%PD_LLOSS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_LLOSS")) THEN 
-          med_diag%ZI_LLOSS%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_LLOSS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_LLOSS")) THEN 
-          med_diag%ZE_LLOSS%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_LLOSS%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_MES_N")) THEN 
-          med_diag%ZI_MES_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_MES_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_MES_D")) THEN 
-          med_diag%ZI_MES_D%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_MES_D%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_MES_C")) THEN 
-          med_diag%ZI_MES_C%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_MES_C%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_MESDC")) THEN 
-          med_diag%ZI_MESDC%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_MESDC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_EXCR")) THEN 
-          med_diag%ZI_EXCR%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_EXCR%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_RESP")) THEN 
-          med_diag%ZI_RESP%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_RESP%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZI_GROW")) THEN 
-          med_diag%ZI_GROW%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZI_GROW%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_MES_N")) THEN 
-          med_diag%ZE_MES_N%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_MES_N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_MES_D")) THEN 
-          med_diag%ZE_MES_D%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_MES_D%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_MES_C")) THEN 
-          med_diag%ZE_MES_C%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_MES_C%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_MESDC")) THEN 
-          med_diag%ZE_MESDC%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_MESDC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_EXCR")) THEN 
-          med_diag%ZE_EXCR%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_EXCR%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_RESP")) THEN 
-          med_diag%ZE_RESP%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_RESP%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZE_GROW")) THEN 
-          med_diag%ZE_GROW%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZE_GROW%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MDETC")) THEN 
-          med_diag%MDETC%dgsave = .TRUE.
-      ELSE 
-          med_diag%MDETC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMIDC")) THEN 
-          med_diag%GMIDC%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMIDC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("GMEDC")) THEN 
-          med_diag%GMEDC%dgsave = .TRUE.
-      ELSE 
-          med_diag%GMEDC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INT_ZMI")) THEN 
-          med_diag%INT_ZMI%dgsave = .TRUE.
-      ELSE 
-          med_diag%INT_ZMI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INT_ZME")) THEN 
-          med_diag%INT_ZME%dgsave = .TRUE.
-      ELSE 
-          med_diag%INT_ZME%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INT_DET")) THEN 
-          med_diag%INT_DET%dgsave = .TRUE.
-      ELSE 
-          med_diag%INT_DET%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INT_DTC")) THEN 
-          med_diag%INT_DTC%dgsave = .TRUE.
-      ELSE 
-          med_diag%INT_DTC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DMS_SURF")) THEN 
-          med_diag%DMS_SURF%dgsave = .TRUE.
-      ELSE 
-          med_diag%DMS_SURF%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DMS_ANDR")) THEN 
-          med_diag%DMS_ANDR%dgsave = .TRUE.
-      ELSE 
-          med_diag%DMS_ANDR%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DMS_SIMO")) THEN 
-          med_diag%DMS_SIMO%dgsave = .TRUE.
-      ELSE 
-          med_diag%DMS_SIMO%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DMS_ARAN")) THEN 
-          med_diag%DMS_ARAN%dgsave = .TRUE.
-      ELSE 
-          med_diag%DMS_ARAN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DMS_HALL")) THEN 
-          med_diag%DMS_HALL%dgsave = .TRUE.
-      ELSE 
-          med_diag%DMS_HALL%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ATM_XCO2")) THEN 
-          med_diag%ATM_XCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%ATM_XCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_FCO2")) THEN 
-          med_diag%OCN_FCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_FCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ATM_FCO2")) THEN 
-          med_diag%ATM_FCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%ATM_FCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_RHOSW")) THEN 
-          med_diag%OCN_RHOSW%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_RHOSW%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_SCHCO2")) THEN 
-          med_diag%OCN_SCHCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_SCHCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_KWCO2")) THEN 
-          med_diag%OCN_KWCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_KWCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_K0")) THEN 
-          med_diag%OCN_K0%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_K0%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("CO2STARAIR")) THEN 
-          med_diag%CO2STARAIR%dgsave = .TRUE.
-      ELSE 
-          med_diag%CO2STARAIR%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OCN_DPCO2")) THEN 
-          med_diag%OCN_DPCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%OCN_DPCO2%dgsave = .FALSE.
+         med_diag%INVTN%dgsave = .TRUE.
+      ELSE 
+         med_diag%INVTN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INVTSI")) THEN 
+         med_diag%INVTSI%dgsave = .TRUE.
+      ELSE 
+         med_diag%INVTSI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INVTFE")) THEN 
+         med_diag%INVTFE%dgsave = .TRUE.
+      ELSE 
+         med_diag%INVTFE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PRN")) THEN 
+         med_diag%PRN%dgsave = .TRUE.
+      ELSE 
+         med_diag%PRN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MPN")) THEN 
+         med_diag%MPN%dgsave = .TRUE.
+      ELSE 
+         med_diag%MPN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PRD")) THEN 
+         med_diag%PRD%dgsave = .TRUE.
+      ELSE 
+         med_diag%PRD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MPD")) THEN 
+         med_diag%MPD%dgsave = .TRUE.
+      ELSE 
+         med_diag%MPD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DSED")) THEN 
+         med_diag%DSED%dgsave = .TRUE.
+      ELSE 
+         med_diag%DSED%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OPAL")) THEN 
+         med_diag%OPAL%dgsave = .TRUE.
+      ELSE 
+         med_diag%OPAL%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OPALDISS")) THEN 
+         med_diag%OPALDISS%dgsave = .TRUE.
+      ELSE 
+         med_diag%OPALDISS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMIPn")) THEN 
+         med_diag%GMIPn%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMIPn%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMID")) THEN 
+         med_diag%GMID%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMID%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MZMI")) THEN 
+         med_diag%MZMI%dgsave = .TRUE.
+      ELSE 
+         med_diag%MZMI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMEPN")) THEN 
+         med_diag%GMEPN%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMEPN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMEPD")) THEN 
+         med_diag%GMEPD%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMEPD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMEZMI")) THEN 
+         med_diag%GMEZMI%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMEZMI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMED")) THEN 
+         med_diag%GMED%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMED%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MZME")) THEN 
+         med_diag%MZME%dgsave = .TRUE.
+      ELSE 
+         med_diag%MZME%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DEXP")) THEN 
+         med_diag%DEXP%dgsave = .TRUE.
+      ELSE 
+         med_diag%DEXP%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DETN")) THEN 
+         med_diag%DETN%dgsave = .TRUE.
+      ELSE 
+         med_diag%DETN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MDET")) THEN 
+         med_diag%MDET%dgsave = .TRUE.
+      ELSE 
+         med_diag%MDET%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("AEOLIAN")) THEN 
+         med_diag%AEOLIAN%dgsave = .TRUE.
+      ELSE 
+         med_diag%AEOLIAN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BENTHIC")) THEN 
+         med_diag%BENTHIC%dgsave = .TRUE.
+      ELSE 
+         med_diag%BENTHIC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SCAVENGE")) THEN 
+         med_diag%SCAVENGE%dgsave = .TRUE.
+      ELSE 
+         med_diag%SCAVENGE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PN_JLIM")) THEN 
+         med_diag%PN_JLIM%dgsave = .TRUE.
+      ELSE 
+         med_diag%PN_JLIM%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PN_NLIM")) THEN 
+         med_diag%PN_NLIM%dgsave = .TRUE.
+      ELSE 
+         med_diag%PN_NLIM%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PN_FELIM")) THEN 
+         med_diag%PN_FELIM%dgsave = .TRUE.
+      ELSE 
+         med_diag%PN_FELIM%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PD_JLIM")) THEN 
+         med_diag%PD_JLIM%dgsave = .TRUE.
+      ELSE 
+         med_diag%PD_JLIM%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PD_NLIM")) THEN 
+         med_diag%PD_NLIM%dgsave = .TRUE.
+      ELSE 
+         med_diag%PD_NLIM%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PD_FELIM")) THEN 
+         med_diag%PD_FELIM%dgsave = .TRUE.
+      ELSE 
+         med_diag%PD_FELIM%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PD_SILIM")) THEN 
+         med_diag%PD_SILIM%dgsave = .TRUE.
+      ELSE 
+         med_diag%PD_SILIM%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PDSILIM2")) THEN 
+         med_diag%PDSILIM2%dgsave = .TRUE.
+      ELSE 
+         med_diag%PDSILIM2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDT__100")) THEN 
+         med_diag%SDT__100%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDT__100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDT__200")) THEN 
+         med_diag%SDT__200%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDT__200%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDT__500")) THEN 
+         med_diag%SDT__500%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDT__500%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDT_1000")) THEN 
+         med_diag%SDT_1000%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDT_1000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("TOTREG_N")) THEN 
+         med_diag%TOTREG_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%TOTREG_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("TOTRG_SI")) THEN 
+         med_diag%TOTRG_SI%dgsave = .TRUE.
+      ELSE 
+         med_diag%TOTRG_SI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REG__100")) THEN 
+         med_diag%REG__100%dgsave = .TRUE.
+      ELSE 
+         med_diag%REG__100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REG__200")) THEN 
+         med_diag%REG__200%dgsave = .TRUE.
+      ELSE 
+         med_diag%REG__200%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REG__500")) THEN 
+         med_diag%REG__500%dgsave = .TRUE.
+      ELSE 
+         med_diag%REG__500%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REG_1000")) THEN 
+         med_diag%REG_1000%dgsave = .TRUE.
+      ELSE 
+         med_diag%REG_1000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FASTN")) THEN 
+         med_diag%FASTN%dgsave = .TRUE.
+      ELSE 
+         med_diag%FASTN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FASTSI")) THEN 
+         med_diag%FASTSI%dgsave = .TRUE.
+      ELSE 
+         med_diag%FASTSI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FASTFE")) THEN 
+         med_diag%FASTFE%dgsave = .TRUE.
+      ELSE 
+         med_diag%FASTFE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FASTC")) THEN 
+         med_diag%FASTC%dgsave = .TRUE.
+      ELSE 
+         med_diag%FASTC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FASTCA")) THEN 
+         med_diag%FASTCA%dgsave = .TRUE.
+      ELSE 
+         med_diag%FASTCA%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDT__100")) THEN 
+         med_diag%FDT__100%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDT__100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDT__200")) THEN 
+         med_diag%FDT__200%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDT__200%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDT__500")) THEN 
+         med_diag%FDT__500%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDT__500%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDT_1000")) THEN 
+         med_diag%FDT_1000%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDT_1000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RG__100F")) THEN 
+         med_diag%RG__100F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RG__100F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RG__200F")) THEN 
+         med_diag%RG__200F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RG__200F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RG__500F")) THEN 
+         med_diag%RG__500F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RG__500F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RG_1000F")) THEN 
+         med_diag%RG_1000F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RG_1000F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDS__100")) THEN 
+         med_diag%FDS__100%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDS__100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDS__200")) THEN 
+         med_diag%FDS__200%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDS__200%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDS__500")) THEN 
+         med_diag%FDS__500%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDS__500%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FDS_1000")) THEN 
+         med_diag%FDS_1000%dgsave = .TRUE.
+      ELSE 
+         med_diag%FDS_1000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RGS_100F")) THEN 
+         med_diag%RGS_100F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RGS_100F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RGS_200F")) THEN 
+         med_diag%RGS_200F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RGS_200F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RGS_500F")) THEN 
+         med_diag%RGS_500F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RGS_500F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RGS1000F")) THEN 
+         med_diag%RGS1000F%dgsave = .TRUE.
+      ELSE 
+         med_diag%RGS1000F%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REMINN")) THEN 
+         med_diag%REMINN%dgsave = .TRUE.
+      ELSE 
+         med_diag%REMINN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REMINSI")) THEN 
+         med_diag%REMINSI%dgsave = .TRUE.
+      ELSE 
+         med_diag%REMINSI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REMINFE")) THEN 
+         med_diag%REMINFE%dgsave = .TRUE.
+      ELSE 
+         med_diag%REMINFE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REMINC")) THEN 
+         med_diag%REMINC%dgsave = .TRUE.
+      ELSE 
+         med_diag%REMINC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REMINCA")) THEN 
+         med_diag%REMINCA%dgsave = .TRUE.
+      ELSE 
+         med_diag%REMINCA%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SEAFLRN")) THEN 
+         med_diag%SEAFLRN%dgsave = .TRUE.
+      ELSE 
+         med_diag%SEAFLRN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SEAFLRSI")) THEN 
+         med_diag%SEAFLRSI%dgsave = .TRUE.
+      ELSE 
+         med_diag%SEAFLRSI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SEAFLRFE")) THEN 
+         med_diag%SEAFLRFE%dgsave = .TRUE.
+      ELSE 
+         med_diag%SEAFLRFE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SEAFLRC")) THEN 
+         med_diag%SEAFLRC%dgsave = .TRUE.
+      ELSE 
+         med_diag%SEAFLRC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SEAFLRCA")) THEN 
+         med_diag%SEAFLRCA%dgsave = .TRUE.
+      ELSE 
+         med_diag%SEAFLRCA%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MED_QSR")) THEN 
+         med_diag%MED_QSR%dgsave = .TRUE.
+      ELSE 
+         med_diag%MED_QSR%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MED_XPAR")) THEN 
+         med_diag%MED_XPAR%dgsave = .TRUE.
+      ELSE 
+         med_diag%MED_XPAR%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INTFLX_N")) THEN 
+         med_diag%INTFLX_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%INTFLX_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INTFLX_SI")) THEN 
+         med_diag%INTFLX_SI%dgsave = .TRUE.
+      ELSE 
+         med_diag%INTFLX_SI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INTFLX_FE")) THEN 
+         med_diag%INTFLX_FE%dgsave = .TRUE.
+      ELSE 
+         med_diag%INTFLX_FE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INT_PN")) THEN 
+         med_diag%INT_PN%dgsave = .TRUE.
+      ELSE 
+         med_diag%INT_PN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INT_PD")) THEN 
+         med_diag%INT_PD%dgsave = .TRUE.
+      ELSE 
+         med_diag%INT_PD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ML_PRN")) THEN 
+         med_diag%ML_PRN%dgsave = .TRUE.
+      ELSE 
+         med_diag%ML_PRN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ML_PRD")) THEN 
+         med_diag%ML_PRD%dgsave = .TRUE.
+      ELSE 
+         med_diag%ML_PRD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCAL_CCD")) THEN 
+         med_diag%OCAL_CCD%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCAL_CCD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCAL_LVL")) THEN 
+         med_diag%OCAL_LVL%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCAL_LVL%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FE_0000")) THEN 
+         med_diag%FE_0000%dgsave = .TRUE.
+      ELSE 
+         med_diag%FE_0000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FE_0100")) THEN 
+         med_diag%FE_0100%dgsave = .TRUE.
+      ELSE 
+         med_diag%FE_0100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FE_0200")) THEN 
+         med_diag%FE_0200%dgsave = .TRUE.
+      ELSE 
+         med_diag%FE_0200%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FE_0500")) THEN 
+         med_diag%FE_0500%dgsave = .TRUE.
+      ELSE 
+         med_diag%FE_0500%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FE_1000")) THEN 
+         med_diag%FE_1000%dgsave = .TRUE.
+      ELSE 
+         med_diag%FE_1000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MED_XZE")) THEN 
+         med_diag%MED_XZE%dgsave = .TRUE.
+      ELSE 
+         med_diag%MED_XZE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("WIND")) THEN 
+         med_diag%WIND%dgsave = .TRUE.
+      ELSE 
+         med_diag%WIND%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ATM_PCO2")) THEN 
+         med_diag%ATM_PCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%ATM_PCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_PH")) THEN 
+         med_diag%OCN_PH%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_PH%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_PCO2")) THEN 
+         med_diag%OCN_PCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_PCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCNH2CO3")) THEN 
+         med_diag%OCNH2CO3%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCNH2CO3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_HCO3")) THEN 
+         med_diag%OCN_HCO3%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_HCO3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_CO3")) THEN 
+         med_diag%OCN_CO3%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_CO3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("CO2FLUX")) THEN 
+         med_diag%CO2FLUX%dgsave = .TRUE.
+      ELSE 
+         med_diag%CO2FLUX%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OM_CAL")) THEN 
+         med_diag%OM_CAL%dgsave = .TRUE.
+      ELSE 
+         med_diag%OM_CAL%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OM_ARG")) THEN 
+         med_diag%OM_ARG%dgsave = .TRUE.
+      ELSE 
+         med_diag%OM_ARG%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("TCO2")) THEN 
+         med_diag%TCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%TCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("TALK")) THEN 
+         med_diag%TALK%dgsave = .TRUE.
+      ELSE 
+         med_diag%TALK%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("KW660")) THEN 
+         med_diag%KW660%dgsave = .TRUE.
+      ELSE 
+         med_diag%KW660%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ATM_PP0")) THEN 
+         med_diag%ATM_PP0%dgsave = .TRUE.
+      ELSE 
+         med_diag%ATM_PP0%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("O2FLUX")) THEN 
+         med_diag%O2FLUX%dgsave = .TRUE.
+      ELSE 
+         med_diag%O2FLUX%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("O2SAT")) THEN 
+         med_diag%O2SAT%dgsave = .TRUE.
+      ELSE 
+         med_diag%O2SAT%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("CAL_CCD")) THEN 
+         med_diag%CAL_CCD%dgsave = .TRUE.
+      ELSE 
+         med_diag%CAL_CCD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ARG_CCD")) THEN 
+         med_diag%ARG_CCD%dgsave = .TRUE.
+      ELSE 
+         med_diag%ARG_CCD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SFR_OCAL")) THEN 
+         med_diag%SFR_OCAL%dgsave = .TRUE.
+      ELSE 
+         med_diag%SFR_OCAL%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SFR_OARG")) THEN 
+         med_diag%SFR_OARG%dgsave = .TRUE.
+      ELSE 
+         med_diag%SFR_OARG%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("N_PROD")) THEN 
+         med_diag%N_PROD%dgsave = .TRUE.
+      ELSE 
+         med_diag%N_PROD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("N_CONS")) THEN 
+         med_diag%N_CONS%dgsave = .TRUE.
+      ELSE 
+         med_diag%N_CONS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("C_PROD")) THEN 
+         med_diag%C_PROD%dgsave = .TRUE.
+      ELSE 
+         med_diag%C_PROD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("C_CONS")) THEN 
+         med_diag%C_CONS%dgsave = .TRUE.
+      ELSE 
+         med_diag%C_CONS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("O2_PROD")) THEN 
+         med_diag%O2_PROD%dgsave = .TRUE.
+      ELSE 
+         med_diag%O2_PROD%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("O2_CONS")) THEN 
+         med_diag%O2_CONS%dgsave = .TRUE.
+      ELSE 
+         med_diag%O2_CONS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("O2_ANOX")) THEN 
+         med_diag%O2_ANOX%dgsave = .TRUE.
+      ELSE 
+         med_diag%O2_ANOX%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RR_0100")) THEN 
+         med_diag%RR_0100%dgsave = .TRUE.
+      ELSE 
+         med_diag%RR_0100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RR_0500")) THEN 
+         med_diag%RR_0500%dgsave = .TRUE.
+      ELSE 
+         med_diag%RR_0500%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RR_1000")) THEN 
+         med_diag%RR_1000%dgsave = .TRUE.
+      ELSE 
+         med_diag%RR_1000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("IBEN_N")) THEN 
+         med_diag%IBEN_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%IBEN_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("IBEN_FE")) THEN 
+         med_diag%IBEN_FE%dgsave = .TRUE.
+      ELSE 
+         med_diag%IBEN_FE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("IBEN_C")) THEN 
+         med_diag%IBEN_C%dgsave = .TRUE.
+      ELSE 
+         med_diag%IBEN_C%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("IBEN_SI")) THEN 
+         med_diag%IBEN_SI%dgsave = .TRUE.
+      ELSE 
+         med_diag%IBEN_SI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("IBEN_CA")) THEN 
+         med_diag%IBEN_CA%dgsave = .TRUE.
+      ELSE 
+         med_diag%IBEN_CA%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OBEN_N")) THEN 
+         med_diag%OBEN_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%OBEN_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OBEN_FE")) THEN 
+         med_diag%OBEN_FE%dgsave = .TRUE.
+      ELSE 
+         med_diag%OBEN_FE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OBEN_C")) THEN 
+         med_diag%OBEN_C%dgsave = .TRUE.
+      ELSE 
+         med_diag%OBEN_C%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OBEN_SI")) THEN 
+         med_diag%OBEN_SI%dgsave = .TRUE.
+      ELSE 
+         med_diag%OBEN_SI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OBEN_CA")) THEN 
+         med_diag%OBEN_CA%dgsave = .TRUE.
+      ELSE 
+         med_diag%OBEN_CA%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BEN_N")) THEN 
+         med_diag%BEN_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%BEN_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BEN_FE")) THEN 
+         med_diag%BEN_FE%dgsave = .TRUE.
+      ELSE 
+         med_diag%BEN_FE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BEN_C")) THEN 
+         med_diag%BEN_C%dgsave = .TRUE.
+      ELSE 
+         med_diag%BEN_C%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BEN_SI")) THEN 
+         med_diag%BEN_SI%dgsave = .TRUE.
+      ELSE 
+         med_diag%BEN_SI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BEN_CA")) THEN 
+         med_diag%BEN_CA%dgsave = .TRUE.
+      ELSE 
+         med_diag%BEN_CA%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RUNOFF")) THEN 
+         med_diag%RUNOFF%dgsave = .TRUE.
+      ELSE 
+         med_diag%RUNOFF%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RIV_N")) THEN 
+         med_diag%RIV_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%RIV_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RIV_SI")) THEN 
+         med_diag%RIV_SI%dgsave = .TRUE.
+      ELSE 
+         med_diag%RIV_SI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RIV_C")) THEN 
+         med_diag%RIV_C%dgsave = .TRUE.
+      ELSE 
+         med_diag%RIV_C%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("RIV_ALK")) THEN 
+         med_diag%RIV_ALK%dgsave = .TRUE.
+      ELSE 
+         med_diag%RIV_ALK%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DETC")) THEN 
+         med_diag%DETC%dgsave = .TRUE.
+      ELSE 
+         med_diag%DETC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDC__100")) THEN 
+         med_diag%SDC__100%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDC__100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDC__200")) THEN 
+         med_diag%SDC__200%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDC__200%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDC__500")) THEN 
+         med_diag%SDC__500%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDC__500%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("SDC_1000")) THEN 
+         med_diag%SDC_1000%dgsave = .TRUE.
+      ELSE 
+         med_diag%SDC_1000%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INVTC")) THEN 
+         med_diag%INVTC%dgsave = .TRUE.
+      ELSE 
+         med_diag%INVTC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INVTALK")) THEN 
+         med_diag%INVTALK%dgsave = .TRUE.
+      ELSE 
+         med_diag%INVTALK%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INVTO2")) THEN 
+         med_diag%INVTO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%INVTO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("LYSO_CA")) THEN 
+         med_diag%LYSO_CA%dgsave = .TRUE.
+      ELSE 
+         med_diag%LYSO_CA%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("COM_RESP")) THEN 
+         med_diag%COM_RESP%dgsave = .TRUE.
+      ELSE 
+         med_diag%COM_RESP%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PN_LLOSS")) THEN 
+         med_diag%PN_LLOSS%dgsave = .TRUE.
+      ELSE 
+         med_diag%PN_LLOSS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PD_LLOSS")) THEN 
+         med_diag%PD_LLOSS%dgsave = .TRUE.
+      ELSE 
+         med_diag%PD_LLOSS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_LLOSS")) THEN 
+         med_diag%ZI_LLOSS%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_LLOSS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_LLOSS")) THEN 
+         med_diag%ZE_LLOSS%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_LLOSS%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_MES_N")) THEN 
+         med_diag%ZI_MES_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_MES_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_MES_D")) THEN 
+         med_diag%ZI_MES_D%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_MES_D%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_MES_C")) THEN 
+         med_diag%ZI_MES_C%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_MES_C%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_MESDC")) THEN 
+         med_diag%ZI_MESDC%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_MESDC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_EXCR")) THEN 
+         med_diag%ZI_EXCR%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_EXCR%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_RESP")) THEN 
+         med_diag%ZI_RESP%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_RESP%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZI_GROW")) THEN 
+         med_diag%ZI_GROW%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZI_GROW%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_MES_N")) THEN 
+         med_diag%ZE_MES_N%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_MES_N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_MES_D")) THEN 
+         med_diag%ZE_MES_D%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_MES_D%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_MES_C")) THEN 
+         med_diag%ZE_MES_C%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_MES_C%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_MESDC")) THEN 
+         med_diag%ZE_MESDC%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_MESDC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_EXCR")) THEN 
+         med_diag%ZE_EXCR%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_EXCR%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_RESP")) THEN 
+         med_diag%ZE_RESP%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_RESP%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZE_GROW")) THEN 
+         med_diag%ZE_GROW%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZE_GROW%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MDETC")) THEN 
+         med_diag%MDETC%dgsave = .TRUE.
+      ELSE 
+         med_diag%MDETC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMIDC")) THEN 
+         med_diag%GMIDC%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMIDC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("GMEDC")) THEN 
+         med_diag%GMEDC%dgsave = .TRUE.
+      ELSE 
+         med_diag%GMEDC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INT_ZMI")) THEN 
+         med_diag%INT_ZMI%dgsave = .TRUE.
+      ELSE 
+         med_diag%INT_ZMI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INT_ZME")) THEN 
+         med_diag%INT_ZME%dgsave = .TRUE.
+      ELSE 
+         med_diag%INT_ZME%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INT_DET")) THEN 
+         med_diag%INT_DET%dgsave = .TRUE.
+      ELSE 
+         med_diag%INT_DET%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INT_DTC")) THEN 
+         med_diag%INT_DTC%dgsave = .TRUE.
+      ELSE 
+         med_diag%INT_DTC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DMS_SURF")) THEN 
+         med_diag%DMS_SURF%dgsave = .TRUE.
+      ELSE 
+         med_diag%DMS_SURF%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DMS_ANDR")) THEN 
+         med_diag%DMS_ANDR%dgsave = .TRUE.
+      ELSE 
+         med_diag%DMS_ANDR%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DMS_SIMO")) THEN 
+         med_diag%DMS_SIMO%dgsave = .TRUE.
+      ELSE 
+         med_diag%DMS_SIMO%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DMS_ARAN")) THEN 
+         med_diag%DMS_ARAN%dgsave = .TRUE.
+      ELSE 
+         med_diag%DMS_ARAN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DMS_HALL")) THEN 
+         med_diag%DMS_HALL%dgsave = .TRUE.
+      ELSE 
+         med_diag%DMS_HALL%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ATM_XCO2")) THEN 
+         med_diag%ATM_XCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%ATM_XCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_FCO2")) THEN 
+         med_diag%OCN_FCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_FCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ATM_FCO2")) THEN 
+         med_diag%ATM_FCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%ATM_FCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_RHOSW")) THEN 
+         med_diag%OCN_RHOSW%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_RHOSW%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_SCHCO2")) THEN 
+         med_diag%OCN_SCHCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_SCHCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_KWCO2")) THEN 
+         med_diag%OCN_KWCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_KWCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_K0")) THEN 
+         med_diag%OCN_K0%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_K0%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("CO2STARAIR")) THEN 
+         med_diag%CO2STARAIR%dgsave = .TRUE.
+      ELSE 
+         med_diag%CO2STARAIR%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OCN_DPCO2")) THEN 
+         med_diag%OCN_DPCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%OCN_DPCO2%dgsave = .FALSE.
       ENDIF
       !!
-      IF  (iom_use("TPP3")) THEN 
-          med_diag%TPP3%dgsave = .TRUE.
-      ELSE 
-          med_diag%TPP3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DETFLUX3")) THEN 
-          med_diag%DETFLUX3%dgsave = .TRUE.
-      ELSE 
-          med_diag%DETFLUX3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REMIN3N")) THEN 
-          med_diag%REMIN3N%dgsave = .TRUE.
-      ELSE 
-          med_diag%REMIN3N%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PH3")) THEN 
-          med_diag%PH3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PH3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("OM_CAL3")) THEN 
-          med_diag%OM_CAL3%dgsave = .TRUE.
-      ELSE 
-          med_diag%OM_CAL3%dgsave = .FALSE.
+      !! 3D fields
+      IF (iom_use("TPP3")) THEN 
+         med_diag%TPP3%dgsave = .TRUE.
+      ELSE 
+         med_diag%TPP3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DETFLUX3")) THEN 
+         med_diag%DETFLUX3%dgsave = .TRUE.
+      ELSE 
+         med_diag%DETFLUX3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REMIN3N")) THEN 
+         med_diag%REMIN3N%dgsave = .TRUE.
+      ELSE 
+         med_diag%REMIN3N%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PH3")) THEN 
+         med_diag%PH3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PH3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("OM_CAL3")) THEN 
+         med_diag%OM_CAL3%dgsave = .TRUE.
+      ELSE 
+         med_diag%OM_CAL3%dgsave = .FALSE.
       ENDIF
       !!
@@ -2172,257 +2032,257 @@
       !!
       !! 2D fields
-      IF  (iom_use("epC100")) THEN 
-          med_diag%epC100%dgsave = .TRUE.
-      ELSE 
-          med_diag%epC100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("epCALC100")) THEN 
-          med_diag%epCALC100%dgsave = .TRUE.
-      ELSE 
-          med_diag%epCALC100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("epN100")) THEN 
-          med_diag%epN100%dgsave = .TRUE.
-      ELSE 
-          med_diag%epN100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("epSI100")) THEN 
-          med_diag%epSI100%dgsave = .TRUE.
-      ELSE 
-          med_diag%epSI100%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FGCO2")) THEN 
-          med_diag%FGCO2%dgsave = .TRUE.
-      ELSE 
-          med_diag%FGCO2%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INTDISSIC")) THEN 
-          med_diag%INTDISSIC%dgsave = .TRUE.
-      ELSE 
-          med_diag%INTDISSIC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INTDISSIN")) THEN 
-          med_diag%INTDISSIN%dgsave = .TRUE.
-      ELSE 
-          med_diag%INTDISSIN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INTDISSISI")) THEN 
-          med_diag%INTDISSISI%dgsave = .TRUE.
-      ELSE 
-          med_diag%INTDISSISI%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("INTTALK")) THEN 
-          med_diag%INTTALK%dgsave = .TRUE.
-      ELSE 
-          med_diag%INTTALK%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("O2min")) THEN 
-          med_diag%O2min%dgsave = .TRUE.
-      ELSE 
-          med_diag%O2min%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("ZO2min")) THEN 
-          med_diag%ZO2min%dgsave = .TRUE.
-      ELSE 
-          med_diag%ZO2min%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FBDDTALK")) THEN 
-          med_diag%FBDDTALK%dgsave = .TRUE.
-      ELSE 
-          med_diag%FBDDTALK%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FBDDTDIC")) THEN 
-          med_diag%FBDDTDIC%dgsave = .TRUE.
-      ELSE 
-          med_diag%FBDDTDIC%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FBDDTDIFE")) THEN 
-          med_diag%FBDDTDIFE%dgsave = .TRUE.
-      ELSE 
-          med_diag%FBDDTDIFE%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FBDDTDIN")) THEN 
-          med_diag%FBDDTDIN%dgsave = .TRUE.
-      ELSE 
-          med_diag%FBDDTDIN%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FBDDTDISI")) THEN 
-          med_diag%FBDDTDISI%dgsave = .TRUE.
-      ELSE 
-          med_diag%FBDDTDISI%dgsave = .FALSE.
+      IF (iom_use("epC100")) THEN 
+         med_diag%epC100%dgsave = .TRUE.
+      ELSE 
+         med_diag%epC100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("epCALC100")) THEN 
+         med_diag%epCALC100%dgsave = .TRUE.
+      ELSE 
+         med_diag%epCALC100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("epN100")) THEN 
+         med_diag%epN100%dgsave = .TRUE.
+      ELSE 
+         med_diag%epN100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("epSI100")) THEN 
+         med_diag%epSI100%dgsave = .TRUE.
+      ELSE 
+         med_diag%epSI100%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FGCO2")) THEN 
+         med_diag%FGCO2%dgsave = .TRUE.
+      ELSE 
+         med_diag%FGCO2%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INTDISSIC")) THEN 
+         med_diag%INTDISSIC%dgsave = .TRUE.
+      ELSE 
+         med_diag%INTDISSIC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INTDISSIN")) THEN 
+         med_diag%INTDISSIN%dgsave = .TRUE.
+      ELSE 
+         med_diag%INTDISSIN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INTDISSISI")) THEN 
+         med_diag%INTDISSISI%dgsave = .TRUE.
+      ELSE 
+         med_diag%INTDISSISI%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("INTTALK")) THEN 
+         med_diag%INTTALK%dgsave = .TRUE.
+      ELSE 
+         med_diag%INTTALK%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("O2min")) THEN 
+         med_diag%O2min%dgsave = .TRUE.
+      ELSE 
+         med_diag%O2min%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("ZO2min")) THEN 
+         med_diag%ZO2min%dgsave = .TRUE.
+      ELSE 
+         med_diag%ZO2min%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FBDDTALK")) THEN 
+         med_diag%FBDDTALK%dgsave = .TRUE.
+      ELSE 
+         med_diag%FBDDTALK%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FBDDTDIC")) THEN 
+         med_diag%FBDDTDIC%dgsave = .TRUE.
+      ELSE 
+         med_diag%FBDDTDIC%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FBDDTDIFE")) THEN 
+         med_diag%FBDDTDIFE%dgsave = .TRUE.
+      ELSE 
+         med_diag%FBDDTDIFE%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FBDDTDIN")) THEN 
+         med_diag%FBDDTDIN%dgsave = .TRUE.
+      ELSE 
+         med_diag%FBDDTDIN%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FBDDTDISI")) THEN 
+         med_diag%FBDDTDISI%dgsave = .TRUE.
+      ELSE 
+         med_diag%FBDDTDISI%dgsave = .FALSE.
       ENDIF
       !!
-      !! 3D
-      IF  (iom_use("TPPD3")) THEN 
-          med_diag%TPPD3%dgsave = .TRUE.
-      ELSE 
-          med_diag%TPPD3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BDDTALK3")) THEN 
-          med_diag%BDDTALK3%dgsave = .TRUE.
-      ELSE 
-          med_diag%BDDTALK3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BDDTDIC3")) THEN 
-          med_diag%BDDTDIC3%dgsave = .TRUE.
-      ELSE 
-          med_diag%BDDTDIC3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BDDTDIFE3")) THEN 
-          med_diag%BDDTDIFE3%dgsave = .TRUE.
-      ELSE 
-          med_diag%BDDTDIFE3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BDDTDIN3")) THEN 
-          med_diag%BDDTDIN3%dgsave = .TRUE.
-      ELSE 
-          med_diag%BDDTDIN3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("BDDTDISI3")) THEN 
-          med_diag%BDDTDISI3%dgsave = .TRUE.
-      ELSE 
-          med_diag%BDDTDISI3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FD_NIT3")) THEN 
-          med_diag%FD_NIT3%dgsave = .TRUE.
-      ELSE 
-          med_diag%FD_NIT3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FD_SIL3")) THEN 
-          med_diag%FD_SIL3%dgsave = .TRUE.
-      ELSE 
-          med_diag%FD_SIL3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FD_CAR3")) THEN 
-          med_diag%FD_CAR3%dgsave = .TRUE.
-      ELSE 
-          med_diag%FD_CAR3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FD_CAL3")) THEN 
-          med_diag%FD_CAL3%dgsave = .TRUE.
-      ELSE 
-          med_diag%FD_CAL3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("CO33")) THEN 
-          med_diag%CO33%dgsave = .TRUE.
-      ELSE 
-          med_diag%CO33%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("CO3SATARAG3")) THEN 
-          med_diag%CO3SATARAG3%dgsave = .TRUE.
-      ELSE 
-          med_diag%CO3SATARAG3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("CO3SATCALC3")) THEN 
-          med_diag%CO3SATCALC3%dgsave = .TRUE.
-      ELSE 
-          med_diag%CO3SATCALC3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("DCALC3")) THEN 
-          med_diag%DCALC3%dgsave = .TRUE.
-      ELSE 
-          med_diag%DCALC3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("EXPC3")) THEN 
-          med_diag%EXPC3%dgsave = .TRUE.
-      ELSE 
-          med_diag%EXPC3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("EXPN3")) THEN 
-          med_diag%EXPN3%dgsave = .TRUE.
-      ELSE 
-          med_diag%EXPN3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FEDISS3")) THEN 
-          med_diag%FEDISS3%dgsave = .TRUE.
-      ELSE 
-          med_diag%FEDISS3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("FESCAV3")) THEN 
-          med_diag%FESCAV3%dgsave = .TRUE.
-      ELSE 
-          med_diag%FESCAV3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MIGRAZP3")) THEN 
-          med_diag%MIGRAZP3%dgsave = .TRUE.
-      ELSE 
-          med_diag%MIGRAZP3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MIGRAZD3")) THEN 
-          med_diag%MIGRAZD3%dgsave = .TRUE.
-      ELSE 
-          med_diag%MIGRAZD3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MEGRAZP3")) THEN 
-          med_diag%MEGRAZP3%dgsave = .TRUE.
-      ELSE 
-          med_diag%MEGRAZP3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MEGRAZD3")) THEN 
-          med_diag%MEGRAZD3%dgsave = .TRUE.
-      ELSE 
-          med_diag%MEGRAZD3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("MEGRAZZ3")) THEN 
-          med_diag%MEGRAZZ3%dgsave = .TRUE.
-      ELSE 
-          med_diag%MEGRAZZ3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("O2SAT3")) THEN 
-          med_diag%O2SAT3%dgsave = .TRUE.
-      ELSE 
-          med_diag%O2SAT3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PBSI3")) THEN 
-          med_diag%PBSI3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PBSI3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PCAL3")) THEN 
-          med_diag%PCAL3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PCAL3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("REMOC3")) THEN 
-          med_diag%REMOC3%dgsave = .TRUE.
-      ELSE 
-          med_diag%REMOC3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PNLIMJ3")) THEN 
-          med_diag%PNLIMJ3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PNLIMJ3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PNLIMN3")) THEN 
-          med_diag%PNLIMN3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PNLIMN3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PNLIMFE3")) THEN 
-          med_diag%PNLIMFE3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PNLIMFE3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PDLIMJ3")) THEN 
-          med_diag%PDLIMJ3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PDLIMJ3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PDLIMN3")) THEN 
-          med_diag%PDLIMN3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PDLIMN3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PDLIMFE3")) THEN 
-          med_diag%PDLIMFE3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PDLIMFE3%dgsave = .FALSE.
-      ENDIF
-      IF  (iom_use("PDLIMSI3")) THEN 
-          med_diag%PDLIMSI3%dgsave = .TRUE.
-      ELSE 
-          med_diag%PDLIMSI3%dgsave = .FALSE.
-      ENDIF
-
+      !! 3D fields
+      IF (iom_use("TPPD3")) THEN 
+         med_diag%TPPD3%dgsave = .TRUE.
+      ELSE 
+         med_diag%TPPD3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BDDTALK3")) THEN 
+         med_diag%BDDTALK3%dgsave = .TRUE.
+      ELSE 
+         med_diag%BDDTALK3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BDDTDIC3")) THEN 
+         med_diag%BDDTDIC3%dgsave = .TRUE.
+      ELSE 
+         med_diag%BDDTDIC3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BDDTDIFE3")) THEN 
+         med_diag%BDDTDIFE3%dgsave = .TRUE.
+      ELSE 
+         med_diag%BDDTDIFE3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BDDTDIN3")) THEN 
+         med_diag%BDDTDIN3%dgsave = .TRUE.
+      ELSE 
+         med_diag%BDDTDIN3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("BDDTDISI3")) THEN 
+         med_diag%BDDTDISI3%dgsave = .TRUE.
+      ELSE 
+         med_diag%BDDTDISI3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FD_NIT3")) THEN 
+         med_diag%FD_NIT3%dgsave = .TRUE.
+      ELSE 
+         med_diag%FD_NIT3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FD_SIL3")) THEN 
+         med_diag%FD_SIL3%dgsave = .TRUE.
+      ELSE 
+         med_diag%FD_SIL3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FD_CAR3")) THEN 
+         med_diag%FD_CAR3%dgsave = .TRUE.
+      ELSE 
+         med_diag%FD_CAR3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FD_CAL3")) THEN 
+         med_diag%FD_CAL3%dgsave = .TRUE.
+      ELSE 
+         med_diag%FD_CAL3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("CO33")) THEN 
+         med_diag%CO33%dgsave = .TRUE.
+      ELSE 
+         med_diag%CO33%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("CO3SATARAG3")) THEN 
+         med_diag%CO3SATARAG3%dgsave = .TRUE.
+      ELSE 
+         med_diag%CO3SATARAG3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("CO3SATCALC3")) THEN 
+         med_diag%CO3SATCALC3%dgsave = .TRUE.
+      ELSE 
+         med_diag%CO3SATCALC3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("DCALC3")) THEN 
+         med_diag%DCALC3%dgsave = .TRUE.
+      ELSE 
+         med_diag%DCALC3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("EXPC3")) THEN 
+         med_diag%EXPC3%dgsave = .TRUE.
+      ELSE 
+         med_diag%EXPC3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("EXPN3")) THEN 
+         med_diag%EXPN3%dgsave = .TRUE.
+      ELSE 
+         med_diag%EXPN3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FEDISS3")) THEN 
+         med_diag%FEDISS3%dgsave = .TRUE.
+      ELSE 
+         med_diag%FEDISS3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("FESCAV3")) THEN 
+         med_diag%FESCAV3%dgsave = .TRUE.
+      ELSE 
+         med_diag%FESCAV3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MIGRAZP3")) THEN 
+         med_diag%MIGRAZP3%dgsave = .TRUE.
+      ELSE 
+         med_diag%MIGRAZP3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MIGRAZD3")) THEN 
+         med_diag%MIGRAZD3%dgsave = .TRUE.
+      ELSE 
+         med_diag%MIGRAZD3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MEGRAZP3")) THEN 
+         med_diag%MEGRAZP3%dgsave = .TRUE.
+      ELSE 
+         med_diag%MEGRAZP3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MEGRAZD3")) THEN 
+         med_diag%MEGRAZD3%dgsave = .TRUE.
+      ELSE 
+         med_diag%MEGRAZD3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("MEGRAZZ3")) THEN 
+         med_diag%MEGRAZZ3%dgsave = .TRUE.
+      ELSE 
+         med_diag%MEGRAZZ3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("O2SAT3")) THEN 
+         med_diag%O2SAT3%dgsave = .TRUE.
+      ELSE 
+         med_diag%O2SAT3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PBSI3")) THEN 
+         med_diag%PBSI3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PBSI3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PCAL3")) THEN 
+         med_diag%PCAL3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PCAL3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("REMOC3")) THEN 
+         med_diag%REMOC3%dgsave = .TRUE.
+      ELSE 
+         med_diag%REMOC3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PNLIMJ3")) THEN 
+         med_diag%PNLIMJ3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PNLIMJ3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PNLIMN3")) THEN 
+         med_diag%PNLIMN3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PNLIMN3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PNLIMFE3")) THEN 
+         med_diag%PNLIMFE3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PNLIMFE3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PDLIMJ3")) THEN 
+         med_diag%PDLIMJ3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PDLIMJ3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PDLIMN3")) THEN 
+         med_diag%PDLIMN3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PDLIMN3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PDLIMFE3")) THEN 
+         med_diag%PDLIMFE3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PDLIMFE3%dgsave = .FALSE.
+      ENDIF
+      IF (iom_use("PDLIMSI3")) THEN 
+         med_diag%PDLIMSI3%dgsave = .TRUE.
+      ELSE 
+         med_diag%PDLIMSI3%dgsave = .FALSE.
+      ENDIF
+      
    END SUBROUTINE   trc_nam_iom_medusa
    
