Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trc.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 6486)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 8280)
@@ -7,4 +7,5 @@
    !!              -   !  2000-04  (O. Aumont, M.A. Foujols)  HAMOCC3 and P3ZD
    !!   NEMO      1.0  !  2004-03  (C. Ethe)  Free form and module
+   !!             3.6  !  2016-11  (A. Yool)  Updated diags for CMIP6
    !!----------------------------------------------------------------------
 #if defined key_top
@@ -25,5 +26,5 @@
    INTEGER, PUBLIC                                                 ::   numnat_cfg = -1   !: logical unit for the reference passive tracer namelist_top_cfg
    INTEGER, PUBLIC                                                 ::   numont     = -1   !: logical unit for the reference passive tracer namelist output output.namelist.top
-   INTEGER, PUBLIC                                                 ::   numstr        !: logical unit for tracer statistics
+   INTEGER, PUBLIC                                                 ::   numstr     = -1   !: logical unit for tracer statistics
    INTEGER, PUBLIC                                                 ::   numrtr        !: logical unit for trc restart (read )
    INTEGER, PUBLIC                                                 ::   numrtw        !: logical unit for trc restart ( write )
@@ -104,4 +105,54 @@
    END TYPE DIAG
 
+#if defined key_medusa && defined key_iomput
+   TYPE, PUBLIC :: BDIAG
+      LOGICAL              :: dgsave
+   END TYPE BDIAG
+   
+   TYPE, PUBLIC :: DIAG_IOM
+      TYPE(BDIAG) INVTN, INVTSI, INVTFE, PRN, MPN, PRD, MPD, DSED, OPAL, OPALDISS, GMIPn,            &
+                  GMID, MZMI, GMEPN, GMEPD, GMEZMI, GMED, MZME, DEXP, DETN, MDET, AEOLIAN, BENTHIC,  &
+                  SCAVENGE, PN_JLIM, PN_NLIM, PN_FELIM, PD_JLIM, PD_NLIM, PD_FELIM, PD_SILIM,        &
+                  PDSILIM2, SDT__100, SDT__200, SDT__500, SDT_1000, TOTREG_N, TOTRG_SI, REG__100,    &
+                  REG__200, REG__500, REG_1000, FASTN, FASTSI, FASTFE, FASTC, FASTCA, FDT__100,      &
+                  FDT__200, FDT__500, FDT_1000, RG__100F, RG__200F, RG__500F, RG_1000F, FDS__100,    &
+                  FDS__200, FDS__500, FDS_1000, RGS_100F, RGS_200F, RGS_500F, RGS1000F, REMINN,      &
+                  REMINSI, REMINFE, REMINC, REMINCA, SEAFLRN, SEAFLRSI, SEAFLRFE, SEAFLRC, SEAFLRCA, &
+                  MED_QSR, MED_XPAR, INTFLX_N, INTFLX_SI, INTFLX_FE, INT_PN, INT_PD, ML_PRN, ML_PRD, &
+                  OCAL_CCD, OCAL_LVL, FE_0000, FE_0100, FE_0200, FE_0500, FE_1000, MED_XZE, WIND,    &
+                  ATM_PCO2, OCN_PH, OCN_PCO2, OCNH2CO3, OCN_HCO3, OCN_CO3, CO2FLUX, OM_CAL, OM_ARG,  &
+                  TCO2, TALK, KW660, ATM_PP0, O2FLUX, O2SAT, CAL_CCD, ARG_CCD, SFR_OCAL, SFR_OARG,   &
+                  N_PROD, N_CONS, C_PROD, C_CONS, O2_PROD, O2_CONS, O2_ANOX, RR_0100, RR_0500,       &
+                  RR_1000, IBEN_N, IBEN_FE, IBEN_C, IBEN_SI, IBEN_CA, OBEN_N, OBEN_FE, OBEN_C,       &
+                  OBEN_SI, OBEN_CA, BEN_N, BEN_FE, BEN_C, BEN_SI, BEN_CA, RUNOFF, RIV_N, RIV_SI,     &
+                  RIV_C, RIV_ALK, DETC, SDC__100, SDC__200, SDC__500, SDC_1000, INVTC, INVTALK,      &
+                  INVTO2, LYSO_CA, COM_RESP, PN_LLOSS, PD_LLOSS, ZI_LLOSS, ZE_LLOSS, ZI_MES_N,       &
+                  ZI_MES_D, ZI_MES_C, ZI_MESDC, ZI_EXCR, ZI_RESP, ZI_GROW, ZE_MES_N, ZE_MES_D,       &
+                  ZE_MES_C, ZE_MESDC, ZE_EXCR, ZE_RESP, ZE_GROW, MDETC, GMIDC, GMEDC,                &
+                  INT_ZMI, INT_ZME, INT_DET, INT_DTC, DMS_SURF, DMS_ANDR, DMS_SIMO, DMS_ARAN,        &
+                  DMS_HALL, DMS_ANDM, ATM_XCO2, OCN_FCO2, ATM_FCO2, OCN_RHOSW, OCN_SCHCO2,           &
+                  OCN_KWCO2, OCN_K0, CO2STARAIR, OCN_DPCO2,                                          & ! end of regular 2D
+                  TPP3, DETFLUX3, REMIN3N, PH3, OM_CAL3,                                             & ! end of regular 3D
+! AXY (11/11/16): additional CMIP6 2D diagnostics
+                  epC100, epCALC100, epN100, epSI100,                                                &
+                  FGCO2, INTDISSIC, INTDISSIN, INTDISSISI, INTTALK, O2min, ZO2min,                   &
+                  FBDDTALK, FBDDTDIC, FBDDTDIFE, FBDDTDIN, FBDDTDISI,                                & 
+! AXY (11/11/16): additional CMIP6 3D diagnostics
+                  TPPD3,                                                                             &
+                  BDDTALK3, BDDTDIC3, BDDTDIFE3, BDDTDIN3, BDDTDISI3,                                & 
+                  FD_NIT3, FD_SIL3, FD_CAR3, FD_CAL3,                                                & 
+                  CO33, CO3SATARAG3, CO3SATCALC3, DCALC3,                                            &
+                  EXPC3, EXPN3, EXPCALC3, EXPSI3,                                                    &
+                  FEDISS3, FESCAV3,                                                                  &
+                  MIGRAZP3, MIGRAZD3, MEGRAZP3, MEGRAZD3, MEGRAZZ3,                                  &
+                  O2SAT3, PBSI3, PCAL3, REMOC3,                                                      &
+                  PNLIMJ3, PNLIMN3, PNLIMFE3, PDLIMJ3, PDLIMN3, PDLIMFE3, PDLIMSI3       
+                  !!
+                  !! list of all MEDUSA diagnostics that could be called by iom_use
+   END TYPE DIAG_IOM  
+   !!
+   TYPE(DIAG_IOM), PUBLIC :: med_diag  ! define which diagnostics are asked in outputs
+# endif                   
+
    !! information for inputs
    !! --------------------------------------------------
@@ -216,4 +267,8 @@
 
       IF( trc_alloc /= 0 )   CALL ctl_warn('trc_alloc: failed to allocate arrays')
+
+      ! It is known that not intialising SBC_TRC can introduce NaNs
+      sbc_trc(:,:,:) = 0.0
+
       !
    END FUNCTION trc_alloc
