Index: branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 12909)
+++ branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 14627)
@@ -153,4 +153,5 @@
    ! sbccpl namelist parameters associated with icesheet freshwater input code. Included here rather than in sbccpl.F90 to 
    ! avoid circular dependencies.
+   ! SM 24.05.2018 - added defn for rn_antarctica_total_fw_flux_roc, and comment for option for nn_coupled_iceshelf_fluxes to =3
    INTEGER, PUBLIC     ::   nn_coupled_iceshelf_fluxes     ! =0 : total freshwater input from iceberg calving and ice shelf basal melting 
                                                            ! taken from climatologies used (no action in coupling routines).
@@ -159,11 +160,17 @@
                                                            ! =2 :  specify constant freshwater inputs in this namelist to set the combined
                                                            ! magnitude of iceberg calving and iceshelf melting freshwater fluxes.
-   LOGICAL, PUBLIC     ::   ln_iceshelf_init_atmos         ! If true force ocean to initialise iceshelf masses from atmospheric values rather
-                                                           ! than values in ocean restart (applicable if nn_coupled_iceshelf_fluxes=1).
-   REAL(wp), PUBLIC    ::   rn_greenland_total_fw_flux    ! Constant total rate of freshwater input (kg/s) for Greenland (if nn_coupled_iceshelf_fluxes=2) 
-   REAL(wp), PUBLIC    ::   rn_greenland_calving_fraction  ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting.
-   REAL(wp), PUBLIC    ::   rn_antarctica_total_fw_flux   ! Constant total rate of freshwater input (kg/s) for Antarctica (if nn_coupled_iceshelf_fluxes=2) 
-   REAL(wp), PUBLIC    ::   rn_antarctica_calving_fraction ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting.
-   REAL(wp), PUBLIC    ::   rn_iceshelf_fluxes_tolerance   ! Absolute tolerance for detecting differences in icesheet masses. 
+														   ! =3 : as for =2, but with a rate of change also specified in the namelist
+   LOGICAL, PUBLIC     ::   ln_iceshelf_init_atmos          ! If true force ocean to initialise iceshelf masses from atmospheric values rather
+                                                            ! than values in ocean restart (applicable if nn_coupled_iceshelf_fluxes=1).
+   REAL(wp), PUBLIC    ::   rn_greenland_total_fw_flux      ! Constant total rate of freshwater input (kg/s) for Greenland 
+                                                            ! (if nn_coupled_iceshelf_fluxes=2), or starting rate if nn_coupled_iceshelf_fluxes=3
+   REAL(wp), PUBLIC    ::   rn_greenland_calving_fraction   ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting.
+   REAL(wp), PUBLIC    ::   rn_greenland_total_fw_flux_roc  ! As rn_antarctica_total_fw_flux_roc but for Greenland Ice Sheet
+   REAL(wp), PUBLIC    ::   rn_antarctica_total_fw_flux     ! Constant total rate of freshwater input (kg/s) for Antarctica if 
+                                                            ! nn_coupled_iceshelf_fluxes=2, or starting rate if nn_coupled_iceshelf_fluxes=3
+   REAL(wp), PUBLIC    ::   rn_antarctica_calving_fraction  ! Set fraction of total freshwater flux for iceberg calving - remainder goes to iceshelf melting.
+   REAL(wp), PUBLIC    ::   rn_iceshelf_fluxes_tolerance    ! Absolute tolerance for detecting differences in icesheet masses. 
+   REAL(wp), PUBLIC    ::   rn_antarctica_total_fw_flux_roc ! Rate of change for ice sheet->ocean freshwater flux (% of orig flux after 1 yr, 
+                                                            ! so 1.1 is 10% inc/yr, 1.0 is no change, -1.1 is a 10% decr/yr) if nn_coupled_iceshelf_fluxes=3 
 
    !! * Substitutions
Index: branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 12909)
+++ branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 14627)
@@ -8,4 +8,5 @@
    !!            3.1  ! 2009_02  (G. Madec, S. Masson, E. Maisonave, A. Caubel) generic coupled interface
    !!            3.4  ! 2011_11  (C. Harris) more flexibility + multi-category fields
+   !!            3.5  ! 2019_05 SM - some changes for FW from Ant Ice Sheet to be allowed to vary
    !!----------------------------------------------------------------------
    !!----------------------------------------------------------------------
@@ -239,5 +240,5 @@
       INTEGER ::   inum 
       REAL(wp), POINTER, DIMENSION(:,:) ::   zacs, zaos
-      !!
+      !! SM 28.5.2018 added rn_antarctica_total_fw_flux_roc and rn_greenland_total_fw_flux_roc tbr from namelist 
       NAMELIST/namsbc_cpl/  sn_snd_temp, sn_snd_alb   , sn_snd_thick , sn_snd_crt   , sn_snd_co2,     &
          &                  sn_snd_cond, sn_snd_mpnd  , sn_snd_sstfrz, sn_snd_thick1,                 &
@@ -247,5 +248,6 @@
          &                  ln_usecplmask, nn_coupled_iceshelf_fluxes, ln_iceshelf_init_atmos,        &
          &                  rn_greenland_total_fw_flux, rn_greenland_calving_fraction, &
-         &                  rn_antarctica_total_fw_flux, rn_antarctica_calving_fraction, rn_iceshelf_fluxes_tolerance
+         &                  rn_antarctica_total_fw_flux, rn_antarctica_calving_fraction, rn_iceshelf_fluxes_tolerance, &
+         &                  rn_antarctica_total_fw_flux_roc, rn_greenland_total_fw_flux_roc
       !!---------------------------------------------------------------------
 
@@ -322,6 +324,8 @@
          WRITE(numout,*)'  rn_antarctica_total_fw_flux        = ', rn_antarctica_total_fw_flux
          WRITE(numout,*)'  rn_greenland_calving_fraction       = ', rn_greenland_calving_fraction
+		 WRITE(numout,*)'  rn_greenland_total_fw_flux_roc     = ', rn_greenland_total_fw_flux_roc ! SM added 28.05.2018
          WRITE(numout,*)'  rn_antarctica_calving_fraction      = ', rn_antarctica_calving_fraction
          WRITE(numout,*)'  rn_iceshelf_fluxes_tolerance        = ', rn_iceshelf_fluxes_tolerance
+		 WRITE(numout,*)'  rn_antarctica_total_fw_flux_roc     = ', rn_antarctica_total_fw_flux_roc ! SM added 28.05.2018
       ENDIF
 
@@ -996,5 +1000,5 @@
 
 
-   SUBROUTINE sbc_cpl_rcv( kt, k_fsbc, k_ice )     
+   SUBROUTINE sbc_cpl_rcv( kt, k_fsbc, k_ice )
       !!----------------------------------------------------------------------
       !!             ***  ROUTINE sbc_cpl_rcv  ***
@@ -1403,6 +1407,6 @@
             IF( zgreenland_icesheet_mass_b /= 0.0 ) &
            &     greenland_icesheet_mass_rate_of_change = ( greenland_icesheet_mass - zgreenland_icesheet_mass_b ) / greenland_icesheet_timelapsed 
-            greenland_icesheet_timelapsed = 0.0_wp       
-         ENDIF
+            	greenland_icesheet_timelapsed = 0.0_wp       
+            ENDIF
          IF(lwp) WRITE(numout,*) 'Greenland icesheet mass (kg) read in is ', zgreenland_icesheet_mass_in
          IF(lwp) WRITE(numout,*) 'Greenland icesheet mass (kg) used is    ', greenland_icesheet_mass
@@ -1411,4 +1415,18 @@
       ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN
          greenland_icesheet_mass_rate_of_change = rn_greenland_total_fw_flux
+	  ! SM - added 24.05.2018
+	  ! 3rd option to allow for a variable rate of fw flux from antarctic ice sheet to ocean
+	  ! A 10% increase per year is equivalent to an increase
+      	  ! after n sec by a factor of 1.1**(n/31104000) where there are 31104000 secs in 1 model yr
+      	  ! namelist value for rn_greenland_total_fw_flux_roc is 1.1 for 10% inc/yr, 1.0 for no inc, -1.1 for 10% decr/yr
+      ELSE IF ( nn_coupled_iceshelf_fluxes ==3 ) THEN
+         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN
+            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart
+            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts.
+            zgreenland_icesheet_mass_b = zgreenland_icesheet_mass_in
+            greenland_icesheet_mass = zgreenland_icesheet_mass_in
+         ENDIF
+
+         greenland_icesheet_mass_rate_of_change = rn_greenland_total_fw_flux*(rn_greenland_total_fw_flux_roc**(kt*rdt/31104000.0))
       ENDIF
 
@@ -1448,4 +1466,18 @@
       ELSE IF ( nn_coupled_iceshelf_fluxes == 2 ) THEN
          antarctica_icesheet_mass_rate_of_change = rn_antarctica_total_fw_flux
+	  ! SM - added 24.05.2018
+	  ! 3rd option to allow for a variable rate of fw flux from antarctic ice sheet to ocean
+	  ! A 10% increase per year is equivalent to an increase
+      	  ! after n sec by a factor of 1.1**(n/31104000) where there are 31104000 secs in 1 model yr
+      	  ! namelist value forrn_antarctica_total_fw_flux_roc is 1.1 for 10% inc/yr, 1.0 for no inc, -1.1 for 10% decr/yr
+     ELSE IF ( nn_coupled_iceshelf_fluxes ==3 ) THEN
+         IF( ln_iceshelf_init_atmos .AND. kt == 1 ) THEN
+            ! On the first timestep (of an NRUN) force the ocean to ignore the icesheet masses in the ocean restart
+            ! and take them from the atmosphere to avoid problems with using inconsistent ocean and atmosphere restarts.
+            zantarctica_icesheet_mass_b = zantarctica_icesheet_mass_in
+            antarctica_icesheet_mass = zantarctica_icesheet_mass_in
+         ENDIF
+
+         antarctica_icesheet_mass_rate_of_change = rn_antarctica_total_fw_flux*(rn_antarctica_total_fw_flux_roc**(kt*rdt/31104000.0))
       ENDIF
 
@@ -1987,4 +2019,5 @@
 
 #else
+
       ! clem: this formulation is certainly wrong... but better than it was...
       
Index: branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 12909)
+++ branches/UKMO/jonnywilliams-u-br854/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 14627)
@@ -38,5 +38,5 @@
    USE ice_gather_scatter
    USE ice_calendar, only: dt
-# if defined key_cice4
+#if defined key_cice4
    USE ice_state, only: aice,aicen,uvel,vvel,vsno,vsnon,vice,vicen
    USE ice_flux, only: strax,stray,strocnx,strocny,frain,fsnow,  &
@@ -57,5 +57,5 @@
                 flatn_f,fsurfn_f,fcondtopn_f,                    &
 #ifdef key_asminc
-                daice_da,fresh_da,fsalt_da,                    &
+                daice_da,fresh_da,fsalt_da,                      &
 #endif
                 uatm,vatm,wind,fsw,flw,Tair,potT,Qa,rhoa,zlvl,   &
@@ -65,5 +65,5 @@
 		!! - at CICE5.0,   hadax/r1015_GSI8_with_GSI7
 		!! - at CICE5.1.2, hadax/vn5.1.2_GSI8
-                keffn_top,Tn_top
+                keffn_top,Tn_top,a_to_ocn_htflux,tgrid_stressmag
 
    USE ice_therm_shared, only: calc_Tsfc, heat_capacity
@@ -236,4 +236,5 @@
          ENDDO
       ENDIF
+
 
 ! T point to U point
@@ -302,5 +303,6 @@
          ENDIF
       ENDIF
- 
+
+
       CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 )
 
@@ -375,4 +377,9 @@
          ENDDO
          CALL nemo2cice(ztmp,stray,'F', -1. )
+
+! share taum with CICE to use as surface stress for ice-free cells 
+! (to determine whether new ice should form as grease or nilas)
+         CALL nemo2cice(taum,tgrid_stressmag,'T', 1. )
+
 
 
@@ -397,5 +404,5 @@
                ztmpn(:,:,jl)=qla_ice(:,:,jl)*a_i(:,:,jl)
             ENDDO
-	 ELSE
+         ELSE
            !In coupled mode - qla_ice calculated in sbc_cpl for each category
            ztmpn(:,:,1:ncat)=qla_ice(:,:,1:ncat)
@@ -422,5 +429,14 @@
             ENDIF
             CALL nemo2cice(ztmp,fsurfn_f(:,:,jl,:),'T', 1. )
-         ENDDO
+
+         ENDDO
+
+!  atmos->ocn heat flux needed by CICE for freeze/melt of grease
+! qns the sum of sensible, latent and long wave heat fluxes plus the heat content
+! of the mass exchange with the atmosphere and sea-ice (trend calc'd in trasbc.F90?)
+! qsr is the penetrative part of the heat flux (trend calc'd in traqsr.F90?)
+         ztmp(:,:) = qns_tot(:,:) + qsr_tot(:,:)
+         CALL nemo2cice(ztmp,a_to_ocn_htflux,'T',1.)
+
 
       ELSE IF (ksbc == jp_core) THEN
@@ -626,4 +642,6 @@
 taum(:,:)=(1.0-fr_i(:,:))*taum(:,:)+fr_i(:,:)*SQRT(ztmp1**2. + ztmp2**2.) 
 
+
+
 ! Freshwater fluxes 
 
