Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/OCE/TRA/traqsr.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/OCE/TRA/traqsr.F90	(revision 13331)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/OCE/TRA/traqsr.F90	(revision 13332)
@@ -63,5 +63,5 @@
    REAL(wp) ::   xsi1r   ! inverse of rn_si1
    !
-   REAL(wp) , DIMENSION(3,61)           ::   rkrgb    ! tabulated attenuation coefficients for RGB absorption
+   REAL(wp) , PUBLIC, DIMENSION(3,61)   ::   rkrgb    ! tabulated attenuation coefficients for RGB absorption
    TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_chl   ! structure of input Chl (file informations, fields read)
 
@@ -416,4 +416,10 @@
          IF(lwp) WRITE(numout,*) '   ==>>>   bio-model light penetration'
          IF( .NOT.lk_top )   CALL ctl_stop( 'No bio model : ln_qsr_bio = true impossible ' )
+         !                                   
+         CALL trc_oce_rgb( rkrgb )                 ! tabulated attenuation coef.
+         !                                   
+         nksr = trc_oce_ext_lev( r_si2, 33._wp )   ! level of light extinction
+         !
+         IF(lwp) WRITE(numout,*) '        level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m'
          !
       END SELECT
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/TOP/PISCES/P4Z/p4zopt.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/TOP/PISCES/P4Z/p4zopt.F90	(revision 13331)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/TOP/PISCES/P4Z/p4zopt.F90	(revision 13332)
@@ -38,8 +38,4 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ekb, ekg, ekr  ! wavelength (Red-Green-Blue)
 
-   INTEGER  ::   nksrp   ! levels below which the light cannot penetrate ( depth larger than 391 m)
-
-   REAL(wp), DIMENSION(3,61) ::   xkrgb   ! tabulated attenuation coefficients for RGB absorption
-   
    !!----------------------------------------------------------------------
    !! NEMO/TOP 4.0 , NEMO Consortium (2018)
@@ -92,7 +88,7 @@
                irgb = NINT( 41 + 20.* LOG10( zchl ) + rtrn )
                !                                                         
-               ekb(ji,jj,jk) = xkrgb(1,irgb) * e3t_n(ji,jj,jk)
-               ekg(ji,jj,jk) = xkrgb(2,irgb) * e3t_n(ji,jj,jk)
-               ekr(ji,jj,jk) = xkrgb(3,irgb) * e3t_n(ji,jj,jk)
+               ekb(ji,jj,jk) = rkrgb(1,irgb) * e3t_n(ji,jj,jk)
+               ekg(ji,jj,jk) = rkrgb(2,irgb) * e3t_n(ji,jj,jk)
+               ekr(ji,jj,jk) = rkrgb(3,irgb) * e3t_n(ji,jj,jk)
             END DO
          END DO
@@ -106,5 +102,5 @@
          CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3, pqsr100 = zqsr100 ) 
          !
-         DO jk = 1, nksrp      
+         DO jk = 1, nksr      
             etot_ndcy(:,:,jk) =        ze1(:,:,jk) +        ze2(:,:,jk) +       ze3(:,:,jk)
             enano    (:,:,jk) =  1.85 * ze1(:,:,jk) + 0.69 * ze2(:,:,jk) + 0.46 * ze3(:,:,jk)
@@ -112,5 +108,5 @@
          END DO
          IF( ln_p5z ) THEN
-            DO jk = 1, nksrp      
+            DO jk = 1, nksr      
               epico  (:,:,jk) =  1.94 * ze1(:,:,jk) + 0.66 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk)
             END DO
@@ -121,5 +117,5 @@
          CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3 ) 
          !
-         DO jk = 1, nksrp      
+         DO jk = 1, nksr      
             etot(:,:,jk) =  ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk)
          END DO
@@ -131,5 +127,5 @@
          CALL p4z_opt_par( kt, zqsr_corr, ze1, ze2, ze3, pqsr100 = zqsr100  ) 
          !
-         DO jk = 1, nksrp      
+         DO jk = 1, nksr      
             etot (:,:,jk) =         ze1(:,:,jk) +        ze2(:,:,jk) +       ze3(:,:,jk)
             enano(:,:,jk) =  1.85 * ze1(:,:,jk) + 0.69 * ze2(:,:,jk) + 0.46 * ze3(:,:,jk)
@@ -137,5 +133,5 @@
          END DO
          IF( ln_p5z ) THEN
-            DO jk = 1, nksrp      
+            DO jk = 1, nksr      
               epico(:,:,jk) =  1.94 * ze1(:,:,jk) + 0.66 * ze2(:,:,jk) + 0.4 * ze3(:,:,jk)
             END DO
@@ -150,5 +146,5 @@
          !
          etot3(:,:,1) =  qsr(:,:) * tmask(:,:,1)
-         DO jk = 2, nksrp + 1
+         DO jk = 2, nksr + 1
             etot3(:,:,jk) =  ( ze0(:,:,jk) + ze1(:,:,jk) + ze2(:,:,jk) + ze3(:,:,jk) ) * tmask(:,:,jk)
          END DO
@@ -160,5 +156,5 @@
       heup_01(:,:) = gdepw_n(:,:,2)
 
-      DO jk = 2, nksrp
+      DO jk = 2, nksr
          DO jj = 1, jpj
            DO ji = 1, jpi
@@ -182,5 +178,5 @@
       zetmp2 (:,:)   = 0.e0
 
-      DO jk = 1, nksrp
+      DO jk = 1, nksr
          DO jj = 1, jpj
             DO ji = 1, jpi
@@ -197,5 +193,5 @@
       zpar(:,:,:) = etot_ndcy(:,:,:)  ! diagnostic : PAR with no diurnal cycle 
       !
-      DO jk = 1, nksrp
+      DO jk = 1, nksr
          DO jj = 1, jpj
             DO ji = 1, jpi
@@ -213,5 +209,5 @@
       zetmp4 (:,:)   = 0.e0
       !
-      DO jk = 1, nksrp
+      DO jk = 1, nksr
          DO jj = 1, jpj
             DO ji = 1, jpi
@@ -227,5 +223,5 @@
       ediatm(:,:,:) = ediat(:,:,:)
       !
-      DO jk = 1, nksrp
+      DO jk = 1, nksr
          DO jj = 1, jpj
             DO ji = 1, jpi
@@ -241,5 +237,5 @@
       IF( ln_p5z ) THEN
          ALLOCATE( zetmp5(jpi,jpj) )  ;   zetmp5 (:,:) = 0.e0
-         DO jk = 1, nksrp
+         DO jk = 1, nksr
             DO jj = 1, jpj
                DO ji = 1, jpi
@@ -253,5 +249,5 @@
          epicom(:,:,:) = epico(:,:,:)
          !
-         DO jk = 1, nksrp
+         DO jk = 1, nksr
             DO jj = 1, jpj
                DO ji = 1, jpi
@@ -310,5 +306,5 @@
          pe3(:,:,1) = zqsr(:,:)
          !
-         DO jk = 2, nksrp + 1
+         DO jk = 2, nksr + 1
             DO jj = 1, jpj
                DO ji = 1, jpi
@@ -329,5 +325,5 @@
         pe3(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekr(:,:,1) )
         !
-        DO jk = 2, nksrp      
+        DO jk = 2, nksr      
            DO jj = 1, jpj
               DO ji = 1, jpi
@@ -435,9 +431,4 @@
          ntimes_par = iom_getszuld( numpar )   ! get number of record in file
       ENDIF
-      !
-      CALL trc_oce_rgb( xkrgb )                  ! tabulated attenuation coefficients
-      nksrp = trc_oce_ext_lev( r_si2, 0.33e2 )     ! max level of light extinction (Blue Chl=0.01)
-      !
-      IF(lwp) WRITE(numout,*) '        level of light extinction = ', nksrp, ' ref depth = ', gdepw_1d(nksrp+1), ' m'
       !
                          ekr      (:,:,:) = 0._wp
Index: /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/TOP/oce_trc.F90
===================================================================
--- /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/TOP/oce_trc.F90	(revision 13331)
+++ /NEMO/branches/2020/r4.0-HEAD_r12713_clem_dan_fixcpl/src/TOP/oce_trc.F90	(revision 13332)
@@ -65,4 +65,6 @@
    USE traqsr  , ONLY :   rn_abs     =>    rn_abs     !: fraction absorbed in the very near surface
    USE traqsr  , ONLY :   rn_si0     =>    rn_si0     !: very near surface depth of extinction
+   USE traqsr  , ONLY :   nksr       =>    nksr       !: levels below which the light cannot penetrate (depth larger than 391 m)
+   USE traqsr  , ONLY :   rkrgb      =>    rkrgb      !: tabulated attenuation coefficients for RGB absorption
    USE traqsr  , ONLY :   ln_qsr_bio =>    ln_qsr_bio !: flag to use or not the biological fluxes for light
    USE sbcrnf  , ONLY :   rnfmsk     =>    rnfmsk     !: mixed adv scheme in runoffs vicinity (hori.) 
