Index: branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 8553)
+++ branches/UKMO/r6232_HZG_WAVE-coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 8756)
@@ -116,5 +116,7 @@
    INTEGER, PARAMETER ::   jpr_wdrag  = 51            ! Neutral surface drag coefficient 
    INTEGER, PARAMETER ::   jpr_wfreq  = 52            ! Wave peak frequency 
-   INTEGER, PARAMETER ::   jprcv      = 52            ! total number of fields received
+   INTEGER, PARAMETER ::   jpr_tauwx  = 53            ! x component of the ocean stress from waves
+   INTEGER, PARAMETER ::   jpr_tauwy  = 54            ! y component of the ocean stress from waves
+   INTEGER, PARAMETER ::   jprcv      = 54            ! total number of fields received
 
    INTEGER, PARAMETER ::   jps_fice   =  1            ! ice fraction sent to the atmosphere
@@ -169,5 +171,6 @@
    ! Received from waves  
    TYPE(FLD_C) ::   sn_rcv_hsig,sn_rcv_phioc,sn_rcv_sdrft,sn_rcv_wper, &
-                    sn_rcv_wfreq,sn_rcv_wnum,sn_rcv_tauoc,sn_rcv_wdrag
+                    sn_rcv_wfreq,sn_rcv_wnum,sn_rcv_tauoc,sn_rcv_tauw, &
+                    sn_rcv_wdrag
    ! Other namelist parameters                        !
    INTEGER     ::   nn_cplmodel            ! Maximum number of models to/from which NEMO is potentialy sending/receiving data
@@ -246,5 +249,6 @@
          &                  sn_rcv_sdrft, sn_rcv_wper  , sn_rcv_wnum  , sn_rcv_wfreq, sn_rcv_tauoc,    &
          &                  sn_rcv_wdrag, sn_rcv_qns   , sn_rcv_emp   , sn_rcv_rnf  , sn_rcv_cal ,     &
-         &                  sn_rcv_iceflx, sn_rcv_co2   , sn_rcv_mslp  , nn_cplmodel, ln_usecplmask
+         &                  sn_rcv_iceflx, sn_rcv_co2   , sn_rcv_mslp , sn_rcv_tauw ,                  &
+         &                  nn_cplmodel, ln_usecplmask
       !!---------------------------------------------------------------------
       !
@@ -295,4 +299,5 @@
          WRITE(numout,*)'      Wave peak frequency             = ', TRIM(sn_rcv_wfreq%cldes ), ' (', TRIM(sn_rcv_wfreq%clcat ), ')'  
          WRITE(numout,*)'      Stress frac adsorbed by waves   = ', TRIM(sn_rcv_tauoc%cldes ), ' (', TRIM(sn_rcv_tauoc%clcat ), ')'  
+         WRITE(numout,*)'      Stress components by waves      = ', TRIM(sn_rcv_tauw%cldes  ), ' (', TRIM(sn_rcv_tauw%clcat  ), ')'  
          WRITE(numout,*)'      Neutral surf drag coefficient   = ', TRIM(sn_rcv_wdrag%cldes ), ' (', TRIM(sn_rcv_wdrag%clcat ), ')'
          WRITE(numout,*)'  sent fields (multiple ice categories)'
@@ -573,4 +578,11 @@
          cpl_tauoc = .TRUE. 
       ENDIF 
+      srcv(jpr_tauwx)%clname = 'O_Tauwx'      ! ocean stress from wave in the x direction
+      srcv(jpr_tauwy)%clname = 'O_Tauwy'      ! ocean stress from wave in the y direction
+      IF( TRIM(sn_rcv_tauw%cldes ) == 'coupled' )  THEN 
+         srcv(jpr_tauwx)%laction = .TRUE. 
+         srcv(jpr_tauwy)%laction = .TRUE. 
+         cpl_tauw = .TRUE. 
+      ENDIF 
       srcv(jpr_wdrag)%clname = 'O_WDrag'     ! neutral surface drag coefficient 
       IF( TRIM(sn_rcv_wdrag%cldes ) == 'coupled' )  THEN 
@@ -578,4 +590,9 @@
          cpl_wdrag = .TRUE. 
       ENDIF 
+      !
+      IF( srcv(jpr_tauoc)%laction .AND. srcv(jpr_tauwx)%laction .AND. srcv(jpr_tauwy)%laction ) &
+            CALL ctl_stop( 'More than one method for modifying the ocean stress has been selected ', &
+                                     '(sn_rcv_tauoc=coupled and sn_rcv_tauw=coupled)' )
+      !
       !  
       !                                                      ! ------------------------------- !
@@ -1205,4 +1222,16 @@
          WHERE(tauoc_wave <   0.0 ) tauoc_wave = 1.0
          WHERE(tauoc_wave > 100.0 ) tauoc_wave = 1.0
+      ENDIF
+      !                                                      ! ========================= !  
+      !                                                      ! Stress component by waves ! 
+      !                                                      ! ========================= !  
+      IF( srcv(jpr_tauwx)%laction .AND. srcv(jpr_tauwy)%laction .AND. ln_tauw ) THEN
+         tauw_x(:,:) = frcv(jpr_tauwx)%z3(:,:,1)
+         tauw_y(:,:) = frcv(jpr_tauwy)%z3(:,:,1)
+         ! cap the value of tauoc
+         WHERE(tauw_x < -100.0 ) tauw_x = 0.0
+         WHERE(tauw_x >  100.0 ) tauw_x = 0.0
+         WHERE(tauw_y < -100.0 ) tauw_y = 0.0
+         WHERE(tauw_y >  100.0 ) tauw_y = 0.0
       ENDIF
       
