Index: NEMO/trunk/src/TOP/PISCES/P4Z/p4zopt.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/P4Z/p4zopt.F90	(revision 13295)
+++ NEMO/trunk/src/TOP/PISCES/P4Z/p4zopt.F90	(revision 13333)
@@ -37,8 +37,4 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   par_varsw      ! PAR fraction of shortwave
    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
    
    !! * Substitutions
@@ -94,7 +90,7 @@
          irgb = NINT( 41 + 20.* LOG10( zchl ) + rtrn )
          !                                                         
-         ekb(ji,jj,jk) = xkrgb(1,irgb) * e3t(ji,jj,jk,Kmm)
-         ekg(ji,jj,jk) = xkrgb(2,irgb) * e3t(ji,jj,jk,Kmm)
-         ekr(ji,jj,jk) = xkrgb(3,irgb) * e3t(ji,jj,jk,Kmm)
+         ekb(ji,jj,jk) = rkrgb(1,irgb) * e3t(ji,jj,jk,Kmm)
+         ekg(ji,jj,jk) = rkrgb(2,irgb) * e3t(ji,jj,jk,Kmm)
+         ekr(ji,jj,jk) = rkrgb(3,irgb) * e3t(ji,jj,jk,Kmm)
       END_3D
       !                                        !* Photosynthetically Available Radiation (PAR)
@@ -106,5 +102,5 @@
          CALL p4z_opt_par( kt, Kmm, 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, Kmm, 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, Kmm, 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(:,:,2,Kmm)
 
-      DO_3D( 1, 1, 1, 1, 2, nksrp )
+      DO_3D( 1, 1, 1, 1, 2, nksr )
         IF( etot_ndcy(ji,jj,jk) * tmask(ji,jj,jk) >=  zqsr100(ji,jj) )  THEN
            neln(ji,jj) = jk+1                    ! Euphotic level : 1rst T-level strictly below Euphotic layer
@@ -178,5 +174,5 @@
       zetmp2 (:,:)   = 0.e0
 
-      DO_3D( 1, 1, 1, 1, 1, nksrp )
+      DO_3D( 1, 1, 1, 1, 1, nksr )
          IF( gdepw(ji,jj,jk+1,Kmm) <= hmld(ji,jj) ) THEN
             zetmp1 (ji,jj) = zetmp1 (ji,jj) + etot     (ji,jj,jk) * e3t(ji,jj,jk,Kmm) ! remineralisation
@@ -189,5 +185,5 @@
       zpar(:,:,:) = etot_ndcy(:,:,:)  ! diagnostic : PAR with no diurnal cycle 
       !
-      DO_3D( 1, 1, 1, 1, 1, nksrp )
+      DO_3D( 1, 1, 1, 1, 1, nksr )
          IF( gdepw(ji,jj,jk+1,Kmm) <= hmld(ji,jj) ) THEN
             z1_dep = 1. / ( zdepmoy(ji,jj) + rtrn )
@@ -201,5 +197,5 @@
       zetmp4 (:,:)   = 0.e0
       !
-      DO_3D( 1, 1, 1, 1, 1, nksrp )
+      DO_3D( 1, 1, 1, 1, 1, nksr )
          IF( gdepw(ji,jj,jk+1,Kmm) <= MIN(hmld(ji,jj), heup_01(ji,jj)) ) THEN
             zetmp3 (ji,jj) = zetmp3 (ji,jj) + enano    (ji,jj,jk) * e3t(ji,jj,jk,Kmm) ! production
@@ -211,5 +207,5 @@
       ediatm(:,:,:) = ediat(:,:,:)
       !
-      DO_3D( 1, 1, 1, 1, 1, nksrp )
+      DO_3D( 1, 1, 1, 1, 1, nksr )
          IF( gdepw(ji,jj,jk+1,Kmm) <= hmld(ji,jj) ) THEN
             z1_dep = 1. / ( zdepmoy(ji,jj) + rtrn )
@@ -221,5 +217,5 @@
       IF( ln_p5z ) THEN
          ALLOCATE( zetmp5(jpi,jpj) )  ;   zetmp5 (:,:) = 0.e0
-         DO_3D( 1, 1, 1, 1, 1, nksrp )
+         DO_3D( 1, 1, 1, 1, 1, nksr )
             IF( gdepw(ji,jj,jk+1,Kmm) <= MIN(hmld(ji,jj), heup_01(ji,jj)) ) THEN
                zetmp5(ji,jj)  = zetmp5 (ji,jj) + epico(ji,jj,jk) * e3t(ji,jj,jk,Kmm) ! production
@@ -229,5 +225,5 @@
          epicom(:,:,:) = epico(:,:,:)
          !
-         DO_3D( 1, 1, 1, 1, 1, nksrp )
+         DO_3D( 1, 1, 1, 1, 1, nksr )
             IF( gdepw(ji,jj,jk+1,Kmm) <= hmld(ji,jj) ) THEN
                z1_dep = 1. / ( zdepmoy(ji,jj) + rtrn )
@@ -283,5 +279,5 @@
          pe3(:,:,1) = zqsr(:,:)
          !
-         DO jk = 2, nksrp + 1
+         DO jk = 2, nksr + 1
             DO jj = 1, jpj
                DO ji = 1, jpi
@@ -302,5 +298,5 @@
         pe3(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekr(:,:,1) )
         !
-        DO_3D( 1, 1, 1, 1, 2, nksrp )
+        DO_3D( 1, 1, 1, 1, 2, nksr )
            pe1(ji,jj,jk) = pe1(ji,jj,jk-1) * EXP( -0.5 * ( ekb(ji,jj,jk-1) + ekb(ji,jj,jk) ) )
            pe2(ji,jj,jk) = pe2(ji,jj,jk-1) * EXP( -0.5 * ( ekg(ji,jj,jk-1) + ekg(ji,jj,jk) ) )
@@ -400,9 +396,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_wp )     ! 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
