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 14415 – NEMO

Changeset 14415


Ignore:
Timestamp:
2021-02-06T14:04:27+01:00 (3 years ago)
Author:
lovato
Message:

trcopt revised computation of light at different location (ticket #2489)

Location:
NEMO/branches/2020/dev_r12985_TOP-04_IMMERSE_BGC_interface
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12985_TOP-04_IMMERSE_BGC_interface/cfgs/SHARED/namelist_top_ref

    r14362 r14415  
    108108   ln_varpar   =  .true.     ! Read PAR from file 
    109109   parlux      =  0.43       ! Fraction of shortwave as PAR 
    110    light_loc   = 'center'       ! Light location in the water cell ('top', 'center', 'integral') 
     110   light_loc   = 'center'    ! Light location in the water cell ('center', 'integral') 
    111111/ 
    112112!----------------------------------------------------------------------- 
  • NEMO/branches/2020/dev_r12985_TOP-04_IMMERSE_BGC_interface/src/TOP/trcopt.F90

    r14362 r14415  
    2424   LOGICAL  ::   ln_varpar   ! boolean for variable PAR fraction 
    2525   REAL(wp) ::   parlux      ! Fraction of shortwave as PAR 
    26    CHARACTER (len=25) :: light_loc 
     26   CHARACTER (len=25) :: light_loc ! Light location in the water cell ('center', 'integral') 
    2727 
    2828   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_par        ! structure of input par 
     
    133133      ENDDO 
    134134 
    135       ! weighted broadband diffuse attenuation coefficient 
    136       WHERE(etot .ne. 0.) & 
    137          xeps = ( ze1 * ekr + ze2 * ekb + ze3 * ekg ) / e3t(:,:,:,Kmm) / etot 
    138       ! Compute PAR at cell center (T-level) or integrate over cell depth 
    139       IF ( TRIM(light_loc) == 'center' ) THEN 
    140           IF(lwp) WRITE(numout,*) 'trcopt : center' 
    141           etot = etot * EXP( -xeps * 0.5 * e3t(:,:,:,Kmm)) 
    142       ELSE IF ( TRIM(light_loc) == 'integral' ) THEN 
    143           IF(lwp) WRITE(numout,*) 'trcopt : integral' 
    144           WHERE(etot == 0.) & 
    145           etot = etot / xeps * (1. - EXP(-xeps*e3t(:,:,:,Kmm))) 
    146       ENDIF 
    147  
    148       ! 
    149135      ! No Diurnal cycle PAR 
    150136      IF( l_trcdm2dc ) THEN 
     
    158144         etot_ndcy(:,:,:) = etot(:,:,:) 
    159145      ENDIF 
     146 
     147      !     Weighted broadband attenuation coefficient 
     148      !     ------------------------------------------ 
     149      xeps = (ze1(:,:,:) * ekb(:,:,:) + ze2(:,:,:) * ekg(:,:,:) + ze3(:,:,:) * ekr(:,:,:)) / e3t(:,:,:,Kmm) / (etot(:,:,:) + rtrn) 
    160150 
    161151      !     Light at the euphotic depth 
     
    202192      !! 
    203193      !! ** purpose :   compute PAR of each wavelength (Red-Green-Blue) 
    204       !!                for a given shortwave radiation at w-level 
     194      !!                from given surface shortwave radiation 
    205195      !! 
    206196      !!---------------------------------------------------------------------- 
     
    209199      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(out)     ::   pe1 , pe2 , pe3   ! PAR (R-G-B) 
    210200      ! 
    211       INTEGER    ::   ji, jj, jk                   ! dummy loop indices 
     201      INTEGER                       ::   ji, jj, jk        ! dummy loop indices 
     202      REAL(wp), DIMENSION(jpi,jpj)  ::   we1, we2, we3     ! PAR (R-G-B) at w-level 
    212203      !!---------------------------------------------------------------------- 
    213204      pe1(:,:,:) = 0. ; pe2(:,:,:) = 0. ; pe3(:,:,:) = 0. 
    214205      ! 
    215       pe1(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekb(:,:,1) ) 
    216       pe2(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekg(:,:,1) ) 
    217       pe3(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekr(:,:,1) ) 
    218       ! 
    219       DO_3D( 1, 1, 1, 1, 2, nksrp ) 
    220          pe1(ji,jj,jk) = pe1(ji,jj,jk-1) * EXP( -0.5 * ( ekb(ji,jj,jk-1) + ekb(ji,jj,jk) ) ) 
    221          pe2(ji,jj,jk) = pe2(ji,jj,jk-1) * EXP( -0.5 * ( ekg(ji,jj,jk-1) + ekg(ji,jj,jk) ) ) 
    222          pe3(ji,jj,jk) = pe3(ji,jj,jk-1) * EXP( -0.5 * ( ekr(ji,jj,jk-1) + ekr(ji,jj,jk) ) ) 
    223       END_3D 
     206      IF ( TRIM(light_loc) == 'center' ) THEN 
     207         ! cell-center (t-pivot) 
     208         pe1(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekb(:,:,1) ) 
     209         pe2(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekg(:,:,1) ) 
     210         pe3(:,:,1) = zqsr(:,:) * EXP( -0.5 * ekr(:,:,1) ) 
     211         ! 
     212         DO_3D( 1, 1, 1, 1, 2, nksrp ) 
     213            pe1(ji,jj,jk) = pe1(ji,jj,jk-1) * EXP( -0.5 * ( ekb(ji,jj,jk-1) + ekb(ji,jj,jk) ) ) 
     214            pe2(ji,jj,jk) = pe2(ji,jj,jk-1) * EXP( -0.5 * ( ekg(ji,jj,jk-1) + ekg(ji,jj,jk) ) ) 
     215            pe3(ji,jj,jk) = pe3(ji,jj,jk-1) * EXP( -0.5 * ( ekr(ji,jj,jk-1) + ekr(ji,jj,jk) ) ) 
     216         END_3D 
     217         ! 
     218      ELSE IF ( TRIM(light_loc) == 'integral' ) THEN 
     219         ! integrate over cell thickness 
     220         we1(:,:) = zqsr(:,:) 
     221         we2(:,:) = zqsr(:,:) 
     222         we3(:,:) = zqsr(:,:) 
     223         ! 
     224         DO_3D( 1, 1, 1, 1, 1, nksrp ) 
     225            ! integrate PAR over current t-level 
     226            pe1(ji,jj,jk) = we1(ji,jj) / (ekb(ji,jj,jk) + rtrn) * (1. - EXP( -ekb(ji,jj,jk) )) 
     227            pe2(ji,jj,jk) = we2(ji,jj) / (ekg(ji,jj,jk) + rtrn) * (1. - EXP( -ekg(ji,jj,jk) )) 
     228            pe3(ji,jj,jk) = we3(ji,jj) / (ekr(ji,jj,jk) + rtrn) * (1. - EXP( -ekr(ji,jj,jk) )) 
     229            ! PAR at next w-level 
     230            we1(ji,jj) = we1(ji,jj) * EXP( -ekb(ji,jj,jk) ) 
     231            we2(ji,jj) = we2(ji,jj) * EXP( -ekg(ji,jj,jk) ) 
     232            we3(ji,jj) = we3(ji,jj) * EXP( -ekr(ji,jj,jk) ) 
     233         END_3D 
     234         ! 
     235      ENDIF  
    224236      ! 
    225237      !  
Note: See TracChangeset for help on using the changeset viewer.