Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 4239)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 4275)
@@ -107,5 +107,5 @@
       !!                  ***  FUNCTION sbc_oce_alloc  ***
       !!---------------------------------------------------------------------
-      INTEGER :: ierr(4)
+      INTEGER :: ierr(5)
       !!---------------------------------------------------------------------
       ierr(:) = 0
@@ -128,4 +128,6 @@
          &      ssu_m  (jpi,jpj) , sst_m(jpi,jpj) ,                       &
          &      ssv_m  (jpi,jpj) , sss_m  (jpi,jpj), ssh_m(jpi,jpj) , STAT=ierr(4) )
+         !
+         IF( ltrcdm2dc ) ALLOCATE( qsr_mean(jpi,jpj) , STAT=ierr(5) )
          !
       sbc_oce_alloc = MAXVAL( ierr )
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 4239)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 4275)
@@ -191,7 +191,5 @@
 
       ! If diurnal cycle is activated, compute a daily mean short waves flux for biogeochemistery 
-#if defined key_top
-      IF( ltrcdm2dc )CALL blk_bio_meanqsr
-#endif
+      IF( ltrcdm2dc )   CALL blk_bio_meanqsr
 
 #if defined key_cice
@@ -440,7 +438,4 @@
       !! 
       !!---------------------------------------------------------------------
-      INTEGER  :: ji,jj
-      REAL(wp) :: zfrld
-      !!---------------------------------------------------------------------
       IF( nn_timing == 1 )  CALL timing_start('blk_bio_meanqsr')
 
@@ -450,5 +445,6 @@
 
    END SUBROUTINE blk_bio_meanqsr
-
+ 
+ 
    SUBROUTINE blk_ice_meanqsr(palb,p_qsr_mean,pdim)
       !!---------------------------------------------------------------------
@@ -464,5 +460,5 @@
       REAL(wp) ::   zztmp         ! temporary variable
       !!---------------------------------------------------------------------
-
+      !
       ijpl  = pdim                            ! number of ice categories
       zztmp = 1. / ( 1. - albo )
@@ -473,9 +469,10 @@
             DO ji = 1, jpi
                   p_qsr_mean(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr_mean(ji,jj)
-            ENDDO
-         ENDDO
-      ENDDO
-
+            END DO
+         END DO
+      END DO
+      !
    END SUBROUTINE blk_ice_meanqsr  
+ 
    
    SUBROUTINE blk_ice_core(  pst   , pui   , pvi   , palb ,   &
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90	(revision 4239)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90	(revision 4275)
@@ -176,6 +176,5 @@
                &                      tprecip    , sprecip    ,                         &
                &                      fr1_i0     , fr2_i0     , cp_ice_msh , jpl  )
-            IF( ltrcdm2dc_ice ) & 
-            CALL blk_ice_meanqsr(zalb_ice_cs,qsr_ice_mean,jpl  )
+            IF( ltrcdm2dc_ice )   CALL blk_ice_meanqsr( zalb_ice_cs, qsr_ice_mean, jpl )
 
          CASE( 5 )           ! Coupled formulation : atmosphere-ice stress only (fluxes provided after ice dynamics)
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 4239)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 4275)
@@ -149,7 +149,4 @@
 # endif
 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr_tmp  !: save qsr with diurnal cycle during TOP/PISCES 
-                                                                     !: timestep                [W/m2]
-
 #else
    !!----------------------------------------------------------------------
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 4239)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 4275)
@@ -60,5 +60,4 @@
       !!---------------------------------------------------------------------
       INTEGER ::   jk, jn, jl    ! dummy loop indices
-      INTEGER ::   ierr
       CHARACTER (len=25) :: charout
       REAL(wp), POINTER, DIMENSION(:,:,:,:) ::  ztrcdta   ! 4D  workspace
@@ -73,13 +72,12 @@
       CALL top_alloc()              ! allocate TOP arrays
 
-      IF( ln_dm2dc )THEN
+      IF( ln_dm2dc .AND. ln_blk_core .AND. nn_ice==2 )THEN
+         ! When Diurnal cycle, core bulk and LIM2  are activated, 
+         ! a daily mean qsr is computed for tracer/biogeochemistery model 
          CALL ctl_warn( ' Diurnal cycle on physics but not in PISCES or LOBSTER ' )
          ltrcdm2dc     = .TRUE.
          ltrcdm2dc_ice = .TRUE.
-         ALLOCATE( qsr_mean(jpi,jpj) , qsr_tmp(jpi,jpj) , STAT = ierr )
-
-         IF( lk_mpp    )   CALL mpp_sum ( ierr )
-         IF( ierr  > 0 )   CALL ctl_warn('trc_ini: allocation of arrays qsr_mean failed')
-
+      ELSE
+         CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES ' ) 
       ENDIF
 
Index: branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
===================================================================
--- branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 4239)
+++ branches/2013/dev_r3856_MERCATOR3_QSRMEAN24H/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 4275)
@@ -52,5 +52,7 @@
       INTEGER               ::  jk, jn  ! dummy loop indices
       REAL(wp)              ::  ztrai
-      CHARACTER (len=25)    ::  charout
+      CHARACTER (len=25)    ::  charout 
+
+      REAL(wp), DIMENSION(:,:), POINTER ::   qsr_tmp ! save qsr during TOP time-step
       !!-------------------------------------------------------------------
       !
@@ -67,5 +69,8 @@
       ENDIF
       !    
-      IF( ln_dm2dc )THEN
+      IF( ltrcdm2dc )THEN
+         ! When Diurnal cycle, core bulk and LIM2  are activated, put daily mean qsr in qsr for TOP/biogeochemistery time-step
+         ! and save qsr with diurnal cycle in qsr_tmp
+         CALL wrk_alloc( jpi,jpj, qsr_tmp )
          qsr_tmp = qsr
          qsr     = qsr_mean    
@@ -98,6 +103,8 @@
       ENDIF
       !
-      IF( ln_dm2dc )THEN
+      IF( ltrcdm2dc )THEN
+         ! put back qsr with diurnal cycle in qsr
          qsr = qsr_tmp
+         CALL wrk_dealloc( jpi,jpj, qsr_tmp )
       ENDIF
       !
