Index: branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90
===================================================================
--- branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90	(revision 3556)
+++ branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90	(revision 3556)
@@ -0,0 +1,294 @@
+MODULE cyclone
+   !!======================================================================
+   !!                       ***  MODULE  cyclone  ***
+   !! add the Tropical Cyclones along tracks to the surface wind forcing
+   !!                 
+   !!======================================================================
+   !! History : 3.3  ! 2010-05  (E Vincent, G Madec, S Masson)  Original code
+   !!----------------------------------------------------------------------
+
+#if defined key_cyclone
+   !!----------------------------------------------------------------------
+   !!  'key_cyclone' : key option add Tropical Cyclones in the wind forcing
+   !!----------------------------------------------------------------------
+   !!   wnd_cyc      : 1 module subroutine
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and active tracers
+   USE sbc_oce         ! surface boundary condition: ocean
+   USE dom_oce         ! ocean space domain variables
+   USE phycst          ! physical constant
+   USE fldread         ! read input fields
+   USE in_out_manager  ! I/O manager
+   USE geo2ocean       ! tools for projection on ORCA grid
+   USE lib_mpp       
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   wnd_cyc   ! routine called in sbcblk_core.F90 module
+
+   INTEGER , PARAMETER ::   jp_is1  = 1   ! index of presence 1 or absence 0 of a TC record
+   INTEGER , PARAMETER ::   jp_lon  = 2   ! index of longitude for present TCs
+   INTEGER , PARAMETER ::   jp_lat  = 3   ! index of latitude  for present TCs
+   INTEGER , PARAMETER ::   jp_vmax = 4   ! index of max wind  for present TCs
+   INTEGER , PARAMETER ::   jp_pres = 5   ! index of eye-pres  for present TCs
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
+
+   !! * Substitutions
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010) 
+   !! $Id: module_example 1146 2008-06-25 11:42:56Z rblod $ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE wnd_cyc( kt, pwnd_i, pwnd_j, ptmask_tc )
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE wnd_cyc  ***
+      !!
+      !! ** Purpose :  Add cyclone winds on the ORCA grid
+      !!
+      !! ** Action  : - open TC data, find TCs for the current timestep
+      !!              - for each potential TC, add the winds on the grid
+      !!----------------------------------------------------------------------
+      INTEGER , INTENT(in)                      ::   kt       ! time step index 
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   pwnd_i   ! wind speed i-components at T-point ORCA direction
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   pwnd_j   ! wind speed j-components at T-point ORCA direction
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   ptmask_tc ! mask = 1 where TC are added
+      ! add Manu !
+      
+      !!
+      INTEGER  ::   ji, jj , jtc        ! loop arguments
+      INTEGER  ::   ierror              ! loop arguments
+      INTEGER  ::   vortex=1            ! vortex shape to be used: 0=Holland 1=Willoughby
+      REAL(wp) ::   zrout1=1.5e6        ! distance from center where we begin to kill vortex (m)
+      REAL(wp) ::   zrout2=2.5e6        ! distance from center where we bring vortex to zero (m)
+      REAL(wp) ::   zb                  ! power in Holland vortex shape
+      REAL(wp) ::   zA                  ! shape parameter in Willoughby vortex : A transtion between first and second outter exp
+      REAL(wp) ::   zn                  ! shape parameter in Willoughby vortex : n power law in the eye
+      REAL(wp) ::   zXX1                ! shape parameter in Willoughby vortex : decay length second outter exponential
+      REAL(wp) ::   zXX2                ! shape parameter in Willoughby vortex : decay length first  outter exponential
+      REAL(wp) ::   zztmp               ! temporary 
+      REAL(wp) ::   zzrglam, zzrgphi    ! temporary 
+      REAL(wp) ::   ztheta              ! azimuthal angle
+      REAL(wp) ::   zdist               ! dist to the TC center
+      REAL(wp) ::   zhemi               ! 1 for NH ;  -1 for SH
+      REAL(wp) ::   zinfl               ! clim inflow angle in TCs
+      REAL(wp) ::   zrmw                ! mean radius of Max wind of a tropical cyclone (Willoughby 2004) [m]
+      REAL(wp) ::   zwnd_r, zwnd_t      ! radial and tangential components of the wind
+      REAL(wp), DIMENSION(jpi,jpj) ::   zwnd_x, zwnd_y   ! zonal and meridional components of the wind
+
+      REAL(wp), DIMENSION(14,5)    ::   ztct                ! tropical cyclone track data at kt
+      REAL(wp)                     ::   zvmax               ! timestep interpolated vmax
+      REAL(wp)                     ::   zrlon, zrlat        ! temporary 
+      !!
+      CHARACTER(len=100) ::  cn_dir            ! Root directory for location of files
+      TYPE(FLD_N), DIMENSION(1) ::   slf_i     ! array of namelist informations on the TC position
+      TYPE(FLD_N) ::   sn_tc                   ! informations about the fields to be read
+      !      NAMELIST/namsbc_tc/ cn_dir , sn_tc
+      !!--------------------------------------------------------------------
+
+
+      !                                         ! ====================== !
+      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
+         !                                      ! ====================== !
+         ! set file information (default values)
+         cn_dir = './'       ! directory in which the model is executed
+         !
+         ! (NB: frequency positive => hours, negative => months)
+         !          !    file     ! frequency !  variable ! time intep !  clim   ! 'yearly' or ! weights  ! rotation   !
+         !          !    name     !  (hours)  !   name    !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs      !
+         sn_tc = FLD_N( 'tc_track',     6     ,  'tc'     ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
+         !
+         !         REWIND( numnam )                    ! ... read in namlist namsbc_core
+         !         READ  ( numnam, namsbc_tc )
+         !
+         ! set sf structure
+         ALLOCATE( sf(1), STAT=ierror )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'wnd_cyc: unable to allocate sf structure' )   ;   RETURN
+         ENDIF
+         ALLOCATE( sf(1)%fnow(14,5,1) )
+         ALLOCATE( sf(1)%fdta(14,5,2,1) )
+         slf_i(1) = sn_tc
+         !
+         ! fill sf with slf_i and control print
+         CALL fld_fill( sf, slf_i, cn_dir, 'sbc_blk_tc', 'tropical cyclone track', 'namsbc_tc' )
+         !
+      ENDIF
+
+
+      !       Interpolation of lon lat vmax... at the current timestep
+      !       ***************************************************************
+
+      CALL fld_read( kt, nn_fsbc, sf )                   ! input fields provided at the current time-step
+
+      ztct(:,:) = sf(1)%fnow(:,:,1)
+
+      !       Add TC wind on the grid
+      !       ***************************************************************
+
+      zwnd_x(:,:) = 0.e0  
+      zwnd_y(:,:) = 0.e0 
+      
+      ptmask_tc(:,:) = 0.e0  
+      ! add Manu !
+  
+      DO jtc = 1, 14
+         !
+         IF( ztct(jtc,jp_is1) == 1 ) THEN                ! cyclone is defined in this slot ? yes--> begin
+
+            zvmax =       ztct(jtc,jp_vmax)
+            zrlon = rad * ztct(jtc,jp_lon )
+            zrlat = rad * ztct(jtc,jp_lat )
+            zhemi = SIGN( 1. , zrlat )
+            zinfl = 15.* rad                             ! clim inflow angle in Tropical Cyclones
+         IF ( vortex == 0 ) THEN
+
+            ! Vortex Holland reconstruct wind at each lon-lat position
+            ! ********************************************************
+            zrmw = 51.6 * EXP( -0.0223*zvmax + 0.0281* ABS( ztct(jtc,jp_lat) ) ) * 1000.
+            ! climatological ZRMW of cyclones as a function of wind and latitude (Willoughby 2004)             
+            ! zb = 1.0036 + 0.0173 * zvmax - 0.0313 * LOG(zrmw/1000.) + 0.0087 * ABS( ztct(jtc,jp_lat) ) 
+            ! fitted B parameter (Willoughby 2004)
+            zb = 2.
+
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+
+                  ! calc distance between TC center and any point following great circle
+                  ! source : http://www.movable-type.co.uk/scripts/latlong.html
+                  zzrglam = rad * glamt(ji,jj) - zrlon
+                  zzrgphi = rad * gphit(ji,jj)
+                  zdist = ra * ACOS(  SIN( zrlat ) * SIN( zzrgphi )   &
+                     &              + COS( zrlat ) * COS( zzrgphi ) * COS( zzrglam ) )
+
+                 IF (zdist < zrout2) THEN ! calculation of wind only to a given max radius
+                  ! shape of the wind profile
+                  zztmp = ( zrmw / ( zdist + 1.e-12 ) )**zb
+                  zztmp =  zvmax * SQRT( zztmp * EXP(1. - zztmp) )    
+
+                  IF (zdist > zrout1) THEN ! bring to zero between r_out1 and r_out2
+                     zztmp = zztmp * ( (zrout2-zdist)*1.e-6 )
+                  ENDIF
+
+                  ! !!! KILL EQ WINDS
+                  ! IF (SIGN( 1. , zrlat ) /= zhemi) THEN
+                  !    zztmp = 0.                              ! winds in other hemisphere
+                  !    IF (ABS(gphit(ji,jj)) <= 5.) zztmp=0.   ! kill between 5N-5S
+                  ! ENDIF
+                  ! IF (ABS(gphit(ji,jj)) <= 10. .and. ABS(gphit(ji,jj)) > 5.) THEN
+                  !    zztmp = zztmp * ( 1./5. * (ABS(gphit(ji,jj)) - 5.) ) 
+                  !    !linear to zero between 10 and 5
+                  ! ENDIF
+                  ! !!! / KILL EQ
+
+                  IF (ABS(gphit(ji,jj)) >= 55.) zztmp = 0. ! kill weak spurious winds at high latitude
+
+                  zwnd_t =   COS( zinfl ) * zztmp    
+                  zwnd_r = - SIN( zinfl ) * zztmp
+
+                  ! Project radial-tangential components on zonal-meridional components
+                  ! -------------------------------------------------------------------
+                  
+                  ! ztheta = azimuthal angle of the great circle between two points
+                  zztmp = COS( zrlat ) * SIN( zzrgphi ) &
+                     &  - SIN( zrlat ) * COS( zzrgphi ) * COS( zzrglam )
+                  ztheta = ATAN2(        COS( zzrgphi ) * SIN( zzrglam ) , zztmp )
+
+                  zwnd_x(ji,jj) = zwnd_x(ji,jj) - zhemi * COS(ztheta)*zwnd_t + SIN(ztheta)*zwnd_r
+                  zwnd_y(ji,jj) = zwnd_y(ji,jj) + zhemi * SIN(ztheta)*zwnd_t + COS(ztheta)*zwnd_r
+
+                  ptmask_tc(ji,jj) = 1. !MAX( 1., ptmask_tc(ji,jj) ) 
+                  ! add Manu !
+  
+
+                 ENDIF
+               END DO
+            END DO
+         
+         ELSE IF ( vortex == 1 ) THEN
+
+            ! Vortex Willoughby reconstruct wind at each lon-lat position
+            ! ***********************************************************
+            zrmw = 46.4 * EXP( -0.0155*zvmax + 0.0169* ABS( ztct(jtc,jp_lat) ) )*1000.
+            ! climatological ZRMW of cyclones as a function of wind and latitude (Willoughby 2006)
+            zXX2 = 25.*1000.                                              ! 25km fixed "near-eye" exponential decay
+            zXX1 = ( 287.6  - 1.942 *zvmax + 7.799 *LOG(zrmw/1000.) + 1.819 *ABS( ztct(jtc,jp_lat) ) )*1000.    
+            zn   =   2.1340 + 0.0077*zvmax - 0.4522*LOG(zrmw/1000.) - 0.0038*ABS( ztct(jtc,jp_lat) )            
+            zA   =   0.5913 + 0.0029*zvmax - 0.1361*LOG(zrmw/1000.) - 0.0042*ABS( ztct(jtc,jp_lat) )  
+            IF (zA < 0) THEN 
+               zA=0
+            ENDIF           
+        
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                                  
+                  zzrglam = rad * glamt(ji,jj) - zrlon
+                  zzrgphi = rad * gphit(ji,jj)
+                  zdist = ra * ACOS(  SIN( zrlat ) * SIN( zzrgphi )   &
+                     &              + COS( zrlat ) * COS( zzrgphi ) * COS( zzrglam ) )
+
+                 IF (zdist < zrout2) THEN ! calculation of wind only to a given max radius
+               
+                  ! shape of the wind profile                     
+                  IF (zdist <= zrmw) THEN     ! inside the Radius of Maximum Wind
+                     zztmp  = zvmax * (zdist/zrmw)**zn
+                  ELSE 
+                     zztmp  = zvmax * ( (1-zA) * EXP(- (zdist-zrmw)/zXX1 ) + zA * EXP(- (zdist-zrmw)/zXX2 ) )
+                  ENDIF
+
+                  IF (zdist > zrout1) THEN ! bring to zero between r_out1 and r_out2
+                     zztmp = zztmp * ( (zrout2-zdist)*1.e-6 )
+                  ENDIF
+
+                  ! !!! KILL EQ WINDS
+                  ! IF (SIGN( 1. , zrlat ) /= zhemi) THEN
+                  !    zztmp = 0.                              ! winds in other hemisphere
+                  !    IF (ABS(gphit(ji,jj)) <= 5.) zztmp=0.   ! kill between 5N-5S
+                  ! ENDIF
+                  ! IF (ABS(gphit(ji,jj)) <= 10. .and. ABS(gphit(ji,jj)) > 5.) THEN
+                  !    zztmp = zztmp * ( 1./5. * (ABS(gphit(ji,jj)) - 5.) ) 
+                  !    !linear to zero between 10 and 5
+                  ! ENDIF
+                  ! !!! / KILL EQ
+
+                  IF (ABS(gphit(ji,jj)) >= 55.) zztmp = 0. ! kill weak spurious winds at high latitude
+
+                  zwnd_t =   COS( zinfl ) * zztmp    
+                  zwnd_r = - SIN( zinfl ) * zztmp
+
+                  ! Project radial-tangential components on zonal-meridional components
+                  ! -------------------------------------------------------------------
+                  
+                  ! ztheta = azimuthal angle of the great circle between two points
+                  zztmp = COS( zrlat ) * SIN( zzrgphi ) &
+                     &  - SIN( zrlat ) * COS( zzrgphi ) * COS( zzrglam )
+                  ztheta = ATAN2(        COS( zzrgphi ) * SIN( zzrglam ) , zztmp )
+
+                  zwnd_x(ji,jj) = zwnd_x(ji,jj) - zhemi * COS(ztheta)*zwnd_t + SIN(ztheta)*zwnd_r
+                  zwnd_y(ji,jj) = zwnd_y(ji,jj) + zhemi * SIN(ztheta)*zwnd_t + COS(ztheta)*zwnd_r
+                  
+                  ptmask_tc(ji,jj) = 1. !MAX( 1., ptmask_tc(ji,jj) ) 
+                  ! add Manu !
+  
+                 ENDIF
+               END DO
+            END DO
+         ENDIF                                         ! / vortex Holland or Wiloughby
+         ENDIF                                           ! / cyclone is defined in this slot ? yes--> begin
+      END DO ! / end simultaneous cyclones loop
+
+      CALL rot_rep ( zwnd_x, zwnd_y, 'T', 'en->i', pwnd_i ) !rotation of components on ORCA grid
+      CALL rot_rep ( zwnd_x, zwnd_y, 'T', 'en->j', pwnd_j ) !rotation of components on ORCA grid
+
+
+   END SUBROUTINE wnd_cyc
+
+#endif
+
+   !!======================================================================
+END MODULE cyclone
Index: branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 3531)
+++ branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/fldread.F90	(revision 3556)
@@ -627,8 +627,10 @@
       INTEGER  , INTENT(in), OPTIONAL, DIMENSION(:) :: map ! global-to-local mapping indices
       !!
+      INTEGER                  ::   ipi    ! number of i-point sdjf%fdta
       INTEGER                  ::   ipk    ! number of vertical levels of sdjf%fdta ( 2D: ipk=1 ; 3D: ipk=jpk )
       INTEGER                  ::   iw     ! index into wgts array
       !!---------------------------------------------------------------------
             
+      ipi = SIZE( sdjf%fnow, 1 )
       ipk = SIZE( sdjf%fnow, 3 )
 
@@ -645,6 +647,12 @@
          SELECT CASE( ipk )
          CASE(1)   
-            IF( sdjf%ln_tint ) THEN   ;   CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,1,2), sdjf%nrec_a(1) )
-            ELSE                      ;   CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fnow(:,:,1  ), sdjf%nrec_a(1) )
+            IF( ipi == jpi ) THEN
+               IF( sdjf%ln_tint ) THEN   ;   CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fdta(:,:,1,2), sdjf%nrec_a(1) )
+               ELSE                      ;   CALL iom_get( sdjf%num, jpdom_data, sdjf%clvar, sdjf%fnow(:,:,1  ), sdjf%nrec_a(1) )
+               ENDIF
+            ELSE
+               IF( sdjf%ln_tint ) THEN   ;   CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fdta(:,:,1,2), sdjf%nrec_a(1) )
+               ELSE                      ;   CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fnow(:,:,1  ), sdjf%nrec_a(1) )
+               ENDIF
             ENDIF
          CASE DEFAULT
Index: branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 3531)
+++ branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 3556)
@@ -29,4 +29,5 @@
    USE fldread         ! read input fields
    USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE cyclone         ! Cyclone 10m wind form trac of cyclone centres
    USE sbcdcy          ! surface boundary condition: diurnal cycle
    USE iom             ! I/O manager library
@@ -186,5 +187,5 @@
 
       !                                                        ! surface ocean fluxes computed with CLIO bulk formulea
-      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( sf, sst_m, ssu_m, ssv_m )
+      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( kt, sf, sst_m, ssu_m, ssv_m )
 
 #if defined key_cice
@@ -204,5 +205,5 @@
    
    
-   SUBROUTINE blk_oce_core( sf, pst, pu, pv )
+   SUBROUTINE blk_oce_core( kt, sf, pst, pu, pv )
       !!---------------------------------------------------------------------
       !!                     ***  ROUTINE blk_core  ***
@@ -225,12 +226,18 @@
       !!  ** Nota  :   sf has to be a dummy argument for AGRIF on NEC
       !!---------------------------------------------------------------------
-      TYPE(fld), INTENT(in), DIMENSION(:)   ::   sf    ! input data
-      REAL(wp) , INTENT(in), DIMENSION(:,:) ::   pst   ! surface temperature                      [Celcius]
-      REAL(wp) , INTENT(in), DIMENSION(:,:) ::   pu    ! surface current at U-point (i-component) [m/s]
-      REAL(wp) , INTENT(in), DIMENSION(:,:) ::   pv    ! surface current at V-point (j-component) [m/s]
+      INTEGER  , INTENT(in   )                 ::   kt    ! time step index
+      TYPE(fld), INTENT(inout), DIMENSION(:)   ::   sf    ! input data
+      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pst   ! surface temperature                      [Celcius]
+      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pu    ! surface current at U-point (i-component) [m/s]
+      REAL(wp) , INTENT(in)   , DIMENSION(:,:) ::   pv    ! surface current at V-point (j-component) [m/s]
       !
       INTEGER  ::   ji, jj               ! dummy loop indices
       REAL(wp) ::   zcoef_qsatw, zztmp   ! local variable
       REAL(wp), DIMENSION(:,:), POINTER ::   zwnd_i, zwnd_j    ! wind speed components at T-point
+#if defined key_cyclone
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztmask_tc          ! mask = 1 where TC are added
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztcmask_qns        ! total            non-solar heat flux within TC footprints
+      REAL(wp), DIMENSION(:,:), POINTER ::   ztcmask_qnsneg     ! negative part of non-solar heat flux within TC footprints
+#endif
       REAL(wp), DIMENSION(:,:), POINTER ::   zqsatw            ! specific humidity at pst
       REAL(wp), DIMENSION(:,:), POINTER ::   zqlw, zqsb        ! long wave and sensible heat fluxes
@@ -261,4 +268,19 @@
       zwnd_i(:,:) = 0.e0  
       zwnd_j(:,:) = 0.e0
+
+#if defined key_cyclone
+     CALL wrk_alloc( jpi, jpj, ztmask_tc, ztcmask_qns, ztcmask_qnsneg )
+# if defined key_vectopt_loop
+!CDIR COLLAPSE
+# endif
+      CALL wnd_cyc( kt, zwnd_i, zwnd_j, ztmask_tc )    ! add Manu !
+      DO jj = 2, jpjm1
+         DO ji = fs_2, fs_jpim1   ! vect. opt.
+            sf(jp_wndi)%fnow(ji,jj,1) = sf(jp_wndi)%fnow(ji,jj,1) + zwnd_i(ji,jj)
+            sf(jp_wndj)%fnow(ji,jj,1) = sf(jp_wndj)%fnow(ji,jj,1) + zwnd_j(ji,jj)
+         END DO
+      END DO
+#endif
+
 #if defined key_vectopt_loop
 !CDIR COLLAPSE
@@ -389,4 +411,11 @@
       CALL iom_put( "qns_oce",   qns  )                 ! output downward non solar heat over the ocean
       !
+#if defined key_cyclone
+      ztcmask_qns(:,:) = qns(:,:) *  ztmask_tc(:,:)
+      ztcmask_qnsneg(:,:) = MIN( qns(:,:) ,  0.e0 ) *  ztmask_tc(:,:) ! MAX/MIN sur tableau 2D ??
+      CALL iom_put( "qns_tcmask",   ztcmask_qns  )       ! output downward non solar heat over the ocean within TC footprints
+      CALL iom_put( "qns_tcneg",   ztcmask_qnsneg  )     ! output downward non solar heat over the ocean negative part only
+      CALL wrk_dealloc( jpi, jpj, ztmask_tc, ztcmask_qns, ztcmask_qnsneg )
+#endif
       IF(ln_ctl) THEN
          CALL prt_ctl(tab2d_1=zqsb , clinfo1=' blk_oce_core: zqsb   : ', tab2d_2=zqlw , clinfo2=' zqlw  : ')
