Index: NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 10763)
+++ NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 10764)
@@ -1070,4 +1070,8 @@
       ENDIF
 #endif
+
+      IF (cdfile_name == "output.abort") THEN 
+         CALL ctl_stop('STOP', 'NEMO abort from dia_wri_state') 
+      END IF
       ! 
    END SUBROUTINE dia_wri_state
Index: NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 10763)
+++ NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 10764)
@@ -2406,4 +2406,5 @@
 
    SUBROUTINE mppstop
+      USE mod_oasis      ! coupling routines
       !!----------------------------------------------------------------------
       !!                  ***  routine mppstop  ***
@@ -2415,6 +2416,13 @@
       !!----------------------------------------------------------------------
       !
+#if defined key_oasis3 
+      ! If we're trying to shut down cleanly then we need to consider the fact 
+      ! that this could be part of an MPMD configuration - we don't want to 
+      ! leave other components deadlocked. 
+      CALL oasis_abort(nproc,"mppstop","NEMO initiated abort") 
+#else
       CALL mppsync
       CALL mpi_finalize( info )
+#endif
       !
    END SUBROUTINE mppstop
@@ -4333,5 +4341,5 @@
          ENDIF
          CALL FLUSH(kout) 
-         STOP 'ctl_opn bad opening'
+         CALL ctl_stop ('STOP', 'NEMO abort ctl_opn bad opening')
       ENDIF
       !
Index: NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10763)
+++ NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10764)
@@ -210,5 +210,7 @@
       ALLOCATE( a_i(jpi,jpj,1) , STAT=ierr(2) )  ! used in sbcice_if.F90 (done here as there is no sbc_ice_if_init)
 #endif
-      ALLOCATE( xcplmask(jpi,jpj,0:nn_cplmodel) , STAT=ierr(3) )
+      !ALLOCATE( xcplmask(jpi,jpj,nn_cplmodel) , STAT=ierr(3) )   
+      ! Hardwire three models as nn_cplmodel has not been read in from the namelist yet.   
+      ALLOCATE( xcplmask(jpi,jpj,0:3) , STAT=ierr(3) )
       !
       IF( .NOT. ln_apr_dyn ) ALLOCATE( ssh_ib(jpi,jpj), ssh_ibb(jpi,jpj), apr(jpi, jpj), STAT=ierr(4) ) 
@@ -318,5 +320,5 @@
 
       !                                   ! allocate sbccpl arrays
-      IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )
+      !IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )
      
       ! ================================ !
Index: NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 10763)
+++ NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 10764)
@@ -286,4 +286,7 @@
       CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 )
       !
+      ! In coupled mode get extra fields from CICE for passing back to atmosphere 
+      IF ( ksbc == jp_purecpl ) CALL cice_sbc_hadgam(nit000) 
+      !
       IF( nn_timing == 1 )  CALL timing_stop('cice_sbc_init')
       !
@@ -708,9 +711,4 @@
       IF( nn_timing == 1 )  CALL timing_start('cice_sbc_hadgam')
       !
-      IF( kt == nit000 )  THEN
-         IF(lwp) WRITE(numout,*)'cice_sbc_hadgam'
-         IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )
-      ENDIF
-
       !                                         ! =========================== !
       !                                         !   Prepare Coupling fields   !
Index: NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 10763)
+++ NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 10764)
@@ -290,6 +290,9 @@
       !                             !* OASIS initialization
       !
-      IF( lk_oasis )   CALL sbc_cpl_init( nn_ice )   ! Must be done before: (1) first time step
-      !                                              !                      (2) the use of nn_fsbc
+      IF( lk_oasis ) THEN 
+         IF( sbc_cpl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_cpl_alloc : unable to allocate arrays' )  
+         CALL sbc_cpl_init( nn_ice )   ! Must be done before: (1) first time step 
+                                       !                      (2) the use of nn_fsbc 
+      ENDIF
       !     nn_fsbc initialization if OPA-SAS coupling via OASIS
       !     SAS time-step has to be declared in OASIS (mandatory) -> nn_fsbc has to be modified accordingly
Index: NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 10763)
+++ NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 10764)
@@ -90,4 +90,5 @@
    USE lbcnfd , ONLY  : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges 
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
+   USE sbccpl
 #if defined key_iomput
    USE xios           ! xIOserver
@@ -181,5 +182,17 @@
 #else
             IF ( .NOT. ln_diurnal_only ) THEN 
+               IF (lk_oasis) CALL sbc_cpl_snd( istp )  ! Coupling to atmos
                CALL stp( istp )                 ! standard time stepping 
+               ! We don't couple on the final timestep because 
+               ! our restart file has already been written 
+               ! and contains all the necessary data for a 
+               ! restart. sbc_cpl_snd could be called here 
+               ! but it would require 
+               ! a) A test to ensure it was not performed 
+               !    on the very last time-step 
+               ! b) the presence of another call to 
+               !    sbc_cpl_snd call prior to the main DO loop 
+               ! This solution produces identical results 
+               ! with fewer lines of code.
             ELSE 
                CALL stp_diurnal( istp )        ! time step only the diurnal SST 
@@ -304,5 +317,5 @@
       IF( Agrif_Root() ) THEN
          IF( lk_oasis ) THEN
-            CALL cpl_init( "oceanx", ilocal_comm )                               ! nemo local communicator given by oasis
+            CALL cpl_init( "toyoce", ilocal_comm )                               ! nemo local communicator given by oasis
             CALL xios_initialize( "not used"       ,local_comm= ilocal_comm )    ! send nemo communicator to xios
          ELSE
@@ -315,5 +328,5 @@
       IF( lk_oasis ) THEN
          IF( Agrif_Root() ) THEN
-            CALL cpl_init( "oceanx", ilocal_comm )          ! nemo local communicator given by oasis
+            CALL cpl_init( "toyoce", ilocal_comm )          ! nemo local communicator given by oasis
          ENDIF
          ! Nodes selection (control print return in cltxt)
@@ -516,4 +529,8 @@
                             CALL dia_tmb_init  ! TMB outputs
                             CALL dia_25h_init  ! 25h mean  outputs
+     
+      IF (nstop > 0) THEN 
+        CALL CTL_STOP('STOP','Critical errors in NEMO initialisation') 
+      END IF 
       !
    END SUBROUTINE nemo_init
Index: NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 10763)
+++ NEMO/branches/UKMO/r8395_coupling_sequence/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 10764)
@@ -328,4 +328,5 @@
                          CALL ctl_stop( 'step: indic < 0' )
                          CALL dia_wri_state( 'output.abort', kstp )
+                         CALL ctl_stop('STOP','NEMO failure in stp')
       ENDIF
       IF( kstp == nit000 ) THEN
@@ -339,6 +340,5 @@
       ! Coupled mode
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-!!gm why lk_oasis and not lk_cpl ????
-      IF( lk_oasis   )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges
+      !IF( lk_oasis   )   CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges
       !
 #if defined key_iomput
