Index: branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 13355)
+++ branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 13725)
@@ -34,4 +34,13 @@
    USE timing         ! Timing
    USE stopack
+#if defined key_medusa
+   USE trc, ONLY: trn      ! MEDUSA variables
+   USE par_medusa, ONLY: & ! MEDUSA parameters
+      & jpchn, &
+      & jpchd
+#elif defined key_hadocc
+   USE trc, ONLY: &        ! HadOCC chlorophyll
+      & HADOCC_CHL
+#endif
 
    IMPLICIT NONE
@@ -200,5 +209,5 @@
             !                                             ! ------------------------- !
             ! Set chlorophyl concentration
-            IF( nn_chldta == 1 .OR. nn_chldta == 2 .OR. lk_vvl ) THEN    !*  Variable Chlorophyll or ocean volume
+            IF( nn_chldta == 1 .OR. nn_chldta == 2 .OR. nn_chldta == 3 .OR. lk_vvl ) THEN    !*  Variable Chlorophyll or ocean volume
                !
                IF( nn_chldta == 1 ) THEN        !*  2D Variable Chlorophyll
@@ -236,4 +245,15 @@
                    END DO
                      !
+               ELSE IF( nn_chldta == 3 ) THEN
+                  !
+#if defined key_medusa
+                  zchl3d(:,:,:) = trn(:,:,:,jpchn) + trn(:,:,:,jpchd)
+#elif defined key_hadocc
+                  zchl3d(:,:,:) = HADOCC_CHL(:,:,:)
+#else
+                  CALL ctl_stop( 'tra_qsr: Trying to take chlorophyll from MEDUSA or HadOCC', &
+                     &           'but neither MEDUSA nor HadOCC defined' )
+#endif
+                  !
                ELSE                              !* Variable ocean volume but constant chrlorophyll
                   DO jk = 1, nksr + 1
@@ -465,5 +485,5 @@
          WRITE(numout,*) '      bio-model            light penetration   ln_qsr_bio = ', ln_qsr_bio
          WRITE(numout,*) '      light penetration for ice-model LIM3     ln_qsr_ice = ', ln_qsr_ice
-         WRITE(numout,*) '      RGB : Chl data (=1/2) or cst value (=0)  nn_chldta  = ', nn_chldta
+         WRITE(numout,*) '      RGB: model (3) file (2/1) or cst (0) chl  nn_chldta = ', nn_chldta
          WRITE(numout,*) '      RGB & 2 bands: fraction of light (rn_si1)    rn_abs = ', rn_abs
          WRITE(numout,*) '      RGB & 2 bands: shortess depth of extinction  rn_si0 = ', rn_si0
@@ -490,6 +510,7 @@
          IF( ln_qsr_rgb .AND. nn_chldta == 1 )   nqsr =  2
          IF( ln_qsr_rgb .AND. nn_chldta == 2 )   nqsr =  3
-         IF( ln_qsr_2bd                      )   nqsr =  4
-         IF( ln_qsr_bio                      )   nqsr =  5
+         IF( ln_qsr_rgb .AND. nn_chldta == 3 )   nqsr =  4
+         IF( ln_qsr_2bd                      )   nqsr =  5
+         IF( ln_qsr_bio                      )   nqsr =  6
          !
          IF(lwp) THEN                   ! Print the choice
@@ -498,7 +519,15 @@
             IF( nqsr ==  2 )   WRITE(numout,*) '         R-G-B   light penetration - 2D Chl data '
             IF( nqsr ==  3 )   WRITE(numout,*) '         R-G-B   light penetration - 3D Chl data '
-            IF( nqsr ==  4 )   WRITE(numout,*) '         2 bands light penetration'
-            IF( nqsr ==  5 )   WRITE(numout,*) '         bio-model light penetration'
-         ENDIF
+            IF( nqsr ==  4 )   WRITE(numout,*) '         R-G-B   light penetration - 3D Chl from BGC model '
+            IF( nqsr ==  5 )   WRITE(numout,*) '         2 bands light penetration'
+            IF( nqsr ==  6 )   WRITE(numout,*) '         bio-model light penetration'
+         ENDIF
+#if ! (defined key_medusa || defined key_hadocc)
+         !
+         IF( nqsr ==  4 ) THEN
+            CALL ctl_stop( 'nn_chldta=3 so trying to use BGC model chlorophyll for light penetration', &
+               &           'but not running with MEDUSA or HadOCC' )
+         ENDIF
+#endif
          !
       ENDIF
@@ -536,4 +565,7 @@
                   &                                         'Solar penetration function of read chlorophyll', 'namtra_qsr' )
                !
+            ELSEIF( nn_chldta == 3 ) THEN       !* Chl data will be got from model at each time step
+               IF(lwp) WRITE(numout,*)
+               IF(lwp) WRITE(numout,*) '        Chlorophyll will be taken from model at each time step'
             ELSE                                !* constant Chl : compute once for all the distribution of light (etot3)
                IF(lwp) WRITE(numout,*)
