Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/CONFIG/SHARED/field_def_bgc.xml	(revision 9114)
@@ -449,4 +449,5 @@
        <field id= "DMS_ANDM"   long_name="DMS Surface Concentration, Anderson modif" unit="nmol/L"      />
        <field id= "CHL_MLD"    long_name="MLD averaged Chlorophyll"                  unit="mg Chl/m3"   />
+       <field id= "CHL_CPL"    long_name="Scaled Surf or MLD Chlorophyll to UM"      unit="kg Chl/m3"   />
        <field id= "ATM_XCO2"   long_name="Atmospheric xCO2"                          unit="ppm"         />
        <field id= "OCN_FCO2"   long_name="Surface ocean fCO2"                        unit="uatm"        />
@@ -703,5 +704,4 @@
       <field field_ref= "OCN_CO3"    name="OCN_CO3"    />
       <field field_ref= "CO2FLUX"    name="CO2FLUX"    />
-      <field field_ref= "FGCO2"      name="FGCO2"      />
       <field field_ref= "OM_CAL"     name="OM_CAL"     />
       <field field_ref= "OM_ARG"     name="OM_ARG"     />
@@ -788,4 +788,12 @@
     </field_group>
 
+    <field_group id="groupMEDUSA_cpl" >
+      <field field_ref= "CHL_CPL"    name="CHL_CPL"    />
+      <field field_ref= "FGCO2"      name="FGCO2_CPL"  />
+      <field field_ref= "DMS_SURF"   name="DMS_CPL"    />
+      <field field_ref= "ATM_XCO2"   name="AXCO2_CPL"  />
+      <field field_ref= "AEOLIAN"    name="DUST_CPL"   />
+    </field_group>
+
     <field_group id="groupMEDUSA_3dd" >
       <field field_ref= "TPP3"       name="TPP3"       />
Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_diag_slice.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_diag_slice.F90	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_diag_slice.F90	(revision 9114)
@@ -39,6 +39,5 @@
 # endif
       USE lbclnk,            ONLY: lbc_lnk
-      USE trc,               ONLY: trn
-      USE oce,               ONLY: CO2Flux_out_cpl, DMS_out_cpl, chloro_out_cpl
+      USE oce,               ONLY: CO2Flux_out_cpl, DMS_out_cpl
       USE par_oce,           ONLY: jpi, jpj
       USE sbc_oce,           ONLY: lk_oasis, qsr, wndm
@@ -48,5 +47,5 @@
                                    jdms, ocal_ccd, xpar, xze,              &
                                    zb_co2_flx, zb_dms_srf,                 &
-                                   zn_co2_flx, zn_dms_srf, zn_chl_srf
+                                   zn_co2_flx, zn_dms_srf
       USE trc,               ONLY: med_diag
 
@@ -66,11 +65,4 @@
       !!
       IF (jk.eq.1) THEN
-         !! JPALM -- 02-06-2017 --
-         !! add Chl surf coupling
-         !! no need to output, just pass to cpl var
-         IF (lk_oasis) THEN
-            zn_chl_srf(:,:) = (trn(:,:,1,jpchd) + trn(:,:,1,jpchn)) * 1.0E-6  !! surf Chl in Kg-chl/m3 as needed for cpl
-            chloro_out_cpl(:,:) = zn_chl_srf(:,:)        !! Coupling Chl
-         END IF
          IF( med_diag%MED_QSR%dgsave ) THEN
             CALL iom_put( "MED_QSR"  , qsr ) !
Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90	(revision 9114)
@@ -39,8 +39,10 @@
 # endif
       USE lbclnk,            ONLY: lbc_lnk
+      USE oce,               ONLY: chloro_out_cpl 
       USE par_medusa,        ONLY: jp_medusa_2d, jp_medusa_3d,          &
-                                   jp_medusa_trd
+                                   jp_medusa_trd, jpchd, jpchn
       USE par_oce,           ONLY: jpi, jpim1, jpj, jpjm1, jpk
       USE phycst,            ONLY: rsmall
+      USE sbc_oce,           ONLY: lk_oasis
       USE sms_medusa,        ONLY: jinorgben, jorgben,                  &
                                    f3_co3, f3_h2co3, f3_hco3,           &
@@ -51,6 +53,7 @@
                                    zb_sed_n, zb_sed_si,                 &
                                    zn_sed_c, zn_sed_ca, zn_sed_fe,      &
-                                   zn_sed_n, zn_sed_si
-      USE trc,               ONLY: med_diag, nittrc000 
+                                   zn_sed_n, zn_sed_si, zn_chl_srf,     &
+                                   scl_chl, chl_out
+      USE trc,               ONLY: med_diag, nittrc000, trn 
       USE trcnam_trp,        ONLY: ln_trcadv_cen2, ln_trcadv_tvd
  
@@ -231,4 +234,24 @@
             ENDDO
          ENDDO
+
+         !!!---------------------------------------------------------------
+         !! Calculates Chl diag for UM coupling 
+         !!!---------------------------------------------------------------
+         !! JPALM -- 02-06-2017 --
+         !! add Chl surf coupling
+         !! no need to output, just pass to cpl var
+         IF (lk_oasis) THEN
+            IF (chl_out.eq.1) THEN
+               !! export and scale surface chl
+               zn_chl_srf(:,:) = MAX( 0.0, (trn(:,:,1,jpchd) + trn(:,:,1,jpchn)) * 1.0E-6 )
+                                 !! surf Chl in Kg-chl/m3 as needed for cpl
+            ELSEIF (chl_out.eq.2) THEN
+               !! export and scale mld chl
+               zn_chl_srf(:,:) = MAX( 0.0, fchl_ml(:,:) * 1.0E-6 )
+                                 !! mld Chl in Kg-chl/m3 as needed for cpl
+            ENDIF
+            chloro_out_cpl(:,:) = zn_chl_srf(:,:) * scl_chl        !! Coupling Chl
+         END IF
+
          !!----------------------------------------------------------------
          !! Add in XML diagnostics stuff
@@ -261,4 +284,9 @@
             CALL iom_put( "CHL_MLD"  , fchl_ml )
          ENDIF
+         IF (lk_oasis) THEN
+            IF ( med_diag%CHL_CPL%dgsave ) THEN
+               CALL iom_put( "CHL_CPL"  , chloro_out_cpl )
+            ENDIF
+         ENDIF
          IF ( med_diag%PN_JLIM%dgsave ) THEN
             CALL iom_put( "PN_JLIM"  , fjln2d )
Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/phytoplankton.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/phytoplankton.F90	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/phytoplankton.F90	(revision 9114)
@@ -56,4 +56,5 @@
                                    xvpd, xvpn, xxi
       USE zdfmxl,            ONLY: hmld
+      USE lbclnk,            ONLY: lbc_lnk
 
    !!* Substitution
@@ -380,4 +381,5 @@
          ENDDO
       ENDDO
+      CALL lbc_lnk(fchl_ml(:,:),'T',1. )
 
       DO jj = 2,jpjm1
Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90	(revision 9114)
@@ -177,5 +177,8 @@
    INTEGER  ::  jdms_model   !: choice of DMS model passed to atmosphere
 !!                              1 = ANDR, 2 = SIMO, 3 = ARAN, 4 = HALL
-!!
+!! FOR UKESM   
+   REAL(wp) ::  scl_chl      !: scaling factor for tuned Chl passed to the UM 
+   INTEGER  ::  chl_out      !: select Chl field exported and scaled for UM:
+                             !: 1- Surface Chl ; 2- MLD Chl
 !!
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   remdmp   !: depth dependent damping coefficient of passive tracers 
Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90	(revision 9114)
@@ -271,5 +271,5 @@
       zn_dms_srf(:,:)  = 0.0
       za_dms_srf(:,:)  = 0.0
-      zn_chl_srf(:,:)  = 2.0E-8 !! Chl srf
+      zn_chl_srf(:,:)  = 2.0E-8 !! Chl cpl - set first as surf
       !!
       IF(lwp) WRITE(numout,*) ' trc_ini_medusa: DMS and CO2 flux (UKESM) initialised to zero'
@@ -278,5 +278,5 @@
          CO2Flux_out_cpl(:,:) =  zn_co2_flx(:,:)   !! Coupling variable
          DMS_out_cpl(:,:)     =  zn_dms_srf(:,:)   !! Coupling variable
-         chloro_out_cpl(:,:)  =  zn_chl_srf(:,:)   !! Coupling variable
+         chloro_out_cpl(:,:)  =  zn_chl_srf(:,:) * scl_chl   !! Coupling variable
       END IF
       !!
Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcnam_medusa.F90	(revision 9114)
@@ -24,4 +24,5 @@
    USE sms_medusa      ! sms trends
    USE iom             ! I/O manager
+   USE sbc_oce, ONLY: lk_oasis
    !!USE trc_nam_dia     ! JPALM 13-11-2015 -- if iom_use for diag
 
@@ -85,5 +86,6 @@
       &  jriver_n,jriver_si,jriver_c,jriver_alk,jriver_dep,   &
       &  xsdiss,                                              &
-      &  sedlam,sedlostpoc,jpkb,jdms,jdms_input,jdms_model
+      &  sedlam,sedlostpoc,jpkb,jdms,jdms_input,jdms_model,   &
+      &  scl_chl, chl_out
 #if defined key_roam
       NAMELIST/natroam/ xthetaphy,xthetazoo,xthetanit,        &
@@ -246,4 +248,6 @@
       jdms_input  = 0
       jdms_model  = 0
+      scl_chl     = 1.
+      chl_out     = 1
             
       !REWIND(numnatm)
@@ -400,4 +404,9 @@
 !!                      1 = ANDR, 2 = SIMO, 3 = ARAN, 4 = HALL, 5 = ANDM
 !!
+!! UKESM1 - exported Chl to UM
+!!       scl_chl     : scaling factor to tune the chl field sent to the UM
+!!       chl_out     : select the chl field to send at the UM:
+!!                     1- Surf Chl ; 2- MLD Chl 
+
       IF(lwp) THEN
 !!
@@ -909,30 +918,46 @@
 !!
 !! UKESM1 - new diagnostics  !! Jpalm; AXY (08/07/15)
-         WRITE(numout,*) '=== UKESM1-related parameters'
-         WRITE(numout,*)     &
-         &   ' include DMS diagnostic?,                                   jdms        = ', jdms
-         if (jdms_input .eq. 0) then
-            WRITE(numout,*)     &
-            &   ' use instant (0) or diel-avg (1) inputs,                    jdms_input  = instantaneous'
-         else
-            WRITE(numout,*)     &
-            &   ' use instant (0) or diel-avg (1) inputs,                    jdms_input  = diel-average'
-         endif
-	 if (jdms_model .eq. 1) then
-            WRITE(numout,*)     &
-            &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Anderson et al. (2001)'
-	 elseif (jdms_model .eq. 2) then
-            WRITE(numout,*)     &
-            &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Simo & Dachs (2002)'
-	 elseif (jdms_model .eq. 3) then
-            WRITE(numout,*)     &
-            &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Aranami & Tsunogai (2004)'
-	 elseif (jdms_model .eq. 4) then
-            WRITE(numout,*)     &
-            &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Halloran et al. (2010)'
-	 elseif (jdms_model .eq. 5) then
-            WRITE(numout,*)     &
-            &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Anderson et al. (2001; modified)'
-         endif
+         WRITE(numout,*) '=== UKESM1-related parameters ==='
+         WRITE(numout,*) ' ---- --- ---'
+
+         IF (lk_oasis) THEN
+            WRITE(numout,*) '=== UKESM1 --  coupled DMS to the atmosphere'
+            WRITE(numout,*)     &
+            &   ' include DMS diagnostic?,                                   jdms        = ', jdms
+            if (jdms_input .eq. 0) then
+               WRITE(numout,*)     &
+               &   ' use instant (0) or diel-avg (1) inputs,                    jdms_input  = instantaneous'
+            else
+               WRITE(numout,*)     &
+               &   ' use instant (0) or diel-avg (1) inputs,                    jdms_input  = diel-average'
+            endif
+   	    if (jdms_model .eq. 1) then
+               WRITE(numout,*)     &
+               &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Anderson et al. (2001)'
+	    elseif (jdms_model .eq. 2) then
+               WRITE(numout,*)     &
+               &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Simo & Dachs (2002)'
+	    elseif (jdms_model .eq. 3) then
+               WRITE(numout,*)     &
+               &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Aranami & Tsunogai (2004)'
+	    elseif (jdms_model .eq. 4) then
+               WRITE(numout,*)     &
+               &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Halloran et al. (2010)'
+	    elseif (jdms_model .eq. 5) then
+               WRITE(numout,*)     &
+               &   ' choice of DMS model passed to atmosphere,                  jdms_model  = Anderson et al. (2001; modified)'
+            endif
+         
+            WRITE(numout,*) '=== UKESM1 --  coupled Chl to the atmosphere'
+            WRITE(numout,*)        &
+               &   ' Scaling factor to export tuned Chl to the atmosphere       scl_chl  = ', scl_chl
+            IF (chl_out .eq. 1) THEN
+               WRITE(numout,*)        &
+               &   ' Chl field to be scaled and sent to the atmosphere:         chl_out  = Surface Chl field '
+            ELSEIF (chl_out .eq. 2) THEN
+               WRITE(numout,*)        &
+               &   ' Chl field to be scaled and sent to the atmosphere:         chl_out  = MLD Chl field '
+            ENDIF
+         ENDIF ! IF lk_oasis=true
 !!
       ENDIF
@@ -2059,4 +2084,9 @@
           med_diag%CHL_MLD%dgsave = .FALSE.
       ENDIF
+      IF  (iom_use("CHL_CPL")) THEN 
+          med_diag%CHL_CPL%dgsave = .TRUE.
+      ELSE 
+          med_diag%CHL_CPL%dgsave = .FALSE.
+      ENDIF
       !! 3D
       IF  (iom_use("TPP3")) THEN 
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 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 9114)
@@ -135,5 +135,5 @@
                   TPP3, DETFLUX3, REMIN3N, PH3, OM_CAL3,                                             & ! end of regular 3D
 ! JPALM (01/09/17): additional UKESM 2D diag
-                  CHL_MLD,                                                                           &
+                  CHL_MLD, CHL_CPL,                                                                  &
 ! AXY (11/11/16): additional CMIP6 2D diagnostics
                   epC100, epCALC100, epN100, epSI100,                                                &
Index: /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 9113)
+++ /branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 9114)
@@ -277,13 +277,17 @@
       !!                     as proxy of org matter from the ocean
       !!                  -- needed for the coupling with atm
+      !!       07-12-2017 -- To make things cleaner, we want to store an  
+      !!                     unscaled Chl field in the restart and only 
+      !!                     scale it when reading it in.
+
       IF( iom_varid( numrtr, 'N_CHL_srf', ldstop = .FALSE. ) > 0 ) THEN
-         IF(lwp) WRITE(numout,*) 'Chl surf concentration - reading in ...'
+         IF(lwp) WRITE(numout,*) 'Chl cpl concentration - reading in ... - scale by ', scl_chl
          CALL iom_get( numrtr, jpdom_autoglo, 'N_CHL_srf',  zn_chl_srf(:,:)  )
       ELSE
-         IF(lwp) WRITE(numout,*) 'Chl surf concentration - setting to zero ...'
-         zn_chl_srf(:,:)  = (trn(:,:,1,jpchn) + trn(:,:,1,jpchd)) * 1.E-6
+         IF(lwp) WRITE(numout,*) 'set Chl coupled concentration - scaled by ', scl_chl
+         zn_chl_srf(:,:)  = MAX( 0.0, (trn(:,:,1,jpchn) + trn(:,:,1,jpchd)) * 1.E-6 )
       ENDIF
       IF (lk_oasis) THEN
-         chloro_out_cpl(:,:) = zn_chl_srf(:,:)        !! Coupling variable
+         chloro_out_cpl(:,:) = zn_chl_srf(:,:) * scl_chl        !! Coupling variable
       END IF
       !!
@@ -297,5 +301,7 @@
       call trc_rst_dia_stat(zn_dms_srf(:,:), 'DMS surf')
       call trc_rst_dia_stat(zn_co2_flx(:,:), 'CO2 flux')
-      call trc_rst_dia_stat(zn_chl_srf(:,:), 'CHL surf')
+      IF (lk_oasis) THEN
+         call trc_rst_dia_stat(chloro_out_cpl(:,:), 'CHL  cpl')
+      END IF
       !!  
       !! JPALM 14-06-2016 -- add Carbonate chenistry variables through the restart
@@ -457,4 +463,7 @@
       CALL iom_rstput( kt, nitrst, numrtw, 'B_CO2_flx',  zb_co2_flx(:,:)  )
       CALL iom_rstput( kt, nitrst, numrtw, 'N_CO2_flx',  zn_co2_flx(:,:)  )
+      !! JPALM 07-12-2017 -- To make things cleaner, we want to store an  
+      !!                     unscaled Chl field in the restart and only 
+      !!                     scale it when reading it in.
       CALL iom_rstput( kt, nitrst, numrtw, 'N_CHL_srf',  zn_chl_srf(:,:)  )
       !!
@@ -468,5 +477,5 @@
       call trc_rst_dia_stat(zn_dms_srf(:,:), 'DMS surf')
       call trc_rst_dia_stat(zn_co2_flx(:,:), 'CO2 flux')
-      call trc_rst_dia_stat(zn_chl_srf(:,:), 'CHL surf')
+      call trc_rst_dia_stat(zn_chl_srf(:,:), 'unscaled CHL cpl')
       !!
       IF(lwp) WRITE(numout,*) ' MEDUSA averaged prop. for dust and iron dep.'
