Index: trunk/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 1695)
+++ trunk/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 1696)
@@ -78,13 +78,14 @@
    INTEGER, PARAMETER ::   jpr_semp   = 24            ! solid freshwater budget (sublimation - snow)
    INTEGER, PARAMETER ::   jpr_oemp   = 25            ! ocean freshwater budget (evap - precip)
-   INTEGER, PARAMETER ::   jpr_w10m   = 26            ! 
-   INTEGER, PARAMETER ::   jpr_dqnsdt = 27            ! 
-   INTEGER, PARAMETER ::   jpr_rnf    = 28            ! 
-   INTEGER, PARAMETER ::   jpr_cal    = 29            ! 
+   INTEGER, PARAMETER ::   jpr_w10m   = 26            ! 10m wind
+   INTEGER, PARAMETER ::   jpr_dqnsdt = 27            ! d(Q non solar)/d(temperature)
+   INTEGER, PARAMETER ::   jpr_rnf    = 28            ! runoffs
+   INTEGER, PARAMETER ::   jpr_cal    = 29            ! calving
+   INTEGER, PARAMETER ::   jpr_taum   = 30            ! wind stress module
 #if ! defined key_cpl_carbon_cycle
-   INTEGER, PARAMETER ::   jprcv      = 29            ! total number of fields recieved
+   INTEGER, PARAMETER ::   jprcv      = 30            ! total number of fields received
 #else
-   INTEGER, PARAMETER ::   jpr_co2    = 30
-   INTEGER, PARAMETER ::   jprcv      = 30            ! total number of fields recieved
+   INTEGER, PARAMETER ::   jpr_co2    = 31
+   INTEGER, PARAMETER ::   jprcv      = 31            ! total number of fields received
 #endif   
    INTEGER, PARAMETER ::   jps_fice   =  1            ! ice fraction 
@@ -120,5 +121,5 @@
    CHARACTER(len=100) ::   cn_snd_co2         = 'none'        ! 'none' or 'coupled'
 #endif
-   ! Recieved from the atmosphere                             !
+   ! Received from the atmosphere                             !
    CHARACTER(len=100) ::   cn_rcv_tau_nature  = 'oce only'    ! 'oce only' 'oce and ice' or 'mixed oce-ice'
    CHARACTER(len=100) ::   cn_rcv_tau_refere  = 'spherical'   ! 'spherical' or 'cartesian'
@@ -132,4 +133,5 @@
    CHARACTER(len=100) ::   cn_rcv_rnf         = 'coupled'     ! 'coupled' 'climato' or 'mixed'
    CHARACTER(len=100) ::   cn_rcv_cal         = 'none'        ! 'none' or 'coupled'
+   CHARACTER(len=100) ::   cn_rcv_taumod      = 'none'        ! 'none' or 'coupled'
 #if defined key_cpl_carbon_cycle 
    CHARACTER(len=100) ::   cn_rcv_co2         = 'none'        ! 'none' or 'coupled'
@@ -205,4 +207,5 @@
          WRITE(numout,*)'       runoffs                            cn_rcv_rnf         = ', cn_rcv_rnf
          WRITE(numout,*)'       calving                            cn_rcv_cal         = ', cn_rcv_cal 
+         WRITE(numout,*)'       stress module                      cn_rcv_taumod      = ', cn_rcv_taumod
          WRITE(numout,*)'   sent fields'
          WRITE(numout,*)'       surface temperature                cn_snd_temperature = ', cn_snd_temperature
@@ -406,5 +409,10 @@
       !                                                      !      10m wind module      !   
       !                                                      ! ------------------------- !
-      srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(cn_rcv_w10m) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE.     
+      srcv(jpr_w10m)%clname = 'O_Wind10'   ;   IF( TRIM(cn_rcv_w10m  ) == 'coupled' )   srcv(jpr_w10m)%laction = .TRUE. 
+      !
+      !                                                      ! ------------------------- !
+      !                                                      !   wind stress module      !   
+      !                                                      ! ------------------------- !
+      srcv(jpr_taum)%clname = 'O_TauMod'   ;   IF( TRIM(cn_rcv_taumod) == 'coupled' )   srcv(jpr_taum)%laction = .TRUE.
 
 #if defined key_cpl_carbon_cycle
@@ -412,5 +420,5 @@
       !                                                      !      Atmospheric CO2      !
       !                                                      ! ------------------------- !
-      srcv(jpr_co2 )%clname = 'O_AtmCO2'   ;   IF( TRIM(cn_rcv_co2) == 'coupled' )    srcv(jpr_co2 )%laction = .TRUE.
+      srcv(jpr_co2 )%clname = 'O_AtmCO2'   ;   IF( TRIM(cn_rcv_co2   ) == 'coupled' )    srcv(jpr_co2 )%laction = .TRUE.
 #endif
      
@@ -548,5 +556,4 @@
       !!                        qns , qsr    non solar and solar ocean heat fluxes   ('ocean only case)
       !!                        emp = emps   evap. - precip. (- runoffs) (- calving) ('ocean only case)
-      !!                        wndm         10m wind speed  !!!!gm  to be checked
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt       ! ocean model time step index
@@ -554,4 +561,5 @@
       INTEGER, INTENT(in) ::   k_ice    ! ice management in the sbc (=0/1/2/3)
       !!
+      LOGICAL ::    llnewtx, llnewtau      ! update wind stress components and module??
       INTEGER  ::   ji, jj, jn             ! dummy loop indices
       INTEGER  ::   isec                   ! number of seconds since nit000 (assuming rdttra did not change since nit000)
@@ -573,5 +581,5 @@
 
       !                                                      ! ========================= !
-      IF( srcv(jpr_otx1)%laction ) THEN                      !       ocean stress        !
+      IF( srcv(jpr_otx1)%laction ) THEN                      !  ocean stress components  !
          !                                                   ! ========================= !
          ! define frcv(:,:,jpr_otx1) and frcv(:,:,jpr_oty1): stress at U/V point along model grid
@@ -618,4 +626,7 @@
                CALL lbc_lnk( frcv(:,:,jpr_otx1), 'U',  -1. )   ;   CALL lbc_lnk( frcv(:,:,jpr_oty1), 'V',  -1. )
             ENDIF
+            llnewtx = .TRUE.
+         ELSE
+            llnewtx = .FALSE.
          ENDIF
          !                                                   ! ========================= !
@@ -624,27 +635,41 @@
          frcv(:,:,jpr_otx1) = 0.e0                               ! here simply set to zero 
          frcv(:,:,jpr_oty1) = 0.e0                               ! an external read in a file can be added instead
+         llnewtx = .TRUE.
          !
       ENDIF
       
-      ! u(v)tau will be modified by ice model -> need to be reset before each call of the ice/fsbc      
-      IF( MOD( kt-1, k_fsbc ) == 0 ) THEN
-         !
-         utau(:,:) = frcv(:,:,jpr_otx1)                   
-         vtau(:,:) = frcv(:,:,jpr_oty1)
-         !
-         ! wind stress module at T-point
+      !                                                      ! ========================= !
+      !                                                      !    wind stress module     !   (taum)
+      !                                                      ! ========================= !
+      !
+      IF( .NOT. srcv(jpr_taum)%laction ) THEN                    ! compute wind stress module from its components if not received 
+         ! => need to be done only when otx1 was changed
+         IF( llnewtx ) THEN
 !CDIR NOVERRCHK
-         DO jj = 2, jpjm1
+            DO jj = 2, jpjm1
 !CDIR NOVERRCHK
-            DO ji = fs_2, fs_jpim1   ! vect. opt.
-               zzx = utau(ji-1,jj  ) + utau(ji,jj) 
-               zzy = vtau(ji  ,jj-1) + vtau(ji,jj) 
-               taum(ji,jj) = 0.5 * SQRT( zzx * zzx + zzy * zzy )
+               DO ji = fs_2, fs_jpim1   ! vect. opt.
+                  zzx = frcv(ji-1,jj  ,jpr_otx1) + frcv(ji,jj,jpr_otx1) 
+                  zzy = frcv(ji  ,jj-1,jpr_oty1) + frcv(ji,jj,jpr_oty1) 
+                  frcv(ji,jj,jpr_taum) = 0.5 * SQRT( zzx * zzx + zzy * zzy )
+               END DO
             END DO
-         END DO
-         CALL lbc_lnk( taum(:,:), 'T', 1. )
-         !
-         ! wind speed module at T-point
-         IF( .NOT. srcv(jpr_w10m)%laction ) THEN 
+            CALL lbc_lnk( frcv(:,:,jpr_taum), 'T', 1. )
+            llnewtau = .TRUE.
+         ELSE
+            llnewtau = .FALSE.
+         ENDIF
+      ELSE
+         llnewtau = nrcvinfo(jpr_taum) == PRISM_Recvd   .OR. nrcvinfo(jpr_taum) == PRISM_FromRest .OR.   &
+                  & nrcvinfo(jpr_taum) == PRISM_RecvOut .OR. nrcvinfo(jpr_taum) == PRISM_FromRestOut
+      ENDIF
+      
+      !                                                      ! ========================= !
+      !                                                      !      10 m wind speed      !   (wndm)
+      !                                                      ! ========================= !
+      !
+      IF( .NOT. srcv(jpr_w10m)%laction ) THEN                    ! compute wind spreed from wind stress module if not received  
+         ! => need to be done only when taumod was changed
+         IF( llnewtau ) THEN 
             zcoef = 1. / ( zrhoa * zcdrag ) 
             !CDIR NOVERRCHK
@@ -652,8 +677,18 @@
                !CDIR NOVERRCHK
                DO ji = 1, jpi 
-                  wndm(ji,jj) = SQRT( taum(ji,jj) * zcoef )
+                  frcv(ji,jj,jpr_w10m) = SQRT( frcv(ji,jj,jpr_taum) * zcoef )
                END DO
             END DO
          ENDIF
+      ENDIF
+
+      ! u(v)tau and taum will be modified by ice model (wndm will be changed by PISCES)
+      ! -> need to be reset before each call of the ice/fsbc      
+      IF( MOD( kt-1, k_fsbc ) == 0 ) THEN
+         !
+         utau(:,:) = frcv(:,:,jpr_otx1)                   
+         vtau(:,:) = frcv(:,:,jpr_oty1)
+         taum(:,:) = frcv(:,:,jpr_taum)
+         wndm(:,:) = frcv(:,:,jpr_w10m)
          !  
       ENDIF
@@ -954,5 +989,4 @@
       !!       ===>> CAUTION here this changes the net heat flux received from
       !!             the atmosphere
-      !!              * 10m wind module (wndm)   
       !!
       !!             N.B. - fields over sea-ice are passed in argument so that
@@ -974,5 +1008,4 @@
       !!                   pdqns_ice           d(non-solar heat flux)/d(Temperature) over the ice
       !!                   sprecip             solid precipitation over the ocean  
-      !!                   wndm                10m wind module
       !!----------------------------------------------------------------------
       REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpl) ::   p_frld     ! lead fraction                [0 to 1]
@@ -1081,5 +1114,4 @@
       END SELECT
 
-
       SELECT CASE( TRIM( cn_rcv_dqnsdt ) )
       CASE ('coupled')
@@ -1087,11 +1119,4 @@
       END SELECT
 
-
-      !                                                      ! ========================= !
-      !                                                      !      10 m wind speed      !   (wndm)
-      !                                                      ! ========================= !
-      !
-      IF( srcv(jpr_w10m  )%laction )   wndm(:,:) = frcv(:,:,jpr_w10m)
-      !
    END SUBROUTINE sbc_cpl_ice_flx
    
