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 5841)
+++ branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90	(revision 5931)
@@ -22,4 +22,5 @@
    USE sms_medusa      ! sms trends
    USE iom             ! I/O manager
+   USE trc_nam_dia     ! JPALM 13-11-2015 -- if iom_use for diag
 
    !! AXY (04/02/14): necessary to find NaNs on HECTOR
@@ -1169,4 +1170,1175 @@
    END SUBROUTINE trc_nam_medusa
    
+   SUBROUTINE trc_nam_iom_medusa
+    !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_nam_iom_medusa  ***
+      !!
+      !! ** Purpose : read all diag requested in iodef file through iom_use
+      !!              So it is done only once 
+      !!            ** All diagnostic MEDUSA could asked are registered in
+      !!            the med_diag type with a boolean value
+      !!            So if required, one diagnostic will be true.
+      !!
+      !!---------------------------------------------------------------------
+      !!
+      !!
+      !!----------------------------------------------------------------------            
+      !! Variable conventions
+      !!----------------------------------------------------------------------
+      !!
+      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("BASIN_01") THEN 
+          med_diag%BASIN_01%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_01%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_02") THEN 
+          med_diag%BASIN_02%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_02%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_03") THEN 
+          med_diag%BASIN_03%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_03%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_04") THEN 
+          med_diag%BASIN_04%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_04%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_05") THEN 
+          med_diag%BASIN_05%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_05%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_06") THEN 
+          med_diag%BASIN_06%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_06%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_07") THEN 
+          med_diag%BASIN_07%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_07%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_08") THEN 
+          med_diag%BASIN_08%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_08%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_09") THEN 
+          med_diag%BASIN_09%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_09%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_10") THEN 
+          med_diag%BASIN_10%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_10%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_11") THEN 
+          med_diag%BASIN_11%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_11%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_12") THEN 
+          med_diag%BASIN_12%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_12%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_13") THEN 
+          med_diag%BASIN_13%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_13%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_14") THEN 
+          med_diag%BASIN_14%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_14%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_15") THEN 
+          med_diag%BASIN_15%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_15%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_16") THEN 
+          med_diag%BASIN_16%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_16%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_17") THEN 
+          med_diag%BASIN_17%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_17%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_18") THEN 
+          med_diag%BASIN_18%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_18%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_19") THEN 
+          med_diag%BASIN_19%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_19%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_20") THEN 
+          med_diag%BASIN_20%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_20%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_21") THEN 
+          med_diag%BASIN_21%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_21%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_22") THEN 
+          med_diag%BASIN_22%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_22%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_23") THEN 
+          med_diag%BASIN_23%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_23%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_24") THEN 
+          med_diag%BASIN_24%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_24%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_25") THEN 
+          med_diag%BASIN_25%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_25%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_26") THEN 
+          med_diag%BASIN_26%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_26%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_27") THEN 
+          med_diag%BASIN_27%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_27%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_28") THEN 
+          med_diag%BASIN_28%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_28%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_29") THEN 
+          med_diag%BASIN_29%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_29%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_30") THEN 
+          med_diag%BASIN_30%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_30%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_31") THEN 
+          med_diag%BASIN_31%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_31%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_32") THEN 
+          med_diag%BASIN_32%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_32%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_33") THEN 
+          med_diag%BASIN_33%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_33%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_34") THEN 
+          med_diag%BASIN_34%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_34%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_35") THEN 
+          med_diag%BASIN_35%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_35%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_36") THEN 
+          med_diag%BASIN_36%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_36%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_37") THEN 
+          med_diag%BASIN_37%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_37%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_38") THEN 
+          med_diag%BASIN_38%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_38%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_39") THEN 
+          med_diag%BASIN_39%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_39%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_40") THEN 
+          med_diag%BASIN_40%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_40%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_41") THEN 
+          med_diag%BASIN_41%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_41%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_42") THEN 
+          med_diag%BASIN_42%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_42%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_43") THEN 
+          med_diag%BASIN_43%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_43%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_44") THEN 
+          med_diag%BASIN_44%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_44%dgsave = .FALSE.
+      ENDIF
+      IF  iom_use("BASIN_45") THEN 
+          med_diag%BASIN_45%dgsave = .TRUE.
+      ELSE 
+          med_diag%BASIN_45%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("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
+      !!
+      !!
+   END SUBROUTINE   trc_nam_iom_medusa
+   
 #else
    !!----------------------------------------------------------------------
