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 901 for trunk/NEMO/OPA_SRC/LDF/ldftra_c2d.h90 – NEMO

Ignore:
Timestamp:
2008-04-22T21:16:18+02:00 (16 years ago)
Author:
rblod
Message:

Change ldf computation to take into account the grid anisotropy, see ticket #115

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/LDF/ldftra_c2d.h90

    r719 r901  
    3131 
    3232      !! * Local variables 
    33 # if defined key_traldf_eiv && defined key_orca_r4 
    3433      INTEGER ::   ji, jj                  ! dummy loop indices 
    35 # endif 
    3634# if defined key_orca_r4 
    3735      INTEGER :: i1, i2, j1, j2 
    3836# endif 
    39       REAL(wp) ::   za00, zdx_max 
     37      REAL(wp) ::   za00, zd_max, zeumax, zevmax, zetmax 
    4038       
    4139      !!---------------------------------------------------------------------- 
     
    5351      ENDIF 
    5452 
    55       zdx_max = MAXVAL( e1t(:,:) ) 
    56       IF( lk_mpp )   CALL mpp_max( zdx_max )   ! max over the global domain 
     53      zd_max = MAX( MAXVAL( e1t(:,:) ), MAXVAL( e2t(:,:) ) ) 
     54      IF( lk_mpp ) CALL mpp_max( zd_max )   ! max over the global domain 
    5755 
    5856      ! harmonic operator : (U-, V-, W-points) 
     
    6058      IF( ln_traldf_lap ) THEN 
    6159   
    62          za00 = aht0 / zdx_max 
     60         za00 = aht0 / zd_max 
    6361   
    64 !RB         ahtu(:,:) = za00 * e1u(:,:)               ! set ahtu = ahtv at u- and v-points, 
    65 !RB         ahtv(:,:) = za00 * e1f(:,:)               ! and ahtw at w-point (idem T-point) 
    66 !RB         ahtw(:,:) = za00 * e1t(:,:)               !  
    67          ahtu(:,:) = aht0                ! set ahtu = ahtv at u- and v-points, 
    68          ahtv(:,:) = aht0                ! and ahtw at w-point (idem T-point) 
    69          ahtw(:,:) = aht0                ! 
    70  
    71  
     62         DO jj = 1, jpj  
     63            DO ji = 1, jpi  
     64               zeumax = MAX( e1u(ji,jj), e2u(ji,jj) )  
     65               zevmax = MAX( e1v(ji,jj), e2v(ji,jj) )  
     66               zetmax = MAX( e1t(ji,jj), e2t(ji,jj) ) 
     67               ahtu(ji,jj) = za00 * zeumax ! set ahtu = ahtv at u- and v-points,  
     68               ahtv(ji,jj) = za00 * zevmax ! and ahtw at w-point (idem T-point)  
     69               ahtw(ji,jj) = za00 * zetmax !  
     70            END DO 
     71         END DO 
    7272 
    7373         CALL lbc_lnk( ahtu, 'U', 1. )   ! Lateral boundary conditions 
    7474         CALL lbc_lnk( ahtv, 'V', 1. )   ! (no change of sign) 
    7575         CALL lbc_lnk( ahtw, 'W', 1. ) 
     76 
     77         ! Special case for ORCA R2 and R4 configurations (overwrite the value of ahtu ahtv ahtw) 
     78         ! ============================================== 
     79         IF( cp_cfg == "orca" .AND. ( jp_cfg == 2 .OR. jp_cfg == 4 ) )   THEN 
     80            ahtu(:,:) = aht0              ! set ahtu = ahtv at u- and v-points, 
     81            ahtv(:,:) = aht0              ! and ahtw at w-point 
     82            ahtw(:,:) = aht0              ! (here : no space variation) 
     83            IF(lwp) WRITE(numout,*) '               ORCA R2 or R4 case' 
     84            IF(lwp) WRITE(numout,*) '               Constant values used for eddy diffusivity coefficients' 
     85            IF(lwp) WRITE(numout,*) '               Variation lat/lon only for eddy induced velocity coefficients' 
     86         ENDIF 
    7687 
    7788         ! Control print 
     
    99110         !       in the to horizontal direction 
    100111 
    101          za00 = aht0 / ( zdx_max * zdx_max * zdx_max ) 
    102          ahtt(:,:) = za00 * e1t(:,:) * e1t(:,:) *e1t(:,:)      ! set ahtt at T-point  
     112         zd_max = MAX( MAXVAL( e1t(:,:) ), MAXVAL( e2t(:,:) ) ) 
     113         IF( lk_mpp )   CALL mpp_max( zd_max )   ! max over the global domain 
     114 
     115         za00 = aht0 / ( zd_max * zd_max * zd_max ) 
     116         DO jj = 1, jpj 
     117            DO ji = 1, jpi 
     118               zetmax = MAX( e1t(ji,jj), e2t(ji,jj) ) 
     119               ahtt(ji,jj) = za00 * zetmax * zetmax * zetmax      ! set ahtt at T-point 
     120            END DO 
     121         END DO 
    103122 
    104123         CALL lbc_lnk( ahtt, 'T', 1. )   ! Lateral boundary conditions on ( ahtt ) 
Note: See TracChangeset for help on using the changeset viewer.