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 2371 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90 – NEMO

Ignore:
Timestamp:
2010-11-10T16:38:27+01:00 (14 years ago)
Author:
acc
Message:

nemo_v3_3_beta. Improvement of the Griffies operator code (#680). Some aspects are still undergoing scientific assessment but the code structure is ready for release. Dynamical allocation of the large triad arrays has been introduced to reduce memory when the new operator is not in use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/LDF/ldfeiv.F90

    r2287 r2371  
    8787      ! 1. Compute lateral diffusive coefficient  
    8888      ! ---------------------------------------- 
    89  
    90       DO jk = 1, jpk 
     89      IF (ln_traldf_grif) THEN 
     90         DO jk = 1, jpk 
    9191#  if defined key_vectopt_loop   
    92 !CDIR NOVERRCHK  
    93          DO ji = 1, jpij   ! vector opt. 
    94             ! Take the max of N^2 and zero then take the vertical sum 
    95             ! of the square root of the resulting N^2 ( required to compute 
    96             ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
    97             zn2 = MAX( rn2b(ji,1,jk), 0.e0 ) 
    98             zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk) 
    99             ! Compute elements required for the inverse time scale of baroclinic 
    100             ! eddies using the isopycnal slopes calculated in ldfslp.F : 
    101             ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
    102             ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk) 
     92            !CDIR NOVERRCHK  
     93            DO ji = 1, jpij   ! vector opt. 
     94               ! Take the max of N^2 and zero then take the vertical sum 
     95               ! of the square root of the resulting N^2 ( required to compute 
     96               ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
     97               zn2 = MAX( rn2b(ji,1,jk), 0.e0 ) 
     98               zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk) 
     99               ! Compute elements required for the inverse time scale of baroclinic 
     100               ! eddies using the isopycnal slopes calculated in ldfslp.F : 
     101               ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
     102               ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk) 
     103               zah(ji,1) = zah(ji,1) + zn2 * wslp2(ji,1,jk) * ze3w 
     104               zhw(ji,1) = zhw(ji,1) + ze3w 
     105            END DO 
     106#  else 
     107            DO jj = 2, jpjm1 
     108               !CDIR NOVERRCHK  
     109               DO ji = 2, jpim1 
     110                  ! Take the max of N^2 and zero then take the vertical sum  
     111                  ! of the square root of the resulting N^2 ( required to compute  
     112                  ! internal Rossby radius Ro = .5 * sum_jpk(N) / f  
     113                  zn2 = MAX( rn2b(ji,jj,jk), 0.e0 ) 
     114                  zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk) 
     115                  ! Compute elements required for the inverse time scale of baroclinic 
     116                  ! eddies using the isopycnal slopes calculated in ldfslp.F :  
     117                  ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
     118                  ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk) 
     119                  zah(ji,jj) = zah(ji,jj) + zn2 * wslp2(ji,jj,jk) * ze3w 
     120                  zhw(ji,jj) = zhw(ji,jj) + ze3w 
     121               END DO 
     122            END DO 
     123#  endif 
     124         END DO 
     125      ELSE 
     126         DO jk = 1, jpk 
     127#  if defined key_vectopt_loop   
     128            !CDIR NOVERRCHK  
     129            DO ji = 1, jpij   ! vector opt. 
     130               ! Take the max of N^2 and zero then take the vertical sum 
     131               ! of the square root of the resulting N^2 ( required to compute 
     132               ! internal Rossby radius Ro = .5 * sum_jpk(N) / f 
     133               zn2 = MAX( rn2b(ji,1,jk), 0.e0 ) 
     134               zn(ji,1) = zn(ji,1) + SQRT( zn2 ) * fse3w(ji,1,jk) 
     135               ! Compute elements required for the inverse time scale of baroclinic 
     136               ! eddies using the isopycnal slopes calculated in ldfslp.F : 
     137               ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
     138               ze3w = fse3w(ji,1,jk) * tmask(ji,1,jk) 
    103139               zah(ji,1) = zah(ji,1) + zn2   & 
    104                               * ( wslpi(ji,1,jk) * wslpi(ji,1,jk)    & 
    105                                 + wslpj(ji,1,jk) * wslpj(ji,1,jk) )   & 
    106                               * ze3w 
    107             zhw(ji,1) = zhw(ji,1) + ze3w 
    108          END DO 
     140                    * ( wslpi(ji,1,jk) * wslpi(ji,1,jk)    & 
     141                    + wslpj(ji,1,jk) * wslpj(ji,1,jk) )   & 
     142                    * ze3w 
     143               zhw(ji,1) = zhw(ji,1) + ze3w 
     144            END DO 
    109145#  else 
    110          DO jj = 2, jpjm1 
    111 !CDIR NOVERRCHK  
    112             DO ji = 2, jpim1 
    113                ! Take the max of N^2 and zero then take the vertical sum  
    114                ! of the square root of the resulting N^2 ( required to compute  
    115                ! internal Rossby radius Ro = .5 * sum_jpk(N) / f  
    116                zn2 = MAX( rn2b(ji,jj,jk), 0.e0 ) 
    117                zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk) 
    118                ! Compute elements required for the inverse time scale of baroclinic 
    119                ! eddies using the isopycnal slopes calculated in ldfslp.F :  
    120                ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
    121                ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk) 
    122                zah(ji,jj) = zah(ji,jj) + zn2   & 
    123                               * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk)    & 
    124                                 + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) )  & 
    125                               * ze3w 
    126                zhw(ji,jj) = zhw(ji,jj) + ze3w 
    127             END DO  
    128          END DO  
     146            DO jj = 2, jpjm1 
     147               !CDIR NOVERRCHK  
     148               DO ji = 2, jpim1 
     149                  ! Take the max of N^2 and zero then take the vertical sum  
     150                  ! of the square root of the resulting N^2 ( required to compute  
     151                  ! internal Rossby radius Ro = .5 * sum_jpk(N) / f  
     152                  zn2 = MAX( rn2b(ji,jj,jk), 0.e0 ) 
     153                  zn(ji,jj) = zn(ji,jj) + SQRT( zn2 ) * fse3w(ji,jj,jk) 
     154                  ! Compute elements required for the inverse time scale of baroclinic 
     155                  ! eddies using the isopycnal slopes calculated in ldfslp.F :  
     156                  ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
     157                  ze3w = fse3w(ji,jj,jk) * tmask(ji,jj,jk) 
     158                  zah(ji,jj) = zah(ji,jj) + zn2   & 
     159                       * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk)    & 
     160                       + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) )  & 
     161                       * ze3w 
     162                  zhw(ji,jj) = zhw(ji,jj) + ze3w 
     163               END DO 
     164            END DO 
    129165#  endif 
    130       END DO  
     166         END DO 
     167      END IF 
    131168 
    132169      DO jj = 2, jpjm1 
Note: See TracChangeset for help on using the changeset viewer.