Index: branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90
===================================================================
--- branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 10394)
+++ branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/geo2ocean.F90	(revision 10395)
@@ -51,5 +51,5 @@
 
    SUBROUTINE repcmo ( pxu1, pyu1, pxv1, pyv1,   &
-                       px2 , py2 )
+                       px2 , py2, kchoix )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE repcmo  ***
@@ -69,8 +69,23 @@
       !!----------------------------------------------------------------------
       
-      ! Change from geographic to stretched coordinate
-      ! ----------------------------------------------
-      CALL rot_rep( pxu1, pyu1, 'U', 'en->i',px2 )
-      CALL rot_rep( pxv1, pyv1, 'V', 'en->j',py2 )
+      INTEGER, INTENT( IN )                       ::   kchoix       ! type of transformation   
+                                                                    ! = 1 change from geographic to model grid.   
+                                                                    ! =-1 change from model to geographic grid   
+      !!----------------------------------------------------------------------  
+        
+      SELECT CASE (kchoix)   
+      CASE ( 1)   
+        ! Change from geographic to stretched coordinate   
+        ! ----------------------------------------------   
+        
+        CALL rot_rep( pxu1, pyu1, 'U', 'en->i',px2 )   
+        CALL rot_rep( pxv1, pyv1, 'V', 'en->j',py2 )   
+      CASE (-1)   
+        ! Change from stretched to geographic coordinate   
+        ! ----------------------------------------------   
+        
+        CALL rot_rep( pxu1, pyu1, 'U', 'ij->e',px2 )   
+        CALL rot_rep( pxv1, pyv1, 'V', 'ij->n',py2 )   
+      END SELECT   
       
    END SUBROUTINE repcmo
Index: branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10394)
+++ branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10395)
@@ -342,5 +342,9 @@
          srcv(jpr_otx2:jpr_otz2)%clgrid  = 'V'        !           and           V-point
          srcv(jpr_itx1:jpr_itz1)%clgrid  = 'F'        ! ice components given at F-point
-         srcv(jpr_otx1:jpr_otz2)%laction = .TRUE.     ! receive oce components on grid 1 & 2
+         !srcv(jpr_otx1:jpr_otz2)%laction = .TRUE.     ! receive oce components on grid 1 & 2  
+         ! Currently needed for HadGEM3 - but shouldn't affect anyone else for the moment  
+         srcv(jpr_otx1)%laction = .TRUE.   
+         srcv(jpr_oty1)%laction = .TRUE.  
+         !  
          srcv(jpr_itx1:jpr_itz1)%laction = .TRUE.     ! receive ice components on grid 1 only
       CASE( 'T,I' ) 
@@ -850,4 +854,5 @@
       INTEGER  ::   ji, jj, jn             ! dummy loop indices
       INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdttra did not change since nit000)
+      INTEGER  ::   ikchoix
       REAL(wp) ::   zcumulneg, zcumulpos   ! temporary scalars     
       REAL(wp) ::   zcoef                  ! temporary scalar
@@ -855,10 +860,10 @@
       REAL(wp) ::   zcdrag = 1.5e-3        ! drag coefficient
       REAL(wp) ::   zzx, zzy               ! temporary variables
-      REAL(wp), POINTER, DIMENSION(:,:) ::   ztx, zty, zmsk, zemp, zqns, zqsr
+      REAL(wp), POINTER, DIMENSION(:,:) ::   ztx, zty, ztx2, zty2, zmsk, zemp, zqns, zqsr
       !!----------------------------------------------------------------------
       !
       IF( nn_timing == 1 )  CALL timing_start('sbc_cpl_rcv')
       !
-      CALL wrk_alloc( jpi,jpj, ztx, zty, zmsk, zemp, zqns, zqsr )
+      CALL wrk_alloc( jpi,jpj, ztx, zty, ztx2, zty2, zmsk, zemp, zqns, zqsr )
       !
       IF( ln_mixcpl )   zmsk(:,:) = 1. - xcplmask(:,:,0)
@@ -898,12 +903,34 @@
             IF( TRIM( sn_rcv_tau%clvor ) == 'eastward-northward' ) THEN   ! 2 components oriented along the local grid
                !                                                       ! (geographical to local grid -> rotate the components)
-               CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )   
-               IF( srcv(jpr_otx2)%laction ) THEN
-                  CALL rot_rep( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), srcv(jpr_otx2)%clgrid, 'en->j', zty )   
-               ELSE	
-                  CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )  
+               IF( srcv(jpr_otx1)%clgrid == 'U' .AND. (.NOT. srcv(jpr_otx2)%laction) ) THEN   
+                  ! Temporary code for HadGEM3 - will be removed eventually.   
+                  ! Only applies when we have only taux on U grid and tauy on V grid   
+                  DO jj=2,jpjm1   
+                     DO ji=2,jpim1   
+                        ztx(ji,jj)=0.25*vmask(ji,jj,1) &   
+                           *(frcv(jpr_otx1)%z3(ji,jj,1)+frcv(jpr_otx1)%z3(ji-1,jj,1)    &   
+                           +frcv(jpr_otx1)%z3(ji,jj+1,1)+frcv(jpr_otx1)%z3(ji-1,jj+1,1))   
+                        zty(ji,jj)=0.25*umask(ji,jj,1) &   
+                           *(frcv(jpr_oty1)%z3(ji,jj,1)+frcv(jpr_oty1)%z3(ji+1,jj,1)    &   
+                           +frcv(jpr_oty1)%z3(ji,jj-1,1)+frcv(jpr_oty1)%z3(ji+1,jj-1,1))   
+                     ENDDO   
+                  ENDDO   
+                              
+                  ikchoix = 1   
+                  CALL repcmo(frcv(jpr_otx1)%z3(:,:,1),zty,ztx,frcv(jpr_oty1)%z3(:,:,1),ztx2,zty2,ikchoix)   
+                  CALL lbc_lnk (ztx2,'U', -1. )   
+                  CALL lbc_lnk (zty2,'V', -1. )   
+                  frcv(jpr_otx1)%z3(:,:,1)=ztx2(:,:)   
+                  frcv(jpr_oty1)%z3(:,:,1)=zty2(:,:)   
+               ELSE   
+                  CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->i', ztx )      
+                  frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid   
+                  IF( srcv(jpr_otx2)%laction ) THEN   
+                     CALL rot_rep( frcv(jpr_otx2)%z3(:,:,1), frcv(jpr_oty2)%z3(:,:,1), srcv(jpr_otx2)%clgrid, 'en->j', zty )      
+                  ELSE   
+                     CALL rot_rep( frcv(jpr_otx1)%z3(:,:,1), frcv(jpr_oty1)%z3(:,:,1), srcv(jpr_otx1)%clgrid, 'en->j', zty )    
+                  ENDIF   
+                  frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid
                ENDIF
-               frcv(jpr_otx1)%z3(:,:,1) = ztx(:,:)      ! overwrite 1st component on the 1st grid
-               frcv(jpr_oty1)%z3(:,:,1) = zty(:,:)      ! overwrite 2nd component on the 2nd grid
             ENDIF
             !                              
@@ -1118,5 +1145,5 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi,jpj, ztx, zty, zmsk, zemp, zqns, zqsr )
+      CALL wrk_dealloc( jpi,jpj, ztx, zty, ztx2, zty2, zmsk, zemp, zqns, zqsr )
       !
       IF( nn_timing == 1 )  CALL timing_stop('sbc_cpl_rcv')
@@ -1713,4 +1740,5 @@
       !
       INTEGER ::   ji, jj, jl   ! dummy loop indices
+      INTEGER ::   ikchoix
       INTEGER ::   isec, info   ! local integer
       REAL(wp) ::   zumax, zvmax
@@ -1770,4 +1798,5 @@
                   ztmp1(:,:) = ztmp1(:,:) + tn_ice(:,:,jl) * a_i(:,:,jl)
                ENDDO
+            CASE( 'none'         )       ! nothing to do
             CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of sn_snd_temp%cldes' )
             END SELECT
@@ -1894,5 +1923,5 @@
          !                                                  j+1   j     -----V---F
          ! surface velocity always sent from T point                     !       |
-         !                                                        j      |   T   U
+         ! [except for HadGEM3]                                   j      |   T   U
          !                                                               |       |
          !                                                   j    j-1   -I-------|
@@ -1906,10 +1935,20 @@
             SELECT CASE( TRIM( sn_snd_crt%cldes ) )
             CASE( 'oce only'             )      ! C-grid ==> T
-               DO jj = 2, jpjm1
-                  DO ji = fs_2, fs_jpim1   ! vector opt.
-                     zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj  ,1) )
-                     zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji  ,jj-1,1) ) 
-                  END DO
-               END DO
+               IF ( TRIM( sn_snd_crt%clvgrd ) == 'T' ) THEN   
+                  DO jj = 2, jpjm1   
+                     DO ji = fs_2, fs_jpim1   ! vector opt.   
+                        zotx1(ji,jj) = 0.5 * ( un(ji,jj,1) + un(ji-1,jj  ,1) )   
+                        zoty1(ji,jj) = 0.5 * ( vn(ji,jj,1) + vn(ji,jj-1,1) )    
+                     END DO   
+                  END DO   
+               ELSE   
+                  ! Temporarily Changed for UKV   
+                  DO jj = 2, jpjm1   
+                     DO ji = 2, jpim1   
+                        zotx1(ji,jj) = un(ji,jj,1)   
+                        zoty1(ji,jj) = vn(ji,jj,1)   
+                     END DO   
+                  END DO   
+               ENDIF 
             CASE( 'weighted oce and ice' )   
                SELECT CASE ( cp_ice_msh )
@@ -1935,14 +1974,28 @@
                   END DO
                CASE( 'F' )                      ! Ocean on C grid, Ice on F-point (B-grid) ==> T
-                  DO jj = 2, jpjm1
-                     DO ji = 2, jpim1   ! NO vector opt.
-                        zotx1(ji,jj) = 0.5  * ( un(ji,jj,1)      + un(ji-1,jj  ,1) ) * zfr_l(ji,jj)  
-                        zoty1(ji,jj) = 0.5  * ( vn(ji,jj,1)      + vn(ji  ,jj-1,1) ) * zfr_l(ji,jj)  
-                        zitx1(ji,jj) = 0.25 * ( u_ice(ji-1,jj-1) + u_ice(ji,jj-1)                     &
-                           &                  + u_ice(ji-1,jj  ) + u_ice(ji,jj  )  ) *  fr_i(ji,jj)
-                        zity1(ji,jj) = 0.25 * ( v_ice(ji-1,jj-1) + v_ice(ji,jj-1)                     &
-                           &                  + v_ice(ji-1,jj  ) + v_ice(ji,jj  )  ) *  fr_i(ji,jj)
-                     END DO
-                  END DO
+                  IF ( TRIM( sn_snd_crt%clvgrd ) == 'T' ) THEN   
+                     DO jj = 2, jpjm1   
+                        DO ji = 2, jpim1   ! NO vector opt.   
+                           zotx1(ji,jj) = 0.5  * ( un(ji,jj,1) + un(ji-1,jj,1) ) * zfr_l(ji,jj)   &      
+                                  &       + 0.25 * ( u_ice(ji-1,jj-1) + u_ice(ji,jj-1)                     &   
+                                  &                + u_ice(ji-1,jj  ) + u_ice(ji,jj  )  ) *  fr_i(ji,jj)   
+                           zoty1(ji,jj) = 0.5  * ( vn(ji,jj,1) + vn(ji,jj-1,1) ) * zfr_l(ji,jj)   &   
+                                  &       + 0.25 * ( v_ice(ji-1,jj-1) + v_ice(ji,jj-1)                     &   
+                                  &                + v_ice(ji-1,jj  ) + v_ice(ji,jj  )  ) *  fr_i(ji,jj)   
+                        END DO   
+                     END DO   
+#if defined key_cice   
+                  ELSE   
+                     ! Temporarily Changed for HadGEM3   
+                     DO jj = 2, jpjm1   
+                        DO ji = 2, jpim1   ! NO vector opt.   
+                           zotx1(ji,jj) = (1.0-fr_iu(ji,jj)) * un(ji,jj,1)             &   
+                                &              + fr_iu(ji,jj) * 0.5 * ( u_ice(ji,jj-1) + u_ice(ji,jj) )    
+                           zoty1(ji,jj) = (1.0-fr_iv(ji,jj)) * vn(ji,jj,1)             &   
+                                &              + fr_iv(ji,jj) * 0.5 * ( v_ice(ji-1,jj) + v_ice(ji,jj) )    
+                        END DO   
+                     END DO   
+#endif   
+                  ENDIF 
                END SELECT
                CALL lbc_lnk( zitx1, 'T', -1. )   ;   CALL lbc_lnk( zity1, 'T', -1. )
@@ -1989,14 +2042,38 @@
          IF( TRIM( sn_snd_crt%clvor ) == 'eastward-northward' ) THEN             ! Rotation of the components
             !                                                                     ! Ocean component
-            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component 
-            CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->n', ztmp2 )       ! 2nd component 
-            zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components 
-            zoty1(:,:) = ztmp2(:,:)
-            IF( ssnd(jps_ivx1)%laction ) THEN                                     ! Ice component
-               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component 
-               CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component 
-               zitx1(:,:) = ztmp1(:,:)                                                ! overwrite the components 
-               zity1(:,:) = ztmp2(:,:)
-            ENDIF
+             IF ( TRIM( sn_snd_crt%clvgrd ) == 'T' ) THEN   
+                CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->e', ztmp1 )       ! 1st component   
+                CALL rot_rep( zotx1, zoty1, ssnd(jps_ocx1)%clgrid, 'ij->n', ztmp2 )       ! 2nd component   
+                zotx1(:,:) = ztmp1(:,:)                                                   ! overwrite the components   
+                zoty1(:,:) = ztmp2(:,:)   
+                IF( ssnd(jps_ivx1)%laction ) THEN                  ! Ice component   
+                   CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->e', ztmp1 )    ! 1st component   
+                   CALL rot_rep( zitx1, zity1, ssnd(jps_ivx1)%clgrid, 'ij->n', ztmp2 )    ! 2nd component   
+                   zitx1(:,:) = ztmp1(:,:) ! overwrite the components   
+                   zity1(:,:) = ztmp2(:,:)   
+                ENDIF   
+             ELSE   
+                ! Temporary code for HadGEM3 - will be removed eventually.   
+                ! Only applies when we want uvel on U grid and vvel on V grid   
+                ! Rotate U and V onto geographic grid before sending.   
+             
+                DO jj=2,jpjm1   
+                   DO ji=2,jpim1   
+                      ztmp1(ji,jj)=0.25*vmask(ji,jj,1)      &   
+                           *(zotx1(ji,jj)+zotx1(ji-1,jj)    &   
+                           +zotx1(ji,jj+1)+zotx1(ji-1,jj+1))   
+                      ztmp2(ji,jj)=0.25*umask(ji,jj,1)      &   
+                           *(zoty1(ji,jj)+zoty1(ji+1,jj)    &   
+                           +zoty1(ji,jj-1)+zoty1(ji+1,jj-1))   
+                   ENDDO   
+                ENDDO   
+                   
+                ! Ensure any N fold and wrap columns are updated   
+                CALL lbc_lnk(ztmp1, 'V', -1.0)   
+                CALL lbc_lnk(ztmp2, 'U', -1.0)   
+                   
+                ikchoix = -1   
+                CALL repcmo(zotx1,ztmp2,ztmp1,zoty1,zotx1,zoty1,ikchoix)   
+            ENDIF   
          ENDIF
          !
