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 8894 for branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90 – NEMO

Ignore:
Timestamp:
2017-12-04T18:06:36+01:00 (7 years ago)
Author:
cbricaud
Message:

crs improvments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OPA_SRC/trc_oce.F90

    r5602 r8894  
    1414   USE dom_oce         ! ocean space and time domain 
    1515   USE lib_mpp         ! MPP library 
    16  
     16#if defined key_crs 
     17   USE crs, ONLY: tmask_crs, gdepw_n_crs 
     18#endif 
    1719   IMPLICIT NONE 
    1820   PRIVATE 
     
    2123   PUBLIC   trc_oce_rgb_read   ! routine called by traqsr.F90 
    2224   PUBLIC   trc_oce_ext_lev    ! function called by traqsr.F90 at least 
    23    PUBLIC   trc_oce_alloc      ! function called by nemogcm.F90 
     25   PUBLIC   trc_oce_alloc 
     26#if defined key_crs 
     27   PUBLIC   trc_oce_ext_lev_crs    ! function called by traqsr.F90 at least 
     28#endif 
    2429 
    2530   INTEGER , PUBLIC                                      ::   nn_dttrc      !: frequency of step on passive tracers 
     
    285290   END FUNCTION trc_oce_ext_lev 
    286291 
     292 
     293#if defined key_crs 
     294   FUNCTION trc_oce_ext_lev_crs( prldex, pqsr_frc ) RESULT( pjl ) 
     295      !!---------------------------------------------------------------------- 
     296      !!                 ***  ROUTINE trc_oce_ext_lev  *** 
     297      !!        
     298      !! ** Purpose :   compute max. level for light penetration 
     299      !!           
     300      !! ** Method  :   the function provides the level at which irradiance  
     301      !!                becomes negligible (i.e. = 1.e-15 W/m2) for 3 or 2 bands light 
     302      !!                penetration: I(z) = pqsr_frc * EXP(hext/prldex) = 1.e-15 W/m2 
     303      !!                # prldex is the longest depth of extinction: 
     304      !!                   - prldex = 23 m (2 bands case) 
     305      !!                   - prldex = 62 m (3 bands case: blue waveband & 0.01 mg/m2 for the chlorophyll) 
     306      !!                # pqsr_frc is the fraction of solar radiation which penetrates, 
     307      !!                considering Qsr=240 W/m2 and rn_abs = 0.58: 
     308      !!                   - pqsr_frc = Qsr * (1-rn_abs)   = 1.00e2 W/m2 (2 bands case) 
     309      !!                   - pqsr_frc = Qsr * (1-rn_abs)/3 = 0.33e2 W/m2 (3 bands case & equi-partition) 
     310      !! 
     311      !!---------------------------------------------------------------------- 
     312      REAL(wp), INTENT(in) ::   prldex    ! longest depth of extinction 
     313      REAL(wp), INTENT(in) ::   pqsr_frc  ! frac. solar radiation which penetrates  
     314      !! 
     315      INTEGER  ::   jk, pjl            ! levels 
     316      REAL(wp) ::   zhext              ! deepest level till which light penetrates 
     317      REAL(wp) ::   zprec = 15._wp     ! precision to reach -LOG10(1.e-15) 
     318      REAL(wp) ::   zem                ! temporary scalar  
     319      !!---------------------------------------------------------------------- 
     320      ! 
     321      ! It is not necessary to compute anything below the following depth 
     322      zhext = prldex * ( LOG(10._wp) * zprec + LOG(pqsr_frc) ) 
     323      ! 
     324      ! Level of light extinction 
     325      pjl = jpkm1 
     326      DO jk = jpkm1, 1, -1 
     327         IF(SUM(tmask_crs(:,:,jk)) > 0 ) THEN 
     328            zem = MAXVAL( gdepw_n_crs(:,:,jk+1) * tmask_crs(:,:,jk) ) 
     329            IF( zem >= zhext )   pjl = jk                       ! last T-level reached by Qsr 
     330         ELSE 
     331            pjl = jk                                            ! or regional sea-bed depth  
     332         ENDIF 
     333      END DO 
     334      ! 
     335   END FUNCTION trc_oce_ext_lev_crs 
     336 
     337#endif  
    287338   !!====================================================================== 
    288339END MODULE trc_oce 
Note: See TracChangeset for help on using the changeset viewer.