Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml	(revision 9350)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml	(revision 9351)
@@ -86,40 +86,53 @@
        <field id="PHN_E3T"  long_name="PHN * E3T"                                         unit="mmol-N/m2"  > PHN * e3t </field >
        <field id="PHN_INV"  field_ref="PHN_E3T"                                           unit="mmol-N/m2"   grid_ref="vert_sum" />
+       <field id="SURF_PHN" field_ref="PHN"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="PHD"      long_name="diatom     phytoplankton"                          unit="mmol-N/m3" />
        <field id="PHD_E3T"  long_name="PHD * E3T"                                         unit="mmol-N/m2"  > PHD * e3t </field >
        <field id="PHD_INV"  field_ref="PHD_E3T"                                           unit="mmol-N/m2"   grid_ref="vert_sum" />
+       <field id="SURF_PHD" field_ref="PHD"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="ZMI"      long_name="micro zooplankton"                                 unit="mmol-N/m3" />
        <field id="ZMI_E3T"  long_name="ZMI * E3T"                                         unit="mmol-N/m2"  > ZMI * e3t </field >
        <field id="ZMI_INV"  field_ref="ZMI_E3T"                                           unit="mmol-N/m2"   grid_ref="vert_sum" />
+       <field id="SURF_ZMI" field_ref="ZMI"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="ZME"      long_name="meso  zooplankton"                                 unit="mmol-N/m3" />
        <field id="ZME_E3T"  long_name="ZME * E3T"                                         unit="mmol-N/m2"  > ZME * e3t </field >
        <field id="ZME_INV"  field_ref="ZME_E3T"                                           unit="mmol-N/m2"   grid_ref="vert_sum" />
+       <field id="SURF_ZME" field_ref="ZME"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="DIN"      long_name="dissolved inorganic nitrogen"                      unit="mmol-N/m3" />
        <field id="DIN_E3T"  long_name="DIN * E3T"                                         unit="mmol-N/m2"  > DIN * e3t </field >
        <field id="DIN_INV"  field_ref="DIN_E3T"                                           unit="mmol-N/m2"   grid_ref="vert_sum" />
+       <field id="SURF_DIN" field_ref="DIN"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="SIL"      long_name="dissolved silicic acid"                            unit="mmolSi/m3" />
        <field id="SIL_E3T"  long_name="SIL * E3T"                                         unit="mmolSi/m2"  > SIL * e3t </field >
        <field id="SIL_INV"  field_ref="SIL_E3T"                                           unit="mmolSi/m2"   grid_ref="vert_sum" />
+       <field id="SURF_SIL" field_ref="SIL"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="FER"      long_name="dissolved iron"                                    unit="mmolFe/m3" />
        <field id="FER_E3T"  long_name="FER * E3T"                                         unit="mmolFe/m2"  > FER * e3t </field >
        <field id="FER_INV"  field_ref="FER_E3T"                                           unit="mmolFe/m2"   grid_ref="vert_sum" />
+       <field id="SURF_FER" field_ref="FER"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="DET"      long_name="detrital nitrogen"                                 unit="mmol-N/m3" />
        <field id="DET_E3T"  long_name="DET * E3T"                                         unit="mmol-N/m2"  > DET * e3t </field >
        <field id="DET_INV"  field_ref="DET_E3T"                                           unit="mmol-N/m2"   grid_ref="vert_sum" />
+       <field id="SURF_DET" field_ref="DET"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="PDS"      long_name="biogenic silicon in diatom phytoplankton"          unit="mmolSi/m3" />
        <field id="PDS_E3T"  long_name="PDS * E3T"                                         unit="mmolSi/m2"  > PDS * e3t </field >
        <field id="PDS_INV"  field_ref="PDS_E3T"                                           unit="mmolSi/m2"   grid_ref="vert_sum" />
+       <field id="SURF_PDS" field_ref="PDS"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="DTC"      long_name="detrital carbon"                                   unit="mmol-C/m3" />
        <field id="DTC_E3T"  long_name="DTC * E3T"                                         unit="mmol-C/m2"  > DTC * e3t </field >
        <field id="DTC_INV"  field_ref="DTC_E3T"                                           unit="mmol-C/m2"   grid_ref="vert_sum" />
+       <field id="SURF_DTC" field_ref="DTC"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="DiC"      long_name="dissolved inorganic carbon"                        unit="mmol-C/m3" />
        <field id="DiC_E3T"  long_name="DiC * E3T"                                         unit="mmol-C/m2"  > DiC * e3t </field >
        <field id="DiC_INV"  field_ref="DiC_E3T"                                           unit="mmol-C/m2"   grid_ref="vert_sum" />
+       <field id="SURF_DiC" field_ref="DiC"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="ALK"      long_name="alkalinity"                                        unit="meq/m3"    />
        <field id="ALK_E3T"  long_name="ALK * E3T"                                         unit="meq/m2"     > ALK * e3t </field >
        <field id="ALK_INV"  field_ref="ALK_E3T"                                           unit="meq/m2"      grid_ref="vert_sum" />
+       <field id="SURF_ALK" field_ref="ALK"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
        <field id="OXY"      long_name="dissolved oxygen"                                  unit="mmolO2/m3" />
        <field id="OXY_E3T"  long_name="OXY * E3T"                                         unit="mmolO2/m2"  > OXY * e3t </field >
        <field id="OXY_INV"  field_ref="OXY_E3T"                                           unit="mmolO2/m2"   grid_ref="vert_sum" />
+       <field id="SURF_OXY" field_ref="OXY"                                               unit="mg Chl/m3"   grid_ref="grid_T_surface_extract" />
 
       <!-- Ideal traceurs : variables available with key_idtra -->
@@ -1646,8 +1659,6 @@
       <field field_ref="CHN"      name="CHN"      />
       <field field_ref="CHN_E3T"  name="CHN_E3T"      />
-      <field field_ref="SURF_CHN" name="SURF_CHN"  />
       <field field_ref="CHD"      name="CHD"      />
       <field field_ref="CHD_E3T"  name="CHD_E3T"      />
-      <field field_ref="SURF_CHD" name="SURF_CHD"  />
       <field field_ref="PHN"      name="PHN"      />
       <field field_ref="PHN_E3T"  name="PHN_E3T"      />
@@ -1676,6 +1687,23 @@
       <field field_ref="OXY"      name="OXY"      />
       <field field_ref="OXY_E3T"  name="OXY_E3T"      />
-      </field_group>
-
+   </field_group>
+
+    <field_group id="groupMEDUSA_surf" >
+      <field field_ref="SURF_CHN" name="SURF_CHN"  />
+      <field field_ref="SURF_CHD" name="SURF_CHD"  />
+      <field field_ref="SURF_PHN" name="SURF_PHN"  />
+      <field field_ref="SURF_PHD" name="SURF_PHD"  />
+      <field field_ref="SURF_ZMI" name="SURF_ZMI"  />
+      <field field_ref="SURF_ZME" name="SURF_ZME"  />
+      <field field_ref="SURF_DIN" name="SURF_DIN"  />
+      <field field_ref="SURF_SIL" name="SURF_SIL"  />
+      <field field_ref="SURF_FER" name="SURF_FER"  />
+      <field field_ref="SURF_DET" name="SURF_DET"  />
+      <field field_ref="SURF_PDS" name="SURF_PDS"  />
+      <field field_ref="SURF_DTC" name="SURF_DTC"  />
+      <field field_ref="SURF_DiC" name="SURF_DiC"  />
+      <field field_ref="SURF_ALK" name="SURF_ALK"  />
+      <field field_ref="SURF_OXY" name="SURF_OXY"  />
+    </field_group>
 
     <field_group id="groupMEDUSA_INV" >
@@ -1730,5 +1758,5 @@
 
 
-    <field_group id="trendMEDUSA" >
+    <field_group id="trendMEDUSA_long" >
        <!-- trd case: jptra_xad -->
        <field field_ref="XAD_CHN"     name="XAD_CHN"   />
@@ -1781,33 +1809,18 @@
        <!-- trd case: jptra_totad -->
        <field field_ref="TAD_CHN"      name="TAD_CHN"   />
-       <field field_ref="TAD_CHN_INV"  name="TAD_CHN_INV"   />
        <field field_ref="TAD_CHD"      name="TAD_CHD"   />
-       <field field_ref="TAD_CHD_INV"  name="TAD_CHD_INV"   />
        <field field_ref="TAD_PHN"      name="TAD_PHN"   />
-       <field field_ref="TAD_PHN_INV"  name="TAD_PHN_INV"   />
        <field field_ref="TAD_PHD"      name="TAD_PHD"   />
-       <field field_ref="TAD_PHD_INV"  name="TAD_PHD_INV"   />
        <field field_ref="TAD_ZMI"      name="TAD_ZMI"   />
-       <field field_ref="TAD_ZMI_INV"  name="TAD_ZMI_INV"   />
        <field field_ref="TAD_ZME"      name="TAD_ZME"   />
-       <field field_ref="TAD_ZME_INV"  name="TAD_ZME_INV"   />
        <field field_ref="TAD_DIN"      name="TAD_DIN"   />
-       <field field_ref="TAD_DIN_INV"  name="TAD_DIN_INV"   />
        <field field_ref="TAD_SIL"      name="TAD_SIL"   />
-       <field field_ref="TAD_SIL_INV"  name="TAD_SIL_INV"   />
        <field field_ref="TAD_FER"      name="TAD_FER"   />
-       <field field_ref="TAD_FER_INV"  name="TAD_FER_INV"   />
        <field field_ref="TAD_DET"      name="TAD_DET"   />
-       <field field_ref="TAD_DET_INV"  name="TAD_DET_INV"   />
        <field field_ref="TAD_PDS"      name="TAD_PDS"   />
-       <field field_ref="TAD_PDS_INV"  name="TAD_PDS_INV"   />
        <field field_ref="TAD_DTC"      name="TAD_DTC"   />
-       <field field_ref="TAD_DTC_INV"  name="TAD_DTC_INV"   />
        <field field_ref="TAD_DiC"      name="TAD_DiC"   />
-       <field field_ref="TAD_DiC_INV"  name="TAD_DiC_INV"   />
        <field field_ref="TAD_ALK"      name="TAD_ALK"   />
-       <field field_ref="TAD_ALK_INV"  name="TAD_ALK_INV"   />
        <field field_ref="TAD_OXY"      name="TAD_OXY"   />
-       <field field_ref="TAD_OXY_INV"  name="TAD_OXY_INV"   />
        <!-- trd case: jptra_ldf -->
        <field field_ref="LDF_CHN"      name="LDF_CHN"   />
@@ -1909,33 +1922,18 @@
        <!-- trd case: jptra_sms -->
        <field field_ref="SMS_CHN"      name="SMS_CHN"   />
-       <field field_ref="SMS_CHN_INV"  name="SMS_CHN_INV"   />
        <field field_ref="SMS_CHD"      name="SMS_CHD"   />
-       <field field_ref="SMS_CHD_INV"  name="SMS_CHD_INV"   />
        <field field_ref="SMS_PHN"      name="SMS_PHN"   />
-       <field field_ref="SMS_PHN_INV"  name="SMS_PHN_INV"   />
        <field field_ref="SMS_PHD"      name="SMS_PHD"   />
-       <field field_ref="SMS_PHD_INV"  name="SMS_PHD_INV"   />
        <field field_ref="SMS_ZMI"      name="SMS_ZMI"   />
-       <field field_ref="SMS_ZMI_INV"  name="SMS_ZMI_INV"   />
        <field field_ref="SMS_ZME"      name="SMS_ZME"   />
-       <field field_ref="SMS_ZME_INV"  name="SMS_ZME_INV"   />
        <field field_ref="SMS_DIN"      name="SMS_DIN"   />
-       <field field_ref="SMS_DIN_INV"  name="SMS_DIN_INV"   />
        <field field_ref="SMS_SIL"      name="SMS_SIL"   />
-       <field field_ref="SMS_SIL_INV"  name="SMS_SIL_INV"   />
        <field field_ref="SMS_FER"      name="SMS_FER"   />
-       <field field_ref="SMS_FER_INV"  name="SMS_FER_INV"   />
        <field field_ref="SMS_DET"      name="SMS_DET"   />
-       <field field_ref="SMS_DET_INV"  name="SMS_DET_INV"   />
        <field field_ref="SMS_PDS"      name="SMS_PDS"   />
-       <field field_ref="SMS_PDS_INV"  name="SMS_PDS_INV"   />
        <field field_ref="SMS_DTC"      name="SMS_DTC"   />
-       <field field_ref="SMS_DTC_INV"  name="SMS_DTC_INV"   />
        <field field_ref="SMS_DiC"      name="SMS_DiC"   /> 
-       <field field_ref="SMS_DiC_INV"  name="SMS_DiC_INV"   />
        <field field_ref="SMS_ALK"      name="SMS_ALK"   />
-       <field field_ref="SMS_ALK_INV"  name="SMS_ALK_INV"   />
        <field field_ref="SMS_OXY"      name="SMS_OXY"   />
-       <field field_ref="SMS_OXY_INV"  name="SMS_OXY_INV"   />
        <!-- trd case: jptra_atf -->
        <field field_ref="ATF_CHN"      name="ATF_CHN"   />
@@ -1956,33 +1954,18 @@
        <!-- trd case: jptra_tot -->   
        <field field_ref="TOT_CHN"      name="TOT_CHN"   />
-       <field field_ref="TOT_CHN_INV"  name="TOT_CHN_INV"   />
        <field field_ref="TOT_CHD"      name="TOT_CHD"   />
-       <field field_ref="TOT_CHD_INV"  name="TOT_CHD_INV"   />
        <field field_ref="TOT_PHN"      name="TOT_PHN"   />
-       <field field_ref="TOT_PHN_INV"  name="TOT_PHN_INV"   />
        <field field_ref="TOT_PHD"      name="TOT_PHD"   />
-       <field field_ref="TOT_PHD_INV"  name="TOT_PHD_INV"   />
        <field field_ref="TOT_ZMI"      name="TOT_ZMI"   />
-       <field field_ref="TOT_ZMI_INV"  name="TOT_ZMI_INV"   />
        <field field_ref="TOT_ZME"      name="TOT_ZME"   />
-       <field field_ref="TOT_ZME_INV"  name="TOT_ZME_INV"   />
        <field field_ref="TOT_DIN"      name="TOT_DIN"   />
-       <field field_ref="TOT_DIN_INV"  name="TOT_DIN_INV"   />
        <field field_ref="TOT_SIL"      name="TOT_SIL"   />
-       <field field_ref="TOT_SIL_INV"  name="TOT_SIL_INV"   />
        <field field_ref="TOT_FER"      name="TOT_FER"   />
-       <field field_ref="TOT_FER_INV"  name="TOT_FER_INV"   />
        <field field_ref="TOT_DET"      name="TOT_DET"   />
-       <field field_ref="TOT_DET_INV"  name="TOT_DET_INV"   />
        <field field_ref="TOT_PDS"      name="TOT_PDS"   />
-       <field field_ref="TOT_PDS_INV"  name="TOT_PDS_INV"   />
        <field field_ref="TOT_DTC"      name="TOT_DTC"   />
-       <field field_ref="TOT_DTC_INV"  name="TOT_DTC_INV"   />
        <field field_ref="TOT_DiC"      name="TOT_DiC"   />
-       <field field_ref="TOT_DiC_INV"  name="TOT_DiC_INV"   />
        <field field_ref="TOT_ALK"      name="TOT_ALK"   />   
-       <field field_ref="TOT_ALK_INV"  name="TOT_ALK_INV"   />
        <field field_ref="TOT_OXY"      name="TOT_OXY"   />
-       <field field_ref="TOT_OXY_INV"  name="TOT_OXY_INV"   />  
        <!-- trd case: jptra_iso -->
        <field field_ref="ISO_CHN"      name="ISO_CHN"   />   
@@ -2003,13 +1986,11 @@
     </field_group>
 
-    <field_group id="trendCFC11" >
+    <field_group id="trendCFC11_long" >
           <!-- cfc11 -->
           <field field_ref="TOT_CFC11"     name="TOT_CFC11"     standard_name="CFC-11_Concentration"                  />
-          <field field_ref="TOT_CFC11_INV" name="TOT_CFC11_INV" standard_name="CFC-11_Concentration"                  />
           <field field_ref="XAD_CFC11"     name="XAD_CFC11"     standard_name="CFC-11_Concentration"                  />
           <field field_ref="YAD_CFC11"     name="YAD_CFC11"     standard_name="CFC-11_Concentration"                  />
           <field field_ref="ZAD_CFC11"     name="ZAD_CFC11"     standard_name="CFC-11_Concentration"                  />
           <field field_ref="TAD_CFC11"     name="TAD_CFC11"     standard_name="CFC-11_Concentration"                  />
-          <field field_ref="TAD_CFC11_INV" name="TAD_CFC11_INV" standard_name="CFC-11_Concentration"                  />
           <field field_ref="LDF_CFC11"     name="LDF_CFC11"     standard_name="CFC-11_Concentration"                  />
           <field field_ref="BBL_CFC11"     name="BBL_CFC11"     standard_name="CFC-11_Concentration"                  />
@@ -2019,18 +2000,15 @@
           <!-- <field field_ref="DMP_CFC11"     name="DMP_CFC11"     standard_name="CFC-11_Concentration"             /> -->
           <field field_ref="SMS_CFC11"     name="SMS_CFC11"     standard_name="CFC-11_Concentration"                  />
-          <field field_ref="SMS_CFC11_INV" name="SMS_CFC11_INV" standard_name="CFC-11_Concentration"                  />
           <field field_ref="ATF_CFC11"     name="ATF_CFC11"     standard_name="CFC-11_Concentration"                  /> 
           <field field_ref="ISO_CFC11"     name="ISO_CFC11"     standard_name="CFC-11_Concentration"                  />
    </field_group>
 
-    <field_group id="trendCFC12" >
+    <field_group id="trendCFC12_long" >
           <!-- cfc12 -->
           <field field_ref="TOT_CFC12"     name="TOT_CFC12"     standard_name="CFC-12_Concentration"                  />
-          <field field_ref="TOT_CFC12_INV" name="TOT_CFC12_INV" standard_name="CFC-12_Concentration"                  />
           <field field_ref="XAD_CFC12"     name="XAD_CFC12"     standard_name="CFC-12_Concentration"                  />
           <field field_ref="YAD_CFC12"     name="YAD_CFC12"     standard_name="CFC-12_Concentration"                  />
           <field field_ref="ZAD_CFC12"     name="ZAD_CFC12"     standard_name="CFC-12_Concentration"                  />
           <field field_ref="TAD_CFC12"     name="TAD_CFC12"     standard_name="CFC-12_Concentration"                  />
-          <field field_ref="TAD_CFC12_INV" name="TAD_CFC12_INV" standard_name="CFC-12_Concentration"                  />
           <field field_ref="LDF_CFC12"     name="LDF_CFC12"     standard_name="CFC-12_Concentration"                  />
           <field field_ref="BBL_CFC12"     name="BBL_CFC12"     standard_name="CFC-12_Concentration"                  />
@@ -2040,18 +2018,15 @@
           <!-- <field field_ref="DMP_CFC12"     name="DMP_CFC12"     standard_name="CFC-12_Concentration"             /> -->
           <field field_ref="SMS_CFC12"     name="SMS_CFC12"     standard_name="CFC-12_Concentration"                  />
-          <field field_ref="SMS_CFC12_INV" name="SMS_CFC12_INV" standard_name="CFC-12_Concentration"                  />
           <field field_ref="ATF_CFC12"     name="ATF_CFC12"     standard_name="CFC-12_Concentration"                  /> 
           <field field_ref="ISO_CFC12"     name="ISO_CFC12"     standard_name="CFC-12_Concentration"                  />
    </field_group>
 
-    <field_group id="trendSF6" >
+    <field_group id="trendSF6_long" >
           <!-- sf6 -->
           <field field_ref="TOT_SF6"      name="TOT_SF6"      standard_name="SF6_Concentration"                     />
-          <field field_ref="TOT_SF6_INV"  name="TOT_SF6_INV"  standard_name="SF6_Concentration"                     />
           <field field_ref="XAD_SF6"      name="XAD_SF6"      standard_name="SF6_Concentration"                     />
           <field field_ref="YAD_SF6"      name="YAD_SF6"      standard_name="SF6_Concentration"                     />
           <field field_ref="ZAD_SF6"      name="ZAD_SF6"      standard_name="SF6_Concentration"                     />
           <field field_ref="TAD_SF6"      name="TAD_SF6"      standard_name="SF6_Concentration"                     />
-          <field field_ref="TAD_SF6_INV"  name="TAD_SF6_INV"  standard_name="SF6_Concentration"                     />
           <field field_ref="LDF_SF6"      name="LDF_SF6"      standard_name="SF6_Concentration"                     />
           <field field_ref="BBL_SF6"      name="BBL_SF6"      standard_name="SF6_Concentration"                     />
@@ -2061,18 +2036,15 @@
           <!-- <field field_ref="DMP_SF6"      name="DMP_SF6"      standard_name="SF6_Concentration"                /> -->
           <field field_ref="SMS_SF6"      name="SMS_SF6"      standard_name="SF6_Concentration"                     />
-          <field field_ref="SMS_SF6_INV"  name="SMS_SF6_INV"  standard_name="SF6_Concentration"                     />
           <field field_ref="ATF_SF6"      name="ATF_SF6"      standard_name="SF6_Concentration"                     /> 
           <field field_ref="ISO_SF6"      name="ISO_SF6"      standard_name="SF6_Concentration"                     />
    </field_group>
 
-    <field_group id="trendAGE" >
+    <field_group id="trendAGE_long" >
           <!-- age -->
           <field field_ref="TOT_Age"      name="TOT_Age"      standard_name="sea_water_age_since_surface_contact"   />
-          <field field_ref="TOT_Age_INV"  name="TOT_Age_INV"  standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="XAD_Age"      name="XAD_Age"      standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="YAD_Age"      name="YAD_Age"      standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="ZAD_Age"      name="ZAD_Age"      standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="TAD_Age"      name="TAD_Age"      standard_name="sea_water_age_since_surface_contact"   />
-          <field field_ref="TAD_Age_INV"  name="TAD_Age_INV"  standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="LDF_Age"      name="LDF_Age"      standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="BBL_Age"      name="BBL_Age"      standard_name="sea_water_age_since_surface_contact"   />
@@ -2082,18 +2054,15 @@
           <!-- <field field_ref="DMP_Age"      name="DMP_Age"      standard_name="sea_water_age_since_surface_contact" /> -->
           <field field_ref="SMS_Age"      name="SMS_Age"      standard_name="sea_water_age_since_surface_contact"   />
-          <field field_ref="SMS_Age_INV"  name="SMS_Age_INV"  standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="ATF_Age"      name="ATF_Age"      standard_name="sea_water_age_since_surface_contact"   /> 
           <field field_ref="ISO_Age"      name="ISO_Age"      standard_name="sea_water_age_since_surface_contact"   />
    </field_group>
 
-    <field_group id="trendIDTRA" >
+    <field_group id="trendIDTRA_long" >
           <!-- Ideal tracer -->
           <field field_ref="TOT_IDTRA"      name="TOT_IDTRA"      standard_name="IDTRA_Concentration"               />
-          <field field_ref="TOT_IDTRA_INV"  name="TOT_IDTRA_INV"  standard_name="IDTRA_Concentration"               />
           <field field_ref="XAD_IDTRA"      name="XAD_IDTRA"      standard_name="IDTRA_Concentration"               />
           <field field_ref="YAD_IDTRA"      name="YAD_IDTRA"      standard_name="IDTRA_Concentration"               />
           <field field_ref="ZAD_IDTRA"      name="ZAD_IDTRA"      standard_name="IDTRA_Concentration"               />
           <field field_ref="TAD_IDTRA"      name="TAD_IDTRA"      standard_name="IDTRA_Concentration"               />
-          <field field_ref="TAD_IDTRA_INV"  name="TAD_IDTRA_INV"  standard_name="IDTRA_Concentration"               />
           <field field_ref="LDF_IDTRA"      name="LDF_IDTRA"      standard_name="IDTRA_Concentration"               />
           <field field_ref="BBL_IDTRA"      name="BBL_IDTRA"      standard_name="IDTRA_Concentration"               />
@@ -2103,18 +2072,15 @@
           <!-- <field field_ref="DMP_IDTRA"      name="DMP_IDTRA"      standard_name="IDTRA_Concentration"          /> -->
           <field field_ref="SMS_IDTRA"      name="SMS_IDTRA"      standard_name="IDTRA_Concentration"               />
-          <field field_ref="SMS_IDTRA_INV"  name="SMS_IDTRA_INV"  standard_name="IDTRA_Concentration"               />
           <field field_ref="ATF_IDTRA"      name="ATF_IDTRA"      standard_name="IDTRA_Concentration"               /> 
           <field field_ref="ISO_IDTRA"      name="ISO_IDTRA"      standard_name="IDTRA_Concentration"               />
    </field_group>
 
-    <field_group id="trendC14B" >
+    <field_group id="trendC14B_long" >
           <!-- c14 bomb -->
           <field field_ref="TOT_C14B"      name="TOT_C14B"      standard_name="C14b_Concentration"               />
-          <field field_ref="TOT_C14B_INV"  name="TOT_C14B_INV"  standard_name="C14b_Concentration"               />
           <field field_ref="XAD_C14B"      name="XAD_C14B"      standard_name="C14b_Concentration"               />
           <field field_ref="YAD_C14B"      name="YAD_C14B"      standard_name="C14b_Concentration"               />
           <field field_ref="ZAD_C14B"      name="ZAD_C14B"      standard_name="C14b_Concentration"               />
           <field field_ref="TAD_C14B"      name="TAD_C14B"      standard_name="C14b_Concentration"               />
-          <field field_ref="TAD_C14B_INV"  name="TAD_C14B_INV"  standard_name="C14b_Concentration"               />
           <field field_ref="LDF_C14B"      name="LDF_C14B"      standard_name="C14b_Concentration"               />
           <field field_ref="BBL_C14B"      name="BBL_C14B"      standard_name="C14b_Concentration"               />
@@ -2124,5 +2090,4 @@
           <!-- <field field_ref="DMP_C14B"      name="DMP_C14B"      standard_name="C14b_Concentration"          /> -->
           <field field_ref="SMS_C14B"      name="SMS_C14B"      standard_name="C14b_Concentration"               />
-          <field field_ref="SMS_C14B_INV"  name="SMS_C14B_INV"  standard_name="C14b_Concentration"               />
           <field field_ref="ATF_C14B"      name="ATF_C14B"      standard_name="C14b_Concentration"               /> 
           <field field_ref="ISO_C14B"      name="ISO_C14B"      standard_name="C14b_Concentration"               />
@@ -2161,49 +2126,73 @@
 
 
-    <field_group id="trendCFC11_short" >
+    <field_group id="trendCFC11_cmip6" >
           <!-- cfc11 -->
           <field field_ref="TOT_CFC11_E3T" name="TOT_CFC11_E3T" standard_name="CFC-11_Concentration"                  />
+          <field field_ref="SMS_CFC11_E3T" name="SMS_CFC11_E3T" standard_name="CFC-11_Concentration"                  />
+   </field_group>
+
+    <field_group id="trendCFC12_cmip6" >
+          <!-- cfc12 -->
+          <field field_ref="TOT_CFC12_E3T" name="TOT_CFC12_E3T" standard_name="CFC-12_Concentration"                  />
+          <field field_ref="SMS_CFC12_E3T" name="SMS_CFC12_E3T" standard_name="CFC-12_Concentration"                  />
+   </field_group>
+
+    <field_group id="trendSF6_cmip6" >
+          <!-- sf6 -->
+          <field field_ref="TOT_SF6_E3T"  name="TOT_SF6_E3T"  standard_name="SF6_Concentration"                     />
+          <field field_ref="SMS_SF6_E3T"  name="SMS_SF6_E3T"  standard_name="SF6_Concentration"                     />
+   </field_group>
+
+    <field_group id="trendAGE_cmip6" >
+          <!-- age -->
+          <field field_ref="TOT_Age_E3T"  name="TOT_Age_E3T"  standard_name="sea_water_age_since_surface_contact"   />
+          <field field_ref="SMS_Age_E3T"  name="SMS_Age_E3T"  standard_name="sea_water_age_since_surface_contact"   />
+   </field_group>
+
+    <field_group id="trendIDTRA_cmip6" >
+          <!-- Ideal tracer -->
+          <field field_ref="TOT_IDTRA_E3T"  name="TOT_IDTRA_E3T"  standard_name="IDTRA_Concentration"               />
+          <field field_ref="SMS_IDTRA_E3T"  name="SMS_IDTRA_E3T"  standard_name="IDTRA_Concentration"               />
+   </field_group>
+
+    <field_group id="trendC14B_cmip6" >
+          <!-- c14 bomb -->
+          <field field_ref="TOT_C14B_E3T"  name="TOT_C14B_E3T"  standard_name="C14b_Concentration"               />
+          <field field_ref="SMS_C14B_E3T"  name="SMS_C14B_E3T"  standard_name="C14b_Concentration"               />
+   </field_group>
+
+    <field_group id="trendCFC11_cmip6_inv" >
+          <!-- cfc11 -->
           <field field_ref="TOT_CFC11_INV" name="TOT_CFC11_INV" standard_name="CFC-11_Concentration"                  />
-          <field field_ref="SMS_CFC11_E3T" name="SMS_CFC11_E3T" standard_name="CFC-11_Concentration"                  />
           <field field_ref="SMS_CFC11_INV" name="SMS_CFC11_INV" standard_name="CFC-11_Concentration"                  />
    </field_group>
 
-    <field_group id="trendCFC12_short" >
+    <field_group id="trendCFC12_cmip6_inv" >
           <!-- cfc12 -->
-          <field field_ref="TOT_CFC12_E3T" name="TOT_CFC12_E3T" standard_name="CFC-12_Concentration"                  />
           <field field_ref="TOT_CFC12_INV" name="TOT_CFC12_INV" standard_name="CFC-12_Concentration"                  />
-          <field field_ref="SMS_CFC12_E3T" name="SMS_CFC12_E3T" standard_name="CFC-12_Concentration"                  />
           <field field_ref="SMS_CFC12_INV" name="SMS_CFC12_INV" standard_name="CFC-12_Concentration"                  />
    </field_group>
 
-    <field_group id="trendSF6_short" >
+    <field_group id="trendSF6_cmip6_inv" >
           <!-- sf6 -->
-          <field field_ref="TOT_SF6_E3T"  name="TOT_SF6_E3T"  standard_name="SF6_Concentration"                     />
           <field field_ref="TOT_SF6_INV"  name="TOT_SF6_INV"  standard_name="SF6_Concentration"                     />
-          <field field_ref="SMS_SF6_E3T"  name="SMS_SF6_E3T"  standard_name="SF6_Concentration"                     />
           <field field_ref="SMS_SF6_INV"  name="SMS_SF6_INV"  standard_name="SF6_Concentration"                     />
    </field_group>
 
-    <field_group id="trendAGE_short" >
+    <field_group id="trendAGE_cmip6_inv" >
           <!-- age -->
-          <field field_ref="TOT_Age_E3T"  name="TOT_Age_E3T"  standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="TOT_Age_INV"  name="TOT_Age_INV"  standard_name="sea_water_age_since_surface_contact"   />
-          <field field_ref="SMS_Age_E3T"  name="SMS_Age_E3T"  standard_name="sea_water_age_since_surface_contact"   />
           <field field_ref="SMS_Age_INV"  name="SMS_Age_INV"  standard_name="sea_water_age_since_surface_contact"   />
    </field_group>
 
-    <field_group id="trendIDTRA_short" >
+    <field_group id="trendIDTRA_cmip6_inv" >
           <!-- Ideal tracer -->
-          <field field_ref="TOT_IDTRA_E3T"  name="TOT_IDTRA_E3T"  standard_name="IDTRA_Concentration"               />
           <field field_ref="TOT_IDTRA_INV"  name="TOT_IDTRA_INV"  standard_name="IDTRA_Concentration"               />
-          <field field_ref="SMS_IDTRA_E3T"  name="SMS_IDTRA_E3T"  standard_name="IDTRA_Concentration"               />
           <field field_ref="SMS_IDTRA_INV"  name="SMS_IDTRA_INV"  standard_name="IDTRA_Concentration"               />
    </field_group>
 
-    <field_group id="trendC14B_short" >
+    <field_group id="trendC14B_cmip6_inv" >
           <!-- c14 bomb -->
-          <field field_ref="TOT_C14B_E3T"  name="TOT_C14B_E3T"  standard_name="C14b_Concentration"               />
           <field field_ref="TOT_C14B_INV"  name="TOT_C14B_INV"  standard_name="C14b_Concentration"               />
-          <field field_ref="SMS_C14B_E3T"  name="SMS_C14B_E3T"  standard_name="C14b_Concentration"               />
           <field field_ref="SMS_C14B_INV"  name="SMS_C14B_INV"  standard_name="C14b_Concentration"               />
    </field_group>
@@ -2421,4 +2410,17 @@
     </field_group>
 
+    <field_group id="groupMEDUSA_cmip6_duplicates" >
+      <field field_ref= "FBDDTALK"   name="FBDDTALK"   />
+      <field field_ref= "FBDDTDIC"   name="FBDDTDIC"   />
+      <field field_ref= "FBDDTDIFE"  name="FBDDTDIFE"  />
+      <field field_ref= "FBDDTDIN"   name="FBDDTDIN"   />
+      <field field_ref= "FBDDTDISI"  name="FBDDTDISI"  />
+      <field field_ref= "BDDTALK3"   name="BDDTALK3"   />
+      <field field_ref= "BDDTDIC3"   name="BDDTDIC3"   />
+      <field field_ref= "BDDTDIFE3"  name="BDDTDIFE3"  />
+      <field field_ref= "BDDTDIN3"   name="BDDTDIN3"   />
+      <field field_ref= "BDDTDISI3"  name="BDDTDISI3"  />
+    </field_group>
+
     <field_group id="groupMEDUSA_cmip6" >
       <field field_ref= "epC100"     name="epC100"     />
@@ -2432,15 +2434,5 @@
       <field field_ref= "O2min"      name="O2min"      />
       <field field_ref= "ZO2min"     name="ZO2min"     />
-      <field field_ref= "FBDDTALK"   name="FBDDTALK"   />
-      <field field_ref= "FBDDTDIC"   name="FBDDTDIC"   />
-      <field field_ref= "FBDDTDIFE"  name="FBDDTDIFE"  />
-      <field field_ref= "FBDDTDIN"   name="FBDDTDIN"   />
-      <field field_ref= "FBDDTDISI"  name="FBDDTDISI"  />
       <field field_ref= "TPPD3"      name="TPPD3"      />
-      <field field_ref= "BDDTALK3"   name="BDDTALK3"   />
-      <field field_ref= "BDDTDIC3"   name="BDDTDIC3"   />
-      <field field_ref= "BDDTDIFE3"  name="BDDTDIFE3"  />
-      <field field_ref= "BDDTDIN3"   name="BDDTDIN3"   />
-      <field field_ref= "BDDTDISI3"  name="BDDTDISI3"  />
       <field field_ref= "FD_NIT3"    name="FD_NIT3"    />
       <field field_ref= "FD_SIL3"    name="FD_SIL3"    />
Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/CONFIG/SHARED/xco2.atm
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/CONFIG/SHARED/xco2.atm	(revision 9351)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/CONFIG/SHARED/xco2.atm	(revision 9351)
@@ -0,0 +1,166 @@
+% Data source is Meinshausen et al., GMD, doi:10.5194/gmd-10-2057-2017, 2017
+%      
+% Year  xCO2
+%       (ppm)
+1849.5  284.3170000
+1850.5  284.3169999
+1851.5  284.4509998
+1852.5  284.5979998
+1853.5  284.7309998
+1854.5  284.8459998
+1855.5  284.9409998
+1856.5  285.0489998
+1857.5  285.2039998
+1858.5  285.3689998
+1859.5  285.5449998
+1860.5  285.7389997
+1861.5  285.9329997
+1862.5  286.0999997
+1863.5  286.2709997
+1864.5  286.4419997
+1865.5  286.6139996
+1866.5  286.7809996
+1867.5  286.9549996
+1868.5  287.1049996
+1869.5  287.2249996
+1870.5  287.3549996
+1871.5  287.4939995
+1872.5  287.6639995
+1873.5  287.8599995
+1874.5  288.0609995
+1875.5  288.2909994
+1876.5  288.5199994
+1877.5  288.7519994
+1878.5  288.9929994
+1879.5  289.2209994
+1880.5  289.4699993
+1881.5  289.7369993
+1882.5  290.0189993
+1883.5  290.2629992
+1884.5  290.5119992
+1885.5  290.7969992
+1886.5  291.0999992
+1887.5  291.4139991
+1888.5  291.7629991
+1889.5  292.1129991
+1890.5  292.4579990
+1891.5  292.8159990
+1892.5  293.1669989
+1893.5  293.4769989
+1894.5  293.7909989
+1895.5  294.0789989
+1896.5  294.3649988
+1897.5  294.6459988
+1898.5  294.9539987
+1899.5  295.2999986
+1900.5  295.6749984
+1901.5  296.0069980
+1902.5  296.3249974
+1903.5  296.6539968
+1904.5  296.9539963
+1905.5  297.2889957
+1906.5  297.6619951
+1907.5  298.0979945
+1908.5  298.5179940
+1909.5  298.9359935
+1910.5  299.3769929
+1911.5  299.8289923
+1912.5  300.3529917
+1913.5  300.9099911
+1914.5  301.4189908
+1915.5  301.9369903
+1916.5  302.4849897
+1917.5  303.0109891
+1918.5  303.4489886
+1919.5  303.8139883
+1920.5  304.2459877
+1921.5  304.5999873
+1922.5  304.9449868
+1923.5  305.2709861
+1924.5  305.6299855
+1925.5  305.8129850
+1926.5  305.9539845
+1927.5  306.1769839
+1928.5  306.3289833
+1929.5  306.4949827
+1930.5  306.6199824
+1931.5  306.8219821
+1932.5  307.0929818
+1933.5  307.4019813
+1934.5  307.7849806
+1935.5  308.2269800
+1936.5  309.0119793
+1937.5  309.7639786
+1938.5  310.2939782
+1939.5  310.8509776
+1940.5  311.3569769
+1941.5  311.8109763
+1942.5  312.1719757
+1943.5  312.3899752
+1944.5  312.4129748
+1945.5  312.3849746
+1946.5  312.3899740
+1947.5  312.4859732
+1948.5  312.5209725
+1949.5  312.6319721
+1950.5  312.8209713
+1951.5  313.0139706
+1952.5  313.3419700
+1953.5  313.7299694
+1954.5  314.0949688
+1955.5  314.4149680
+1956.5  314.6979672
+1957.5  314.9919665
+1958.5  315.3449659
+1959.5  315.8069651
+1960.5  316.6249644
+1961.5  317.2989638
+1962.5  318.0439631
+1963.5  318.6499622
+1964.5  319.3329614
+1965.5  319.8159605
+1966.5  320.8799597
+1967.5  321.4799589
+1968.5  322.3889580
+1969.5  323.2509570
+1970.5  324.7829559
+1971.5  325.3999550
+1972.5  327.3489541
+1973.5  329.9089531
+1974.5  330.7559525
+1975.5  330.8269520
+1976.5  331.5449510
+1977.5  333.3529501
+1978.5  335.0099494
+1979.5  336.6049484
+1980.5  338.7049479
+1981.5  340.0589478
+1982.5  340.6439474
+1983.5  342.2659473
+1984.5  344.0079495
+1985.5  345.4589538
+1986.5  346.9029481
+1987.5  348.7749474
+1988.5  351.2759329
+1989.5  352.8939214
+1990.5  354.0729301
+1991.5  355.3529349
+1992.5  356.2289489
+1993.5  356.9249589
+1994.5  358.2539622
+1995.5  360.2389564
+1996.5  362.0049615
+1997.5  363.2519618
+1998.5  365.9329580
+1999.5  367.8449748
+2000.5  369.1249800
+2001.5  370.6729901
+2002.5  372.8349943
+2003.5  375.4109950
+2004.5  376.9870025
+2005.5  378.9070050
+2006.5  381.0100070
+2007.5  382.6030247
+2008.5  384.7390186
+2009.5  386.2800190
+2010.5  388.7170293
Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90	(revision 9350)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90	(revision 9351)
@@ -153,14 +153,11 @@
             IF (tmask(ji,jj,1) == 1) then
                IF (lk_oasis) THEN
-                  !! use 2D atm xCO2 from atm coupling
-                  f_xco2a(ji,jj) = PCO2a_in_cpl(ji,jj)
-                  !!! 
                   !!! Jpalm test on atm xCO2
-                  IF ( (f_xco2a(ji,jj) > 1500.0 ).OR.(f_xco2a(ji,jj) < 100.0 ) ) THEN
+                  IF ( (f_xco2a(ji,jj) .GT. 10000.0 ).OR.(f_xco2a(ji,jj) .LE. 0.0 ) ) THEN
                     IF(lwp) THEN 
                        WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj),          &
                                        ' -- ji =', mig(ji),' jj = ', mjg(jj)
                     ENDIF
-                    CALL ctl_stop( 'MEDUSA - Air-Sea :', 'unrealistic atm xCO2 ' )
+                    CALL ctl_stop( 'MEDUSA - Air-Sea :', 'unrealistic coupled atm xCO2 ' )
                  ENDIF 
                ENDIF
@@ -261,28 +258,36 @@
                !!          must be associated to air-sea flux or air xCO2...
                !!          Check MOCSY outputs
-              IF ( (f_pco2w(ji,jj) > 1.E4 ).OR.(f_pco2w(ji,jj) < 0.0 ) .OR.     &
-                   (f_fco2w(ji,jj) > 1.E4 ).OR.(f_fco2w(ji,jj) < 0.0 ) .OR.     &   
-                   (f_fco2atm(ji,jj) > 1.E4 ).OR.(f_fco2atm(ji,jj) < 0.0 ) .OR.     &
-                   (f_co2flux(ji,jj) > 1.E-2 ).OR.(f_co2flux(ji,jj) < -1.E-2 ) .OR.     &
-                   (f_dpco2(ji,jj) > 1.E4 ).OR.(f_dpco2(ji,jj) < -1.E4 ) ) THEN
-                 IF(lwp) THEN 
-                     WRITE(numout,*) ' surface T = ',ztmp(ji,jj)
-                     WRITE(numout,*) ' surface S = ',zsal(ji,jj)
-                     WRITE(numout,*) ' surface ALK = ',zalk(ji,jj)
-                     WRITE(numout,*) ' surface DIC = ',zdic(ji,jj)
-                     WRITE(numout,*) ' KW660 = ',f_kw660(ji,jj)
-                     WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj)   
-                     WRITE(numout,*) ' surface pco2w  = ',f_pco2w(ji,jj)
-                     WRITE(numout,*) ' surface fco2w  = ',f_fco2w(ji,jj)
-                     WRITE(numout,*) ' surface fco2a  = ',f_fco2atm(ji,jj)
-                     WRITE(numout,*) ' surface co2flx = ',f_co2flux(ji,jj)
-                     WRITE(numout,*) ' surface dpco2  = ',f_dpco2(ji,jj)
-                     WRITE(numout,*) ' MOCSY output: ji =', mig(ji),' jj = ', mjg(jj),  &
-                                       ' kt = ', kt     
-                     WRITE(numout,*) 'MEDUSA - Air-Sea OUTPUT: unrealistic surface Carb. Chemistry'
-                 ENDIF     
-                 CALL ctl_stop( 'MEDUSA - Air-Sea OUTPUT: ',            &
-                                'unrealistic surface Carb. Chemistry -- OUTPUTS' )
-              ENDIF     
+               !!===================
+               !! Jpalm -- 19-02-2018 -- remove the cap - only check MOCSY inputs
+               !!       because of specific area in arabic sea where strangely
+               !!       with core 2 forcing, ALK is lower than DIC and result in 
+               !!       Enormous dpco2 - even if all carb chem caract are OK.
+               !!       and this check stops the model.
+               !!       ==> let's run the model without it and see how it goes.
+               !!===================
+               !!IF ( (f_pco2w(ji,jj) > 1.E4 ).OR.(f_pco2w(ji,jj) < 0.0 ) .OR.     &
+               !!    (f_fco2w(ji,jj) > 1.E4 ).OR.(f_fco2w(ji,jj) < 0.0 ) .OR.     &   
+               !!    (f_fco2atm(ji,jj) > 1.E4 ).OR.(f_fco2atm(ji,jj) < 0.0 ) .OR.     &
+               !!    (f_co2flux(ji,jj) > 1.E-1 ).OR.(f_co2flux(ji,jj) < -1.E-1 ) .OR.     &
+               !!    (f_dpco2(ji,jj) > 1.E4 ).OR.(f_dpco2(ji,jj) < -1.E4 ) ) THEN
+               !!  IF(lwp) THEN 
+               !!      WRITE(numout,*) ' surface T = ',ztmp(ji,jj)
+               !!      WRITE(numout,*) ' surface S = ',zsal(ji,jj)
+               !!      WRITE(numout,*) ' surface ALK = ',zalk(ji,jj)
+               !!      WRITE(numout,*) ' surface DIC = ',zdic(ji,jj)
+               !!      WRITE(numout,*) ' KW660 = ',f_kw660(ji,jj)
+               !!      WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj)   
+               !!      WRITE(numout,*) ' surface pco2w  = ',f_pco2w(ji,jj)
+               !!      WRITE(numout,*) ' surface fco2w  = ',f_fco2w(ji,jj)
+               !!      WRITE(numout,*) ' surface fco2a  = ',f_fco2atm(ji,jj)
+               !!      WRITE(numout,*) ' surface co2flx = ',f_co2flux(ji,jj)
+               !!      WRITE(numout,*) ' surface dpco2  = ',f_dpco2(ji,jj)
+               !!      WRITE(numout,*) ' MOCSY output: ji =', mig(ji),' jj = ', mjg(jj),  &
+               !!                        ' kt = ', kt     
+               !!      WRITE(numout,*) 'MEDUSA - Air-Sea OUTPUT: unrealistic surface Carb. Chemistry'
+               !!  ENDIF     
+               !!  CALL ctl_stop( 'MEDUSA - Air-Sea OUTPUT: ',            &
+               !!                 'unrealistic surface Carb. Chemistry -- OUTPUTS' )
+               !!ENDIF     
             ENDIF
          ENDDO
Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/carb_chem.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/carb_chem.F90	(revision 9350)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/carb_chem.F90	(revision 9351)
@@ -103,8 +103,4 @@
                !! OPEN wet point IF..THEN loop
                IF (tmask(ji,jj,jk).eq.1) THEN
-                  IF (lk_oasis) THEN
-                     !! use 2D atm xCO2 from atm coupling
-                     f_xco2a(ji,jj) = PCO2a_in_cpl(ji,jj)
-                  ENDIF
                   !! Do carbonate chemistry
                   !!
Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90	(revision 9350)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90	(revision 9351)
@@ -283,112 +283,20 @@
 #if defined key_roam
 !!----------------------------------------------------------------------
-!! Atmospheric pCO2 data (1859 to 2100 inclusive)
-!!----------------------------------------------------------------------
-!!
-   REAL(wp), DIMENSION(242)         ::   hist_pco2 !: pCO2
-
-# if defined key_rcp26
-      !! UKMO, run AJKKH + KAAEC, RCP 2.6, pCO2 time evolution
-      DATA hist_pco2 / 286.0230, 286.1730, 286.3230, 286.4480, 286.5730, &
-      & 286.7230, 286.8480, 286.9480, 287.0480, 287.1730, &
-      & 287.3230, 287.4730, 287.6480, 287.8480, 288.0730, &
-      & 288.3480, 288.6480, 288.9730, 289.3470, 289.7470, &
-      & 290.1730, 290.6470, 291.1470, 291.6220, 292.0720, &
-      & 292.5220, 292.9220, 293.2470, 293.5220, 293.7470, &
-      & 293.9470, 294.1220, 294.2720, 294.4220, 294.5470, &
-      & 294.6470, 294.7470, 294.8470, 294.9710, 295.1710, &
-      & 295.4460, 295.7470, 296.0720, 296.4210, 296.7710, &
-      & 297.1460, 297.5710, 298.0210, 298.4460, 298.8460, &
-      & 299.2460, 299.6450, 300.0210, 300.3710, 300.7200, &
-      & 301.0450, 301.3460, 301.6710, 302.0200, 302.3450, &
-      & 302.6450, 302.9700, 303.3450, 303.7200, 304.0700, &
-      & 304.4700, 304.9200, 305.3440, 305.7700, 306.2450, &
-      & 306.7190, 307.1700, 307.6440, 308.1190, 308.5440, &
-      & 308.9440, 309.3440, 309.6940, 309.9440, 310.1190, &
-      & 310.2440, 310.3190, 310.3190, 310.2440, 310.1440, &
-      & 310.0690, 310.0440, 310.0690, 310.1440, 310.2690, &
-      & 310.4440, 310.6940, 311.0430, 311.4440, 311.8690, &
-      & 312.3680, 312.9430, 313.5430, 314.1680, 314.7900, &
-      & 315.4430, 316.2150, 317.0170, 317.7370, 318.3400, &
-      & 318.8680, 319.5900, 320.5890, 321.5470, 322.5770, &
-      & 323.8440, 324.9260, 325.7960, 327.0810, 328.6180, &
-      & 329.6830, 330.5250, 331.6880, 333.2120, 334.7870, &
-      & 336.4640, 338.2990, 339.6660, 340.7310, 342.1360, &
-      & 343.7200, 345.2200, 346.7350, 348.5820, 350.6740, &
-      & 352.4230, 353.7910, 354.9530, 355.8210, 356.7130, &
-      & 358.0630, 359.7720, 361.3970, 363.0900, 365.2560, &
-      & 367.2810, 368.7980, 370.4000, 372.4550, 374.6920, &
-      & 376.7440, 378.7440, 380.7580, 382.7080, 384.7300, &
-      & 386.9310, 389.2150, 391.4910, 393.7710, 396.0460, &
-      & 398.3240, 400.6080, 402.8950, 405.1780, 407.4550, &
-      & 409.7260, 411.9930, 414.2500, 416.4410, 418.5280, &
-      & 420.5250, 422.4390, 424.2720, 426.0200, 427.6750, &
-      & 429.2360, 430.7050, 432.0850, 433.3580, 434.5140, &
-      & 435.5740, 436.5490, 437.4420, 438.2550, 438.9810, &
-      & 439.6110, 440.1430, 440.5770, 440.9450, 441.2660, &
-      & 441.5410, 441.7840, 442.0050, 442.2040, 442.3780, &
-      & 442.5210, 442.6200, 442.6720, 442.6810, 442.6540, &
-      & 442.5830, 442.4670, 442.3270, 442.1680, 441.9960, &
-      & 441.8060, 441.5930, 441.3440, 441.0540, 440.7230, &
-      & 440.3510, 439.9300, 439.4650, 438.9730, 438.4630, &
-      & 437.9400, 437.4020, 436.8400, 436.2640, 435.6850, &
-      & 435.1030, 434.5160, 433.9170, 433.3060, 432.7010, &
-      & 432.1110, 431.5380, 430.9810, 430.4320, 429.8860, &
-      & 429.3370, 428.7810, 428.2220, 427.6490, 427.0660, &
-      & 426.4890, 425.9270, 425.3840, 424.8610, 424.3540, &
-      & 423.8540, 423.3540, 422.8530, 422.3510, 421.8410, &
-      & 421.3250, 420.8190 /
-# else
-      !! UKMO, run AJKKH + KAAEF, RCP 8.5, pCO2 time evolution
-      DATA hist_pco2 / 286.0230, 286.1730, 286.3230, 286.4480, 286.5730, &
-      & 286.7230, 286.8480, 286.9480, 287.0480, 287.1730, &
-      & 287.3230, 287.4730, 287.6480, 287.8480, 288.0730, &
-      & 288.3480, 288.6480, 288.9730, 289.3470, 289.7470, &
-      & 290.1730, 290.6470, 291.1470, 291.6220, 292.0720, &
-      & 292.5220, 292.9220, 293.2470, 293.5220, 293.7470, &
-      & 293.9470, 294.1220, 294.2720, 294.4220, 294.5470, &
-      & 294.6470, 294.7470, 294.8470, 294.9710, 295.1710, &
-      & 295.4460, 295.7470, 296.0720, 296.4210, 296.7710, &
-      & 297.1460, 297.5710, 298.0210, 298.4460, 298.8460, &
-      & 299.2460, 299.6450, 300.0210, 300.3710, 300.7200, &
-      & 301.0450, 301.3460, 301.6710, 302.0200, 302.3450, &
-      & 302.6450, 302.9700, 303.3450, 303.7200, 304.0700, &
-      & 304.4700, 304.9200, 305.3440, 305.7700, 306.2450, &
-      & 306.7190, 307.1700, 307.6440, 308.1190, 308.5440, &
-      & 308.9440, 309.3440, 309.6940, 309.9440, 310.1190, &
-      & 310.2440, 310.3190, 310.3190, 310.2440, 310.1440, &
-      & 310.0690, 310.0440, 310.0690, 310.1440, 310.2690, &
-      & 310.4440, 310.6940, 311.0430, 311.4440, 311.8690, &
-      & 312.3680, 312.9430, 313.5430, 314.1680, 314.7900, &
-      & 315.4430, 316.2150, 317.0170, 317.7370, 318.3400, &
-      & 318.8680, 319.5900, 320.5890, 321.5470, 322.5770, &
-      & 323.8440, 324.9260, 325.7960, 327.0810, 328.6180, &
-      & 329.6830, 330.5250, 331.6880, 333.2120, 334.7870, &
-      & 336.4640, 338.2990, 339.6660, 340.7310, 342.1360, &
-      & 343.7200, 345.2200, 346.7350, 348.5820, 350.6740, &
-      & 352.4230, 353.7910, 354.9530, 355.8210, 356.7130, &
-      & 358.0630, 359.7720, 361.3970, 363.0900, 365.2560, &
-      & 367.2810, 368.7980, 370.4000, 372.4550, 374.6920, &
-      & 376.7440, 378.7440, 380.7580, 382.7080, 384.7300, &
-      & 386.9420, 389.2540, 391.5670, 393.9370, 396.3920, &
-      & 398.9320, 401.5550, 404.2550, 407.0220, 409.8530, &
-      & 412.7470, 415.7050, 418.7210, 421.7880, 424.9180, &
-      & 428.1200, 431.3970, 434.7470, 438.1650, 441.6410, &
-      & 445.1700, 448.7530, 452.3920, 456.0950, 459.8810, &
-      & 463.7680, 467.7660, 471.8750, 476.0960, 480.4210, &
-      & 484.8390, 489.3470, 493.9430, 498.6400, 503.4380, &
-      & 508.3410, 513.3630, 518.5160, 523.8050, 529.2290, &
-      & 534.7780, 540.4450, 546.2230, 552.1120, 558.1110, &
-      & 564.2110, 570.4130, 576.7390, 583.1990, 589.7980, &
-      & 596.5390, 603.4110, 610.4060, 617.4940, 624.6500, &
-      & 631.8800, 639.1750, 646.5360, 653.9800, 661.5230, &
-      & 669.1840, 676.9570, 684.8290, 692.7790, 700.7690, &
-      & 708.8050, 716.8870, 725.0020, 733.1770, 741.3900, &
-      & 749.6700, 758.0480, 766.5050, 775.0350, 783.6110, &
-      & 792.2200, 800.8740, 809.5680, 818.2760, 827.0090, &
-      & 835.8020, 844.6550, 853.5730, 862.5690, 871.6190, &
-      & 880.7020, 889.8240, 898.9590, 908.1270, 917.3080, &
-      & 926.4960, 935.7040 /
-# endif
+!! JPALM -- change hist_pco2 init
+!!----------------------------------------------------------------------
+!!
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   ::   hist_pco2 !: pCO2
+   INTEGER  :: co2_rec
+   REAL(wp) :: co2_yinit, co2_yend
+#endif
+
+!!----------------------------------------------------------------------
+!! JPALM -- PI CO2 key
+!!----------------------------------------------------------------------
+!!
+#if defined key_axy_pi_co2
+   LOGICAL , PUBLIC ::   lk_pi_co2 = .TRUE.  !: PI xCO2 used
+#else
+   LOGICAL , PUBLIC ::   lk_pi_co2 = .FALSE. !: PI xCO2 unused
 #endif
 
Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 9350)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 9351)
@@ -81,5 +81,7 @@
                                             gdept_0, gdept_n,               &
                                             gdepw_0, gdepw_n,               &
-                                            nday_year, nsec_day, nyear,     &
+                                            nday_year, nsec_day,            &
+                                            nyear, nyear_len, ndastp,       &
+                                            nsec_month,                     &
                                             rdt, tmask, mig, mjg, nimpp,    &
                                             njmpp 
@@ -92,5 +94,5 @@
                                             mpp_min, mpp_minloc,            &
                                             ctl_stop, ctl_warn, lk_mpp  
-      USE oce,                        ONLY: tsb, tsn
+      USE oce,                        ONLY: tsb, tsn, PCO2a_in_cpl
       USE par_kind,                   ONLY: wp
       USE par_medusa,                 ONLY: jpalk, jpchd, jpchn, jpdet,     &
@@ -102,5 +104,6 @@
       !! JPALM (27-06-2016): add lk_oasis for CO2 and DMS coupling with atm
       USE sbc_oce,                    ONLY: lk_oasis
-      USE sms_medusa,                 ONLY: hist_pco2
+      USE sms_medusa,                 ONLY: hist_pco2, co2_yinit, co2_yend, &
+                                            lk_pi_co2
       USE trc,                        ONLY: ln_rsttr, nittrc000, trn
       USE bio_medusa_init_mod,        ONLY: bio_medusa_init
@@ -114,4 +117,5 @@
       USE bio_medusa_diag_slice_mod,  ONLY: bio_medusa_diag_slice
       USE bio_medusa_fin_mod,         ONLY: bio_medusa_fin
+      USE trcstat,                    ONLY: trc_rst_dia_stat
 
       IMPLICIT NONE
@@ -181,5 +185,6 @@
       !! 
       !! temporary variables
-      REAL(wp) ::    fq0,fq1,fq2,fq3,fq4
+      REAL(wp) ::    fq3,fq4
+      REAL(wp) ::    this_y, this_d, this_s, fyear
       !!
       !! T and S check temporary variable
@@ -293,44 +298,64 @@
       !!------------------------------------------------------------------
       !!
-      !! what's atmospheric pCO2 doing? (data start in 1859)
-      iyr1  = nyear - 1859 + 1
-      iyr2  = iyr1 + 1
-      if (iyr1 .le. 1) then
-         !! before 1860
-         f_xco2a(:,:) = hist_pco2(1)
-      elseif (iyr2 .ge. 242) then
-         !! after 2099
-         f_xco2a(:,:) = hist_pco2(242)
-      else
-         !! just right
-         fq0 = hist_pco2(iyr1)
-         fq1 = hist_pco2(iyr2)
-         fq2 = real(nsec_day) / (60.0 * 60.0 * 24.0)
-         !! AXY (14/06/12): tweaked to make more sense (and be correct)
-#  if defined key_bs_axy_yrlen
-         !! bugfix: for 360d year with HadGEM2-ES forcing
-         fq3 = (real(nday_year) - 1.0 + fq2) / 360.0  
-#  else
-         !! original use of 365 days (not accounting for leap year or 
-         !! 360d year)
-         fq3 = (real(nday_year) - 1.0 + fq2) / 365.0
-#  endif
-         fq4 = (fq0 * (1.0 - fq3)) + (fq1 * fq3)
-         f_xco2a(:,:) = fq4
-      endif
-#  if defined key_axy_pi_co2
-      !! OCMIP pre-industrial pCO2
-      !! f_xco2a(:,:) = 284.725  !! CMIP5 pre-industrial pCO2
-      f_xco2a = 284.317          !! CMIP6 pre-industrial pCO2 
-#  endif
-      !! IF(lwp) WRITE(numout,*) ' MEDUSA nyear     =', nyear
-      !! IF(lwp) WRITE(numout,*) ' MEDUSA nsec_day  =', real(nsec_day)
-      !! IF(lwp) WRITE(numout,*) ' MEDUSA nday_year =', real(nday_year)
-      !! AXY (29/01/14): remove surplus diagnostics
-      !! IF(lwp) WRITE(numout,*) ' MEDUSA fq0       =', fq0
-      !! IF(lwp) WRITE(numout,*) ' MEDUSA fq1       =', fq1
-      !! IF(lwp) WRITE(numout,*) ' MEDUSA fq2       =', fq2
-      !! IF(lwp) WRITE(numout,*) ' MEDUSA fq3       =', fq3
-      IF(lwp) WRITE(numout,*) ' MEDUSA atm pCO2  =', f_xco2a(1,1)
+      IF (lk_oasis) THEN 
+         !! xCO2 from coupled
+         IF ( ( kt == nittrc000 ) .AND. lwp )     &
+             WRITE(numout,*) '** MEDUSA Atm xCO2 given by the UM **'
+         f_xco2a(:,:) = PCO2a_in_cpl(:,:)
+      ELSEIF (lk_pi_co2) THEN
+         !! OCMIP pre-industrial xCO2
+         IF ( ( kt == nittrc000 ) .AND. lwp )     &
+             WRITE(numout,*) '** MEDUSA Atm xCO2 fixed to pre-industrial value **'
+         !! f_xco2a(:,:) = 284.725       !! CMIP5 pre-industrial pCO2
+         f_xco2a(:,:) = 284.317          !! CMIP6 pre-industrial pCO2 
+      ELSE      
+         !! xCO2 from file
+         !! AXY - JPALM new interpolation scheme usinf nyear_len
+         this_y = real(nyear)
+         this_d = real(nday_year)
+         this_s = real(nsec_day)
+         !!
+         fyear = this_y + ((this_d - 1) + (this_s / (60. * 60. * 24.))) / real(nyear_len(1))
+         !!
+         IF ( ( kt == nittrc000 ) .AND. lwp ) THEN 
+            WRITE(numout,*) '** MEDUSA Atm xCO2 from file **'
+            WRITE(numout,*) ' MEDUSA year      =', this_y
+            WRITE(numout,*) ' Year length      =', real(nyear_len(1))
+            WRITE(numout,*) ' MEDUSA nday_year =', this_d
+            WRITE(numout,*) ' MEDUSA nsec_day  =', this_s
+         ENDIF
+         !! 
+         !! different case test 
+         IF (fyear .LE. co2_yinit) THEN
+            !! before first record -- pre-industrial value
+            f_xco2a(:,:) = hist_pco2(1)  
+         ELSEIF (fyear .GE. co2_yend) THEN
+            !! after last record - continue to use the last value
+            f_xco2a(:,:) = hist_pco2(int(co2_yend - co2_yinit + 1.) )
+         ELSE
+            !! just right
+            iyr1 = int(fyear - co2_yinit) + 1
+            iyr2 = iyr1 + 1 
+            fq3 = fyear - real(iyr1) - co2_yinit + 1.
+            fq4 = ((1 - fq3) * hist_pco2(iyr1)) + (fq3 * hist_pco2(iyr2))
+            f_xco2a(:,:) = fq4
+            !!
+            IF ( ( kt == nittrc000 ) .AND. lwp ) THEN 
+               WRITE(numout,*) ' MEDUSA year1     =', iyr1
+               WRITE(numout,*) ' MEDUSA year2     =', iyr2
+               WRITE(numout,*) ' xCO2 year1       =', hist_pco2(iyr1)
+               WRITE(numout,*) ' xCO2 year2       =', hist_pco2(iyr2)
+               WRITE(numout,*) ' Year2 weight     =', fq3
+            ENDIF
+         ENDIF
+      ENDIF
+ 
+      !! Writing xCO2 in output on start and on the 1st tsp of each  month
+      IF ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                        &
+           ( nsec_month .LE. INT(rdt) ) )  THEN
+           IF ( lwp )  WRITE(numout,*) ' *** Atm xCO2 *** -- kt:', kt,       &
+                                       ';  current date:', ndastp
+          call trc_rst_dia_stat(f_xco2a(:,:), 'atm xCO2')
+      ENDIF
 # endif
 
@@ -358,6 +383,23 @@
       !!          x * 30d + 1*rdt(i.e: mod = rdt)   
       !!          ++ need to pass carb-chem output var through restarts
-      If ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                        &
-           ((86400*mod(nn_date0,100) + mod(kt*rdt,2592000.)) == rdt) ) THEN
+      !!If ( (kt == nitt8rc000 .AND. .NOT.ln_rsttr) .OR.          &
+      !!     ( (mod(kt*rdt,2592000.)) == rdt) THEN
+      !!=============================
+      !! (Jpalm -- updated for restartability issues)
+      !! We want this to be start of month or if starting afresh from  
+      !! climatology - marc 20/6/17 
+      !!If ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                         & 
+      !!     ((86400*mod(nn_date0,100) + mod(kt*rdt,2592000.)) == rdt) ) THEN 
+      !!=============================
+      !! Jpalm -- 15-02-2018 -- need to change 3D carb-chem call freq again.
+      !! previous call did not work, probably the (86400*mod(nn_date0,100) part
+      !! should not be in...
+      !! now use the NEMO calendar tool : nsec_month to be sure to call 
+      !! at the beginning of a new month .
+      IF ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                        &
+           ( nsec_month .LE. INT(rdt) ) )  THEN
+           IF ( lwp )  WRITE(numout,*)                                       &         
+                              ' *** 3D carb chem call *** -- kt:', kt,       &
+                              ';  current date:', ndastp 
          !!---------------------------------------------------------------
          !! Calculate the carbonate chemistry for the whole ocean on the first
@@ -502,5 +544,5 @@
          !!              Exceptionnal value did exist
          !!
-         Call trc_bio_check(kt)
+         Call trc_bio_check(kt, jk)
 
          !!================================================================
@@ -810,5 +852,5 @@
    END SUBROUTINE trc_bio_exceptionnal_fix 
 
-   SUBROUTINE trc_bio_check(kt)
+   SUBROUTINE trc_bio_check(kt, jk)
       !!-----------------------------------
       !! JPALM -- 14-12-2017 -- Still dealing with this micro-boil/carb failure
@@ -824,5 +866,5 @@
       INTEGER               :: ii,ij         ! temporary scalars 
       INTEGER, DIMENSION(2) :: ilocs         ! 
-      INTEGER, INTENT( in ) :: kt
+      INTEGER, INTENT( in ) :: kt, jk
       !!
       !!==========================
@@ -852,6 +894,6 @@
          IF(lwp) THEN
             WRITE(numout,*) 'trc_bio:tracer anomaly: *****    WARNING     *****'
-            WRITE(numout,*) 'trc_bio:tracer anomaly: sea surface DIC > 4000 '
-            WRITE(numout,9600) kt, zmax, ii, ij
+            WRITE(numout,*) 'trc_bio:tracer anomaly: DIC concentration > 4000 '
+            WRITE(numout,9600) kt, zmax, ii, ij, jk
             WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****'
          ENDIF
@@ -869,6 +911,6 @@
          IF(lwp) THEN
             WRITE(numout,*) 'trc_bio:tracer anomaly: *****    WARNING     *****'
-            WRITE(numout,*) 'trc_bio:tracer anomaly: sea surface DIC <= 0 '
-            WRITE(numout,9700) kt, zmin, ii, ij
+            WRITE(numout,*) 'trc_bio:tracer anomaly: DIC concentration <= 0 '
+            WRITE(numout,9700) kt, zmin, ii, ij, jk
             WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****'
          ENDIF
@@ -901,6 +943,6 @@
          IF(lwp) THEN
             WRITE(numout,*) 'trc_bio:tracer anomaly: *****     WARNING    *****'
-            WRITE(numout,*) 'trc_bio:tracer anomaly: sea surface Alkalinity > 4000 '
-            WRITE(numout,9800) kt, zmax, ii, ij
+            WRITE(numout,*) 'trc_bio:tracer anomaly: ALK concentration > 4000 '
+            WRITE(numout,9800) kt, zmax, ii, ij, jk
             WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****'
          ENDIF
@@ -918,6 +960,6 @@
          IF(lwp) THEN
             WRITE(numout,*) 'trc_bio:tracer anomaly: *****    WARNING     *****'
-            WRITE(numout,*) 'trc_bio:tracer anomaly:  sea surface Alkalinity <= 0 '
-            WRITE(numout,9900) kt, zmin, ii, ij
+            WRITE(numout,*) 'trc_bio:tracer anomaly:  ALK concentration <= 0 '
+            WRITE(numout,9900) kt, zmin, ii, ij, jk
             WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****'
          ENDIF
@@ -925,8 +967,8 @@
 
 
-9600  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max DIC: ',f16.10,', i j: ',2i5)
-9700  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min DIC: ',f16.10,', i j: ',2i5)
-9800  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max ALK: ',f16.10,', i j: ',2i5)
-9900  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min ALK: ',f16.10,', i j: ',2i5)
+9600  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max DIC: ',f16.10,', i j k: ',3i5)
+9700  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min DIC: ',f16.10,', i j k: ',3i5)
+9800  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max ALK: ',f16.10,', i j k: ',3i5)
+9900  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min ALK: ',f16.10,', i j k: ',3i5)
 
    END SUBROUTINE trc_bio_check
Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90	(revision 9350)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90	(revision 9351)
@@ -324,4 +324,14 @@
       IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
       IF(lwp) CALL flush(numout)
+      !!
+      !!----------------------------------------------------------------------
+      !! JPALM (23-01-2017): new way to initialize CO2-atm for cmip6 
+      !!                     initially done in trcsms_medusa
+      !!----------------------------------------------------------------------
+      !! 
+      IF( ( .NOT.lk_oasis ) .AND. ( .NOT.lk_pi_co2 ) ) THEN
+         IF(lwp) WRITE(numout,*) ' trc_ini_medusa: initialisating atm CO2 record'
+         CALL trc_ini_medusa_co2atm
+      ENDIF
 
    END SUBROUTINE trc_ini_medusa
@@ -480,4 +490,75 @@
    END SUBROUTINE trc_ini_medusa_river
    
+   SUBROUTINE trc_ini_medusa_co2atm
+      !!----------------------------------------------------------------------
+      !!                     ***  trc_ini_medusa_co2atm  ***  
+      !!
+      !! ** Purpose :   initialization atmospheric co2 record
+      !!
+      !! ** Method  : - Read the xco2 file
+      !!----------------------------------------------------------------------
+      INTEGER  ::  jn, jm, io, ierr, inum
+      INTEGER  ::  iskip = 4   ! number of 1st descriptor lines
+      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   ::   zyy !: xCO2 record years
+      CHARACTER (len=10) ::   clname = 'xco2.atm'  !! atm CO2 record file
+      !!----------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) ' trc_ini_medusa_co2atm: initialisation of atm CO2 historical record'
+      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~'
+
+
+      IF(lwp) WRITE(numout,*) 'read of formatted file xco2.atm'
+
+      CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      REWIND(inum)
+
+      ! compute the number of year in the file
+      ! file starts in 1849 do jn represent the record number in the file.
+      ! the year is jn + yinit - 1
+      jn = 1
+      DO
+        READ(inum,'(1x)',END=100)
+        jn = jn + 1
+      END DO
+ 100  co2_rec = jn - 1 - iskip
+      IF ( lwp) WRITE(numout,*) '    ', co2_rec ,' years read in the file'
+      !                                ! Allocate CO2 hist arrays
+      ierr = 0 
+      ALLOCATE( hist_pco2(co2_rec),zyy(co2_rec), STAT=ierr )
+      IF( ierr > 0 ) THEN
+         CALL ctl_stop( 'trc_ini_medusa_co2atm: unable to allocate  array' )   ; RETURN
+      ENDIF
+
+      REWIND(inum)
+
+      DO jm = 1, iskip        ! Skip over 1st six descriptor lines
+         READ(inum,'(1x)')
+      END DO
+      ! file starts in 1931 do jn represent the year in the century.jhh
+      ! Read file till the end
+      ! allocate start and end year of the file
+      jn = 1
+      DO
+        READ(inum,*, IOSTAT=io) zyy(jn), hist_pco2(jn)
+        IF( io < 0 ) exit
+        IF(jn==1) co2_yinit = zyy(jn)
+        jn = jn + 1
+      END DO
+      co2_yend = co2_yinit + real(co2_rec) - 1.
+
+      IF(lwp) THEN        ! Control print
+         WRITE(numout,*)
+         WRITE(numout,*) 'CO2 hist start year: ', co2_yinit
+         WRITE(numout,*) 'CO2 hist end   year: ', co2_yend
+         WRITE(numout,*) ' Year   xCO2 atm '
+         DO jn = 1, co2_rec
+            WRITE(numout, '( 5F7.1, 6F9.2)') zyy(jn), hist_pco2(jn)
+         END DO
+      ENDIF
+
+   END SUBROUTINE trc_ini_medusa_co2atm
+
+
 #else
    !!----------------------------------------------------------------------
Index: branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 9350)
+++ branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 9351)
@@ -378,5 +378,5 @@
             !!
             IF(lwp) WRITE(numout,*) ' CFC averaged properties absent - setting to zero ...'
-            qint_cfc(:,:,jn)  = 0.0   !! CHN
+            qint_cfc(:,:,jl)  = 0.0   !! CHN
          ENDIF
          !!
