New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 1423 for trunk/NEMO/OPA_SRC/trc_oce.F90 – NEMO

Ignore:
Timestamp:
2009-05-06T18:22:01+02:00 (15 years ago)
Author:
ctlod
Message:

add light penetration following 3 wavebands model (RGB) and the use of ocean color (chlorophyll), see ticket: #428

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/trc_oce.F90

    r1152 r1423  
    44   !! Ocean passive tracer  :  share SMS/Ocean variables 
    55   !!====================================================================== 
    6    !! History : 
    7    !!   9.0  !  04-03  (C. Ethe)  F90: Free form and module 
    8    !!---------------------------------------------------------------------- 
     6   !! History :  1.0  !  2004-03  (C. Ethe)  Original code 
     7   !!---------------------------------------------------------------------- 
     8 
     9   !!---------------------------------------------------------------------- 
     10   !!   trc_oce_rgb : tabulated attenuation coefficients for RGB light penetration          
     11   !!---------------------------------------------------------------------- 
     12   USE in_out_manager  ! I/O manager 
     13   USE dom_oce         ! ocean space and time domain 
     14 
    915#if defined key_top && defined key_pisces 
    1016   !!---------------------------------------------------------------------- 
    11    !!  OPA 9.0 , LOCEAN-IPSL (2005)  
    12    !! $Id$  
    13    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
    14    !!---------------------------------------------------------------------- 
    15    USE sms_pisces , ONLY :  & 
    16       etot3    =>   etot3   !!:  Biological fluxes for light 
    17    !! Shared module variables 
    18    LOGICAL, PUBLIC, PARAMETER ::   lk_qsr_sms = .TRUE.  
     17   !!   'key_top'   &   'key_pisces'                       PISCES bio-model           
     18   !!---------------------------------------------------------------------- 
     19   USE sms_pisces , ONLY :   etot3    =>   etot3   !:  bio-model light absorption 
     20 
     21   IMPLICIT NONE 
     22   PRIVATE 
     23 
     24   PUBLIC   trc_oce_rgb   ! routine called by p4zopt.F90 
     25    
     26   LOGICAL, PUBLIC, PARAMETER ::   lk_qsr_bio = .TRUE.   !: bio-model light absorption flag 
     27    
    1928#else 
    2029   !!---------------------------------------------------------------------- 
    21    !! Default option                         No Biological fluxes for light           
     30   !! Default option                          No bio-model light absorption       
    2231   !!---------------------------------------------------------------------- 
    2332   USE par_oce 
    24    LOGICAL, PUBLIC, PARAMETER ::   lk_qsr_sms = .FALSE.  
    25    REAL(wp), PUBLIC , DIMENSION (jpi,jpj,jpk) :: & 
    26       etot3 
     33 
     34   IMPLICIT NONE 
     35   PRIVATE 
     36 
     37   PUBLIC   trc_oce_rgb   ! routine called by traqsr.F90 
     38    
     39   LOGICAL, PUBLIC, PARAMETER ::   lk_qsr_bio = .FALSE.   !: bio-model light absorption flag 
     40    
     41   REAL(wp), PUBLIC , DIMENSION(jpi,jpj,jpk) ::   etot3   !: light absortion coefficient 
    2742#endif 
    2843 
     44   PUBLIC   trc_oce_ext_lev    ! function called by traqsr.F90 at least 
     45 
     46   INTEGER, PUBLIC ::   nksr   ! levels below which the light cannot penetrate ( depth larger than 391 m) 
     47 
     48   REAL(wp), DIMENSION(3,61), PUBLIC ::   rkrgb   !: tabulated attenuation coefficients for RGB absorption 
     49 
     50   !! * Substitutions 
     51#  include "domzgr_substitute.h90" 
     52   !!---------------------------------------------------------------------- 
     53   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     54   !! $Id:$  
     55   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
     56   !!---------------------------------------------------------------------- 
     57 
     58CONTAINS 
     59 
     60   SUBROUTINE trc_oce_rgb( prgb ) 
     61      !!--------------------------------------------------------------------- 
     62      !!                  ***  ROUTINE p4z_opt_init  *** 
     63      !! 
     64      !! ** Purpose :   Initialization of of the optical scheme 
     65      !! 
     66      !! ** Method  :   Set a look up table for the optical coefficients 
     67      !!                i.e. the attenuation coefficient for R-G-B light  
     68      !!                tabulated in Chlorophyll class (from JM Andre) 
     69      !! 
     70      !! ** Action  :   prgb(3,61) tabulated R-G-B attenuation coef.  
     71      !! 
     72      !! Reference  : Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516. 
     73      !!---------------------------------------------------------------------- 
     74      REAL(wp), DIMENSION(3,61), INTENT(inout) ::   prgb   ! tabulated attenuation coefficient 
     75      !! 
     76      INTEGER  ::   jc     ! dummy loop indice 
     77      INTEGER  ::   irgb   ! temporary integer 
     78      REAL(wp) ::   zchl   ! temporary scalar 
     79      REAL(wp), DIMENSION(4,61) ::   zrgb   ! tabulated attenuation coefficient (formerly read in 'kRGB61.txt') 
     80      !!---------------------------------------------------------------------- 
     81      ! 
     82      IF(lwp) THEN 
     83         WRITE(numout,*) 
     84         WRITE(numout,*) 'trc_oce_rgb : Initialisation of the optical look-up table' 
     85         WRITE(numout,*) '~~~~~~~~~~~ ' 
     86      ENDIF 
     87      ! 
     88      !  Chlorophyll        !     Blue attenuation     !     Green attenuation    !     Red attenuation      ! 
     89      zrgb(1, 1) =  0.010   ;   zrgb(2, 1) = 0.01618   ;   zrgb(3, 1) = 0.07464   ;   zrgb(4, 1) = 0.37807 
     90      zrgb(1, 2) =  0.011   ;   zrgb(2, 2) = 0.01654   ;   zrgb(3, 2) = 0.07480   ;   zrgb(4, 2) = 0.37823 
     91      zrgb(1, 3) =  0.013   ;   zrgb(2, 3) = 0.01693   ;   zrgb(3, 3) = 0.07499   ;   zrgb(4, 3) = 0.37840 
     92      zrgb(1, 4) =  0.014   ;   zrgb(2, 4) = 0.01736   ;   zrgb(3, 4) = 0.07518   ;   zrgb(4, 4) = 0.37859 
     93      zrgb(1, 5) =  0.016   ;   zrgb(2, 5) = 0.01782   ;   zrgb(3, 5) = 0.07539   ;   zrgb(4, 5) = 0.37879 
     94      zrgb(1, 6) =  0.018   ;   zrgb(2, 6) = 0.01831   ;   zrgb(3, 6) = 0.07562   ;   zrgb(4, 6) = 0.37900 
     95      zrgb(1, 7) =  0.020   ;   zrgb(2, 7) = 0.01885   ;   zrgb(3, 7) = 0.07586   ;   zrgb(4, 7) = 0.37923 
     96      zrgb(1, 8) =  0.022   ;   zrgb(2, 8) = 0.01943   ;   zrgb(3, 8) = 0.07613   ;   zrgb(4, 8) = 0.37948 
     97      zrgb(1, 9) =  0.025   ;   zrgb(2, 9) = 0.02005   ;   zrgb(3, 9) = 0.07641   ;   zrgb(4, 9) = 0.37976 
     98      zrgb(1,10) =  0.028   ;   zrgb(2,10) = 0.02073   ;   zrgb(3,10) = 0.07672   ;   zrgb(4,10) = 0.38005 
     99      zrgb(1,11) =  0.032   ;   zrgb(2,11) = 0.02146   ;   zrgb(3,11) = 0.07705   ;   zrgb(4,11) = 0.38036 
     100      zrgb(1,12) =  0.035   ;   zrgb(2,12) = 0.02224   ;   zrgb(3,12) = 0.07741   ;   zrgb(4,12) = 0.38070 
     101      zrgb(1,13) =  0.040   ;   zrgb(2,13) = 0.02310   ;   zrgb(3,13) = 0.07780   ;   zrgb(4,13) = 0.38107 
     102      zrgb(1,14) =  0.045   ;   zrgb(2,14) = 0.02402   ;   zrgb(3,14) = 0.07821   ;   zrgb(4,14) = 0.38146 
     103      zrgb(1,15) =  0.050   ;   zrgb(2,15) = 0.02501   ;   zrgb(3,15) = 0.07866   ;   zrgb(4,15) = 0.38189 
     104      zrgb(1,16) =  0.056   ;   zrgb(2,16) = 0.02608   ;   zrgb(3,16) = 0.07914   ;   zrgb(4,16) = 0.38235 
     105      zrgb(1,17) =  0.063   ;   zrgb(2,17) = 0.02724   ;   zrgb(3,17) = 0.07967   ;   zrgb(4,17) = 0.38285 
     106      zrgb(1,18) =  0.071   ;   zrgb(2,18) = 0.02849   ;   zrgb(3,18) = 0.08023   ;   zrgb(4,18) = 0.38338 
     107      zrgb(1,19) =  0.079   ;   zrgb(2,19) = 0.02984   ;   zrgb(3,19) = 0.08083   ;   zrgb(4,19) = 0.38396 
     108      zrgb(1,20) =  0.089   ;   zrgb(2,20) = 0.03131   ;   zrgb(3,20) = 0.08149   ;   zrgb(4,20) = 0.38458 
     109      zrgb(1,21) =  0.100   ;   zrgb(2,21) = 0.03288   ;   zrgb(3,21) = 0.08219   ;   zrgb(4,21) = 0.38526 
     110      zrgb(1,22) =  0.112   ;   zrgb(2,22) = 0.03459   ;   zrgb(3,22) = 0.08295   ;   zrgb(4,22) = 0.38598 
     111      zrgb(1,23) =  0.126   ;   zrgb(2,23) = 0.03643   ;   zrgb(3,23) = 0.08377   ;   zrgb(4,23) = 0.38676 
     112      zrgb(1,24) =  0.141   ;   zrgb(2,24) = 0.03842   ;   zrgb(3,24) = 0.08466   ;   zrgb(4,24) = 0.38761 
     113      zrgb(1,25) =  0.158   ;   zrgb(2,25) = 0.04057   ;   zrgb(3,25) = 0.08561   ;   zrgb(4,25) = 0.38852 
     114      zrgb(1,26) =  0.178   ;   zrgb(2,26) = 0.04289   ;   zrgb(3,26) = 0.08664   ;   zrgb(4,26) = 0.38950 
     115      zrgb(1,27) =  0.200   ;   zrgb(2,27) = 0.04540   ;   zrgb(3,27) = 0.08775   ;   zrgb(4,27) = 0.39056 
     116      zrgb(1,28) =  0.224   ;   zrgb(2,28) = 0.04811   ;   zrgb(3,28) = 0.08894   ;   zrgb(4,28) = 0.39171 
     117      zrgb(1,29) =  0.251   ;   zrgb(2,29) = 0.05103   ;   zrgb(3,29) = 0.09023   ;   zrgb(4,29) = 0.39294 
     118      zrgb(1,30) =  0.282   ;   zrgb(2,30) = 0.05420   ;   zrgb(3,30) = 0.09162   ;   zrgb(4,30) = 0.39428 
     119      zrgb(1,31) =  0.316   ;   zrgb(2,31) = 0.05761   ;   zrgb(3,31) = 0.09312   ;   zrgb(4,31) = 0.39572 
     120      zrgb(1,32) =  0.355   ;   zrgb(2,32) = 0.06130   ;   zrgb(3,32) = 0.09474   ;   zrgb(4,32) = 0.39727 
     121      zrgb(1,33) =  0.398   ;   zrgb(2,33) = 0.06529   ;   zrgb(3,33) = 0.09649   ;   zrgb(4,33) = 0.39894 
     122      zrgb(1,34) =  0.447   ;   zrgb(2,34) = 0.06959   ;   zrgb(3,34) = 0.09837   ;   zrgb(4,34) = 0.40075 
     123      zrgb(1,35) =  0.501   ;   zrgb(2,35) = 0.07424   ;   zrgb(3,35) = 0.10040   ;   zrgb(4,35) = 0.40270 
     124      zrgb(1,36) =  0.562   ;   zrgb(2,36) = 0.07927   ;   zrgb(3,36) = 0.10259   ;   zrgb(4,36) = 0.40480 
     125      zrgb(1,37) =  0.631   ;   zrgb(2,37) = 0.08470   ;   zrgb(3,37) = 0.10495   ;   zrgb(4,37) = 0.40707 
     126      zrgb(1,38) =  0.708   ;   zrgb(2,38) = 0.09056   ;   zrgb(3,38) = 0.10749   ;   zrgb(4,38) = 0.40952 
     127      zrgb(1,39) =  0.794   ;   zrgb(2,39) = 0.09690   ;   zrgb(3,39) = 0.11024   ;   zrgb(4,39) = 0.41216 
     128      zrgb(1,40) =  0.891   ;   zrgb(2,40) = 0.10374   ;   zrgb(3,40) = 0.11320   ;   zrgb(4,40) = 0.41502 
     129      zrgb(1,41) =  1.000   ;   zrgb(2,41) = 0.11114   ;   zrgb(3,41) = 0.11639   ;   zrgb(4,41) = 0.41809 
     130      zrgb(1,42) =  1.122   ;   zrgb(2,42) = 0.11912   ;   zrgb(3,42) = 0.11984   ;   zrgb(4,42) = 0.42142 
     131      zrgb(1,43) =  1.259   ;   zrgb(2,43) = 0.12775   ;   zrgb(3,43) = 0.12356   ;   zrgb(4,43) = 0.42500 
     132      zrgb(1,44) =  1.413   ;   zrgb(2,44) = 0.13707   ;   zrgb(3,44) = 0.12757   ;   zrgb(4,44) = 0.42887 
     133      zrgb(1,45) =  1.585   ;   zrgb(2,45) = 0.14715   ;   zrgb(3,45) = 0.13189   ;   zrgb(4,45) = 0.43304 
     134      zrgb(1,46) =  1.778   ;   zrgb(2,46) = 0.15803   ;   zrgb(3,46) = 0.13655   ;   zrgb(4,46) = 0.43754 
     135      zrgb(1,47) =  1.995   ;   zrgb(2,47) = 0.16978   ;   zrgb(3,47) = 0.14158   ;   zrgb(4,47) = 0.44240 
     136      zrgb(1,48) =  2.239   ;   zrgb(2,48) = 0.18248   ;   zrgb(3,48) = 0.14701   ;   zrgb(4,48) = 0.44765 
     137      zrgb(1,49) =  2.512   ;   zrgb(2,49) = 0.19620   ;   zrgb(3,49) = 0.15286   ;   zrgb(4,49) = 0.45331 
     138      zrgb(1,50) =  2.818   ;   zrgb(2,50) = 0.21102   ;   zrgb(3,50) = 0.15918   ;   zrgb(4,50) = 0.45942 
     139      zrgb(1,51) =  3.162   ;   zrgb(2,51) = 0.22703   ;   zrgb(3,51) = 0.16599   ;   zrgb(4,51) = 0.46601 
     140      zrgb(1,52) =  3.548   ;   zrgb(2,52) = 0.24433   ;   zrgb(3,52) = 0.17334   ;   zrgb(4,52) = 0.47313 
     141      zrgb(1,53) =  3.981   ;   zrgb(2,53) = 0.26301   ;   zrgb(3,53) = 0.18126   ;   zrgb(4,54) = 0.48080 
     142      zrgb(1,54) =  4.467   ;   zrgb(2,54) = 0.28320   ;   zrgb(3,54) = 0.18981   ;   zrgb(4,55) = 0.48909 
     143      zrgb(1,55) =  5.012   ;   zrgb(2,55) = 0.30502   ;   zrgb(3,55) = 0.19903   ;   zrgb(4,56) = 0.49803 
     144      zrgb(1,56) =  5.623   ;   zrgb(2,56) = 0.32858   ;   zrgb(3,56) = 0.20898   ;   zrgb(4,57) = 0.50768 
     145      zrgb(1,57) =  6.310   ;   zrgb(2,57) = 0.35404   ;   zrgb(3,57) = 0.21971   ;   zrgb(4,58) = 0.51810 
     146      zrgb(1,58) =  7.079   ;   zrgb(2,58) = 0.38154   ;   zrgb(3,58) = 0.23129   ;   zrgb(4,59) = 0.52934 
     147      zrgb(1,59) =  7.943   ;   zrgb(2,59) = 0.41125   ;   zrgb(3,59) = 0.24378   ;   zrgb(4,50) = 0.54147 
     148      zrgb(1,60) =  8.912   ;   zrgb(2,60) = 0.44336   ;   zrgb(3,60) = 0.25725   ;   zrgb(4,60) = 0.55457 
     149      zrgb(1,61) = 10.000   ;   zrgb(2,61) = 0.47804   ;   zrgb(3,61) = 0.27178   ;   zrgb(4,61) = 0.56870 
     150      ! 
     151      prgb(:,:) = zrgb(2:4,:) 
     152      ! 
     153      DO jc = 1, 61                         ! check 
     154         zchl = zrgb(1,jc) 
     155         irgb = NINT( 41 + 20.* LOG10( zchl ) + 1.e-15 ) 
     156         IF(lwp) WRITE(numout,*) '    jc =', jc, '  Chl = ', zchl, '  irgb = ', irgb 
     157         IF( irgb /= jc ) THEN 
     158            IF(lwp) WRITE(numout,*) '    jc =', jc, '  Chl = ', zchl, '  Chl class = ', irgb 
     159            CALL ctl_stop( 'trc_oce_rgb : inconsistency in Chl tabulated attenuation coeff.' ) 
     160         ENDIF 
     161      END DO 
     162      ! 
     163   END SUBROUTINE trc_oce_rgb 
     164 
     165 
     166   SUBROUTINE trc_oce_rgb_read( prgb ) 
     167      !!---------------------------------------------------------------------- 
     168      !!                  ***  ROUTINE p4z_opt_init  *** 
     169      !! 
     170      !! ** Purpose :   Initialization of of the optical scheme 
     171      !! 
     172      !! ** Method  :   read the look up table for the optical coefficients 
     173      !! 
     174      !! ** input   :   xkrgb(61) precomputed array corresponding to the   
     175      !!                          attenuation coefficient (from JM Andre) 
     176      !!---------------------------------------------------------------------- 
     177      REAL(wp), DIMENSION(3,61), INTENT(inout) ::   prgb   ! tabulated attenuation coefficient 
     178      !! 
     179      INTEGER  ::   jchl, jband   ! dummy loop indices 
     180      INTEGER  ::   numlight 
     181      REAL(wp) ::   ztoto 
     182      CHARACTER(LEN=20) :: clname 
     183      !!---------------------------------------------------------------------- 
     184      ! 
     185      clname = 'kRGB61.txt'  
     186      CALL ctlopn( numlight, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', 1, numout, .TRUE., 1 ) 
     187      DO jchl = 1, 61 
     188         READ(numlight,*) ztoto, ( prgb(jband,jchl), jband=1,3 ) 
     189      END DO 
     190      CLOSE( numlight ) 
     191      ! 
     192      IF(lwp) THEN                         ! control print 
     193         WRITE(numout,*) 
     194         WRITE(numout,*) ' trc_oce_rgb_read : optical look-up table read in kRGB61.txt file' 
     195         WRITE(numout,*) ' ~~~~~~~~~~~~~~~~' 
     196      ENDIF 
     197      ! 
     198   END SUBROUTINE trc_oce_rgb_read 
     199 
     200 
     201   FUNCTION trc_oce_ext_lev( prldex, pqsr_frc ) RESULT( pjl ) 
     202      !!---------------------------------------------------------------------- 
     203      !!                 ***  ROUTINE trc_oce_ext_lev  *** 
     204      !!        
     205      !! ** Purpose :   compute max. level for light penetration 
     206      !!           
     207      !! ** Method  :   the function provides the level at which irradiance  
     208      !!                becomes negligible (i.e. = 1.e-15 W/m2) for 3 or 2 bands light 
     209      !!                penetration: I(z) = pqsr_frc * EXP(hext/prldex) = 1.e-15 W/m2 
     210      !!                # prldex is the longest depth of extinction: 
     211      !!                   - prldex = 23 m (2 bands case) 
     212      !!                   - prldex = 62 m (3 bands case: blue waveband & 0.01 mg/m2 for the chlorophyll) 
     213      !!                # pqsr_frc is the fraction of solar radiation which penetrates, 
     214      !!                considering Qsr=240 W/m2 and rn_abs = 0.58: 
     215      !!                   - pqsr_frc = Qsr * (1-rn_abs)   = 1.00e2 W/m2 (2 bands case) 
     216      !!                   - pqsr_frc = Qsr * (1-rn_abs)/3 = 0.33e2 W/m2 (3 bands case & equi-partition) 
     217      !! 
     218      !!---------------------------------------------------------------------- 
     219      REAL(wp), INTENT(in) ::   prldex    ! longest depth of extinction 
     220      REAL(wp), INTENT(in) ::   pqsr_frc  ! frac. solar radiation which penetrates  
     221      !! 
     222      INTEGER  ::   jk, pjl            ! levels 
     223      REAL(wp) ::   zhext              ! deepest level till which light penetrates 
     224      REAL(wp) ::   zprec = 15._wp     ! precision to reach -LOG10(1.e-15) 
     225      REAL(wp) ::   zem                ! temporary scalar  
     226      !!---------------------------------------------------------------------- 
     227      ! 
     228      ! It is not necessary to compute anything bellow the following depth 
     229      zhext = prldex * ( LOG(10.e0) * zprec + LOG(pqsr_frc) ) 
     230      
     231      ! Level of light extinction 
     232      pjl = jpkm1 
     233      DO jk = jpkm1, 1, -1 
     234         zem = MAXVAL( fsdepw(:,:,jk+1) * tmask(:,:,jk) ) 
     235         IF( zem >= zhext )   pjl = jk                       ! last T-level reached by Qsr 
     236      END DO 
     237      ! 
     238   END FUNCTION trc_oce_ext_lev 
     239 
     240 
     241   !!====================================================================== 
    29242END MODULE trc_oce 
Note: See TracChangeset for help on using the changeset viewer.