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 2104 for branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf_bilap.F90 – NEMO

Ignore:
Timestamp:
2010-09-17T14:35:46+02:00 (14 years ago)
Author:
cetlod
Message:

update DEV_r2006_merge_TRA_TRC according to review

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traldf_bilap.F90

    r2082 r2104  
    44   !! Ocean  tracers:  horizontal component of the lateral tracer mixing trend 
    55   !!============================================================================== 
    6    !! History :     !  91-11  (G. Madec)  Original code 
    7    !!               93-03  (M. Guyon)  symetrical conditions 
    8    !!               95-11  (G. Madec)  suppress volumetric scale factors 
    9    !!               96-01  (G. Madec)  statement function for e3 
    10    !!               96-01  (M. Imbard)  mpp exchange 
    11    !!               97-07  (G. Madec)  optimization, and ahtt 
    12    !!          8.5  !  02-08  (G. Madec)  F90: Free form and module 
    13    !!          9.0  !  04-08  (C. Talandier) New trends organization 
    14    !!               !  05-11  (G. Madec)  zps or sco as default option 
    15    !!          3.3  !  10-05  (C. Ethe, G. Madec)  merge TRC-TRA  
     6   !! History :  OPA  !  1991-11  (G. Madec)  Original code 
     7   !!                 !  1993-03  (M. Guyon)  symetrical conditions 
     8   !!                 !  1995-11  (G. Madec)  suppress volumetric scale factors 
     9   !!                 !  1996-01  (G. Madec)  statement function for e3 
     10   !!                 !  1996-01  (M. Imbard)  mpp exchange 
     11   !!                 !  1997-07  (G. Madec)  optimization, and ahtt 
     12   !!            8.5  !  2002-08  (G. Madec)  F90: Free form and module 
     13   !!   NEMO     1.0  !  2004-08  (C. Talandier) New trends organization 
     14   !!             -   !  2005-11  (G. Madec)  zps or sco as default option 
     15   !!            3.3  !  2010-05  (C. Ethe, G. Madec)  merge TRC-TRA  
    1616   !!============================================================================== 
    1717 
     
    2020   !!                   using a iso-level biharmonic operator 
    2121   !!---------------------------------------------------------------------- 
    22    !! * Modules used 
    2322   USE oce             ! ocean dynamics and active tracers 
    2423   USE dom_oce         ! ocean space and time domain 
     
    3332   PRIVATE 
    3433 
    35    !! * Routine accessibility 
    36    PUBLIC tra_ldf_bilap   ! routine called by step.F90 
     34   PUBLIC   tra_ldf_bilap   ! routine called by step.F90 
    3735 
    3836   !! * Substitutions 
     
    4341   !!---------------------------------------------------------------------- 
    4442   !! NEMO/OPA 3.3 , LOCEAN-IPSL (2010)  
    45    !! $Id$  
    46    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     43   !! $Id$ 
     44   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4745   !!---------------------------------------------------------------------- 
    4846 
     
    8078      USE oce         , ztv => va   ! use va as workspace 
    8179      !! 
    82       INTEGER         , INTENT(in   )                                ::   kt             ! ocean time-step index 
    83       CHARACTER(len=3), INTENT(in   )                                ::   cdtype         ! =TRA or TRC (tracer indicator) 
    84       INTEGER         , INTENT(in   )                                ::   kjpt            ! number of tracers 
    85       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,kjpt  )     ::   pgu, pgv     ! tracer gradient at pstep levels 
    86       REAL(wp)        , INTENT(in   ), DIMENSION(jpi,jpj,jpk,kjpt)   ::   ptb          ! before and now tracer fields 
    87       REAL(wp)        , INTENT(inout), DIMENSION(jpi,jpj,jpk,kjpt)   ::   pta          ! tracer trend  
     80      INTEGER                              , INTENT(in   ) ::   kt         ! ocean time-step index 
     81      CHARACTER(len=3)                     , INTENT(in   ) ::   cdtype     ! =TRA or TRC (tracer indicator) 
     82      INTEGER                              , INTENT(in   ) ::   kjpt       ! number of tracers 
     83      REAL(wp), DIMENSION(jpi,jpj,    kjpt), INTENT(in   ) ::   pgu, pgv   ! tracer gradient at pstep levels 
     84      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb        ! before and now tracer fields 
     85      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta        ! tracer trend  
    8886      !! 
    89       INTEGER  ::  ji, jj, jk, jn         ! dummy loop indices 
    90       INTEGER  ::  iku, ikv               ! temporary integers 
    91       REAL(wp) ::  zbtr, ztra             ! temporary scalars 
    92       REAL(wp), DIMENSION(jpi,jpj) ::   &  
    93          zeeu, zeev, zlt               ! 2D workspace 
     87      INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices 
     88      INTEGER  ::  iku, ikv         ! local integers 
     89      REAL(wp) ::  zbtr, ztra       ! local scalars 
     90      REAL(wp), DIMENSION(jpi,jpj) ::   zeeu, zeev, zlt   ! 2D workspace 
    9491      !!---------------------------------------------------------------------- 
    9592 
    96       IF( ( cdtype == 'TRA' .AND. kt == nit000 ) .OR. ( cdtype == 'TRC' .AND. kt == nittrc000 ) )  THEN 
     93      IF( kt == nit000 )  THEN 
    9794         IF(lwp) WRITE(numout,*) 
    9895         IF(lwp) WRITE(numout,*) 'tra_ldf_bilap : iso-level biharmonic operator on ', cdtype 
     
    103100         !                                                       ! =========== 
    104101         !                                                
    105          DO jk = 1, jpkm1                                  
     102         DO jk = 1, jpkm1                                        ! Horizontal slab 
    106103            !                                              
    107              
    108             ! 0. Initialization of metric arrays (for z- or s-coordinates) 
    109             ! ---------------------------------- 
     104            !                          !==  Initialization of metric arrays (for z- or s-coordinates)  ==! 
    110105            DO jj = 1, jpjm1 
    111106               DO ji = 1, fs_jpim1   ! vector opt. 
     
    115110            END DO 
    116111 
    117  
    118             ! 1. Laplacian 
    119             ! ------------ 
    120              
    121             ! First derivative (gradient) 
    122             DO jj = 1, jpjm1 
     112            !                          !==  Laplacian  ==! 
     113            ! 
     114            DO jj = 1, jpjm1                 ! First derivative (gradient) 
    123115               DO ji = 1, fs_jpim1   ! vector opt. 
    124116                  ztu(ji,jj,jk) = zeeu(ji,jj) * ( ptb(ji+1,jj  ,jk,jn) - ptb(ji,jj,jk,jn) ) 
     
    126118               END DO 
    127119            END DO 
    128             IF( ln_zps ) THEN      ! set gradient at partial step level 
     120            IF( ln_zps ) THEN                ! set gradient at partial step level 
    129121               DO jj = 1, jpjm1 
    130122                  DO ji = 1, jpim1 
     
    137129               END DO 
    138130            ENDIF 
    139  
    140             ! Second derivative (divergence) multiply by the eddy diffusivity coefficient 
    141             DO jj = 2, jpjm1 
     131            DO jj = 2, jpjm1                 ! Second derivative (divergence) time the eddy diffusivity coefficient 
    142132               DO ji = fs_2, fs_jpim1   ! vector opt. 
    143133                  zbtr = 1.0 / ( e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) ) 
    144                   zlt(ji,jj) = fsahtt(ji,jj,jk) & 
    145                      &                * zbtr * (  ztu(ji,jj,jk) - ztu(ji-1,jj,jk) + ztv(ji,jj,jk) - ztv(ji,jj-1,jk)  ) 
     134                  zlt(ji,jj) = fsahtt(ji,jj,jk) * zbtr * (   ztu(ji,jj,jk) - ztu(ji-1,jj,jk)   & 
     135                     &                                     + ztv(ji,jj,jk) - ztv(ji,jj-1,jk)   ) 
    146136               END DO 
    147137            END DO 
     138            CALL lbc_lnk( zlt, 'T', 1. )     ! Lateral boundary conditions (unchanged sgn) 
    148139 
    149             ! Lateral boundary conditions on the laplacian (zlt)   (unchanged sgn) 
    150             CALL lbc_lnk( zlt, 'T', 1. ) 
    151  
    152             ! 2. Bilaplacian 
    153             ! -------------- 
    154              
    155             ! third derivative (gradient) 
    156             DO jj = 1, jpjm1 
     140            !                          !==  Bilaplacian  ==! 
     141            ! 
     142            DO jj = 1, jpjm1                 ! third derivative (gradient) 
    157143               DO ji = 1, fs_jpim1   ! vector opt. 
    158144                  ztu(ji,jj,jk) = zeeu(ji,jj) * ( zlt(ji+1,jj  ) - zlt(ji,jj) ) 
     
    160146               END DO 
    161147            END DO 
    162  
    163             ! fourth derivative (divergence) and add to the general tracer trend 
    164             DO jj = 2, jpjm1 
     148            DO jj = 2, jpjm1                 ! fourth derivative (divergence) and add to the general tracer trend 
    165149               DO ji = fs_2, fs_jpim1   ! vector opt. 
    166150                  ! horizontal diffusive trends 
     
    171155               END DO 
    172156            END DO 
    173             !                                             ! =============== 
     157            !                                              
    174158         END DO                                           ! Horizontal slab 
    175          !                                                ! =============== 
     159         !                                                 
    176160         ! "zonal" mean lateral diffusive heat and salt transport 
    177161         IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nf_ptr ) == 0 ) ) THEN   
     
    179163           IF( jn == jp_sal )  pst_ldf(:) = ptr_vj( ztv(:,:,:) ) 
    180164         ENDIF 
    181          ! 
    182       END DO 
    183  
     165         !                                                ! =========== 
     166      END DO                                              ! tracer loop 
     167      !                                                   ! =========== 
    184168   END SUBROUTINE tra_ldf_bilap 
    185169 
Note: See TracChangeset for help on using the changeset viewer.