Index: branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 4668)
+++ branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 5086)
@@ -21,6 +21,6 @@
    USE sbc_oce         ! surface boundary condition: ocean
    USE trc_oce         ! share SMS/Ocean variables
-   USE trdmod_oce      ! ocean variables trends
-   USE trdtra          ! ocean active tracers trends 
+   USE trd_oce        ! trends: ocean variables
+   USE trdtra         ! trends manager: tracers
    USE in_out_manager  ! I/O manager
    USE phycst          ! physical constants
@@ -129,4 +129,6 @@
       IF( kt == nit000 ) THEN                     ! Set the forcing field at nit000 - 1
          !                                        ! -----------------------------------
+         qsr_hc(:,:,:) = 0.e0
+         !
          IF( ln_rstart .AND.    &                    ! Restart: read in restart file
               & iom_varid( numror, 'qsr_hc_b', ldstop = .FALSE. ) > 0 ) THEN
@@ -167,6 +169,5 @@
                DO ji = 1, jpi
                   IF ( qsr(ji,jj) /= 0._wp ) THEN
-                     oatte(ji,jj) = ( qsr_hc(ji,jj,1) / ( r1_rau0_rcp * qsr(ji,jj) ) )
-                     iatte(ji,jj) = oatte(ji,jj)
+                     fraqsr_1lev(ji,jj) = ( qsr_hc(ji,jj,1) / ( r1_rau0_rcp * qsr(ji,jj) ) )
                   ENDIF
                END DO
@@ -239,6 +240,5 @@
                         zzc2 = zcoef  * EXP( - fse3t(ji,jj,1) * zekg(ji,jj) )
                         zzc3 = zcoef  * EXP( - fse3t(ji,jj,1) * zekr(ji,jj) )
-                        oatte(ji,jj) = 1.0 - ( zzc0 + zzc1 + zzc2  + zzc3  ) * tmask(ji,jj,2) 
-                        iatte(ji,jj) = 1.0 - ( zzc0 + zzc1 + zcoef + zcoef ) * tmask(ji,jj,2)
+                        fraqsr_1lev(ji,jj) = 1.0 - ( zzc0 + zzc1 + zzc2  + zzc3  ) * tmask(ji,jj,2) 
                      END DO
                   END DO
@@ -257,6 +257,5 @@
                ! clem: store attenuation coefficient of the first ocean level
                IF ( lk_lim3 .AND. ln_qsr_ice ) THEN
-                  oatte(:,:) = etot3(:,:,1) / r1_rau0_rcp
-                  iatte(:,:) = oatte(:,:)
+                  fraqsr_1lev(:,:) = etot3(:,:,1) / r1_rau0_rcp
                ENDIF
            ENDIF
@@ -285,6 +284,5 @@
                         zc0 = zz0 * EXP( -fsdepw(ji,jj,1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,1)*xsi1r )
                         zc1 = zz0 * EXP( -fsdepw(ji,jj,2)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,2)*xsi1r )
-                        oatte(ji,jj) = ( zc0*tmask(ji,jj,1) - zc1*tmask(ji,jj,2) ) / r1_rau0_rcp
-                        iatte(ji,jj) = oatte(ji,jj)
+                        fraqsr_1lev(ji,jj) = ( zc0*tmask(ji,jj,1) - zc1*tmask(ji,jj,2) ) / r1_rau0_rcp
                      END DO
                   END DO
@@ -294,5 +292,6 @@
                   DO jj = 2, jpjm1
                      DO ji = fs_2, fs_jpim1   ! vector opt.
-                        qsr_hc(ji,jj,jk) =  etot3(ji,jj,jk) * qsr(ji,jj)
+                        ! (ISF) no light penetration below the ice shelves         
+                        qsr_hc(ji,jj,jk) =  etot3(ji,jj,jk) * qsr(ji,jj) * tmask(ji,jj,1)
                      END DO
                   END DO
@@ -300,6 +299,5 @@
                ! clem: store attenuation coefficient of the first ocean level
                IF ( lk_lim3 .AND. ln_qsr_ice ) THEN
-                  oatte(:,:) = etot3(:,:,1) / r1_rau0_rcp
-                  iatte(:,:) = oatte(:,:)
+                  fraqsr_1lev(:,:) = etot3(:,:,1) / r1_rau0_rcp
                ENDIF
                !
@@ -332,5 +330,5 @@
       IF( l_trdtra ) THEN     ! qsr tracers trends saved for diagnostics
          ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:)
-         CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_qsr, ztrdt )
+         CALL trd_tra( kt, 'TRA', jp_tem, jptra_qsr, ztrdt )
          CALL wrk_dealloc( jpi, jpj, jpk, ztrdt ) 
       ENDIF
@@ -382,8 +380,7 @@
       IF( nn_timing == 1 )  CALL timing_start('tra_qsr_init')
       !
-      ! clem init for oatte and iatte
+      ! Default value for fraqsr_1lev
       IF( .NOT. ln_rstart ) THEN
-         oatte(:,:) = 1._wp
-         iatte(:,:) = 1._wp
+         fraqsr_1lev(:,:) = 1._wp
       ENDIF
       !
@@ -520,5 +517,6 @@
                   !
                   DO jk = 1, nksr
-                     etot3(:,:,jk) = r1_rau0_rcp * ( zea(:,:,jk) - zea(:,:,jk+1) ) 
+                     ! (ISF) no light penetration below the ice shelves
+                     etot3(:,:,jk) = r1_rau0_rcp * ( zea(:,:,jk) - zea(:,:,jk+1) ) * tmask(:,:,1)
                   END DO
                   etot3(:,:,nksr+1:jpk) = 0.e0                ! below 400m set to zero
@@ -548,5 +546,5 @@
                         zc0 = zz0 * EXP( -fsdepw(ji,jj,jk  )*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk  )*xsi1r )
                         zc1 = zz0 * EXP( -fsdepw(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -fsdepw(ji,jj,jk+1)*xsi1r )
-                        etot3(ji,jj,jk) = (  zc0 * tmask(ji,jj,jk) - zc1 * tmask(ji,jj,jk+1)  ) 
+                        etot3(ji,jj,jk) = (  zc0 * tmask(ji,jj,jk) - zc1 * tmask(ji,jj,jk+1)  ) * tmask(ji,jj,1) 
                      END DO
                   END DO
