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 6004 for branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90 – NEMO

Ignore:
Timestamp:
2015-12-04T17:05:58+01:00 (8 years ago)
Author:
gm
Message:

#1613: vvl by default, step III: Merge with the trunk (free surface simplification) (see wiki)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_exp.F90

    r5845 r6004  
    88   !!   NEMO     0.5  !  2002-08  (G. Madec)  F90: Free form and module 
    99   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps 
     10   !!            3.7  !  2015-11  (J. Chanut) output velocities instead of trends 
    1011   !!---------------------------------------------------------------------- 
    1112 
    1213   !!---------------------------------------------------------------------- 
    13    !!   dyn_zdf_exp  : update the momentum trend with the vertical diffu- 
    14    !!                  sion using an explicit time-stepping scheme. 
     14   !!   dyn_zdf_exp   : update the momentum trend with the vertical diffusion using a split-explicit scheme 
     15   !!                   and perform the Leap-Frog time integration. 
    1516   !!---------------------------------------------------------------------- 
    16    USE oce             ! ocean dynamics and tracers 
    17    USE dom_oce         ! ocean space and time domain 
    18    USE phycst          ! physical constants 
    19    USE zdf_oce         ! ocean vertical physics 
    20    USE sbc_oce         ! surface boundary condition: ocean 
    21    USE lib_mpp         ! MPP library 
    22    USE in_out_manager  ! I/O manager 
    23    USE lib_mpp         ! MPP library 
    24    USE wrk_nemo        ! Memory Allocation 
    25    USE timing          ! Timing 
    26  
     17   USE oce            ! ocean dynamics and tracers 
     18   USE dom_oce        ! ocean space and time domain 
     19   USE phycst         ! physical constants 
     20   USE zdf_oce        ! ocean vertical physics 
     21   USE dynadv   , ONLY: ln_dynadv_vec ! Momentum advection form 
     22   USE sbc_oce        ! surface boundary condition: ocean 
     23   ! 
     24   USE in_out_manager ! I/O manager 
     25   USE lib_mpp        ! MPP library 
     26   USE wrk_nemo       ! Memory Allocation 
     27   USE timing         ! Timing 
    2728 
    2829   IMPLICIT NONE 
     
    3435#  include "vectopt_loop_substitute.h90" 
    3536   !!---------------------------------------------------------------------- 
    36    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     37   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
    3738   !! $Id$ 
    3839   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    4546      !!                    
    4647      !! ** Purpose :   Compute the trend due to the vert. momentum diffusion 
     48      !!              and perform the Leap-Frog time stepping. 
    4749      !! 
    48       !! ** Method  :   Explicit forward time stepping with a time splitting 
    49       !!      technique. The vertical diffusion of momentum is given by: 
     50      !! ** Method  : - Split-explicit forward time stepping. 
     51      !!      The vertical mixing of momentum is given by: 
    5052      !!         diffu = dz( avmu dz(u) ) = 1/e3u dk+1( avmu/e3uw dk(ub) ) 
    5153      !!      Surface boundary conditions: wind stress input (averaged over kt-1/2 & kt+1/2) 
     
    5355      !!      Add this trend to the general trend ua : 
    5456      !!         ua = ua + dz( avmu dz(u) ) 
     57      !!              - Leap-Frog time stepping (Asselin filter will be applied in dyn_nxt)  
     58      !!         ua =         ub + 2*dt *       ua             vector form or linear free surf. 
     59      !!         ua = ( e3u_b*ub + 2*dt * e3u_n*ua ) / e3u_a   otherwise 
    5560      !! 
    56       !! ** Action : - Update (ua,va) with the vertical diffusive trend 
     61      !! ** Action : - (ua,va) after velocity 
    5762      !!--------------------------------------------------------------------- 
    5863      INTEGER , INTENT(in) ::   kt     ! ocean time-step index 
    5964      REAL(wp), INTENT(in) ::   p2dt   ! time-step  
    6065      ! 
    61       INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices 
     66      INTEGER  ::   ji, jj, jk, jl     ! dummy loop indices 
    6267      REAL(wp) ::   zlavmr, zua, zva   ! local scalars 
    6368      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwx, zwy, zwz, zww 
    6469      !!---------------------------------------------------------------------- 
    6570      ! 
    66       IF( nn_timing == 1 )  CALL timing_start('dyn_zdf_exp') 
     71      IF( nn_timing == 1 )   CALL timing_start('dyn_zdf_exp') 
    6772      ! 
    68       CALL wrk_alloc( jpi,jpj,jpk, zwx, zwy, zwz, zww )  
     73      CALL wrk_alloc( jpi,jpj,jpk,   zwx, zwy, zwz, zww )  
    6974      ! 
    7075      IF( kt == nit000 .AND. lwp ) THEN 
     
    7378         WRITE(numout,*) '~~~~~~~~~~~ ' 
    7479      ENDIF 
    75  
     80      ! 
     81      !                 !==  vertical mixing trend  ==! 
     82      ! 
    7683      zlavmr = 1. / REAL( nn_zdfexp ) 
    77  
    78  
    79       DO jj = 2, jpjm1                 ! Surface boundary condition 
     84      ! 
     85      DO jj = 2, jpjm1           ! Surface boundary condition 
    8086         DO ji = 2, jpim1 
    8187            zwy(ji,jj,1) = ( utau_b(ji,jj) + utau(ji,jj) ) * r1_rau0 
     
    8389         END DO   
    8490      END DO   
    85       DO jk = 1, jpk                   ! Initialization of x, z and contingently trends array 
     91      DO jk = 1, jpk             ! Initialization of x, z and contingently trends array 
    8692         DO jj = 2, jpjm1  
    8793            DO ji = 2, jpim1 
     
    9298      END DO   
    9399      ! 
    94       DO jl = 1, nn_zdfexp             ! Time splitting loop 
     100      DO jl = 1, nn_zdfexp       ! Time splitting loop 
    95101         ! 
    96          DO jk = 2, jpk                      ! First vertical derivative 
     102         DO jk = 2, jpk                ! First vertical derivative 
    97103            DO jj = 2, jpjm1  
    98104               DO ji = 2, jpim1 
     
    102108            END DO   
    103109         END DO   
    104          DO jk = 1, jpkm1                    ! Second vertical derivative and trend estimation at kt+l*rdt/nn_zdfexp 
     110         DO jk = 1, jpkm1              ! Second vertical derivative and trend estimation at kt+l*rdt/nn_zdfexp 
    105111            DO jj = 2, jpjm1  
    106112               DO ji = 2, jpim1 
     
    115121            END DO   
    116122         END DO   
    117          ! 
    118       END DO                           ! End of time splitting 
     123      END DO                     ! End of time splitting 
    119124      ! 
    120       CALL wrk_dealloc( jpi,jpj,jpk, zwx, zwy, zwz, zww )  
    121125      ! 
    122       IF( nn_timing == 1 )  CALL timing_stop('dyn_zdf_exp') 
     126      !                 !==  Leap-Frog time integration  ==! 
     127      ! 
     128      IF( ln_dynadv_vec .OR. ln_linssh ) THEN   ! applied on velocity 
     129         DO jk = 1, jpkm1 
     130            ua(:,:,jk) = ( ub(:,:,jk) + p2dt * ua(:,:,jk) ) * umask(:,:,jk) 
     131            va(:,:,jk) = ( vb(:,:,jk) + p2dt * va(:,:,jk) ) * vmask(:,:,jk) 
     132         END DO 
     133      ELSE                                      ! applied on thickness weighted velocity 
     134         DO jk = 1, jpkm1 
     135            ua(:,:,jk) = (          e3u_b(:,:,jk) * ub(:,:,jk)    & 
     136               &           + p2dt * e3u_n(:,:,jk) * ua(:,:,jk)  ) / e3u_a(:,:,jk) * umask(:,:,jk) 
     137            va(:,:,jk) = (          e3v_b(:,:,jk) * vb(:,:,jk)    & 
     138               &           + p2dt * e3v_n(:,:,jk) * va(:,:,jk)  ) / e3v_a(:,:,jk) * vmask(:,:,jk) 
     139         END DO 
     140      ENDIF 
     141      ! 
     142      CALL wrk_dealloc( jpi,jpj,jpk,   zwx, zwy, zwz, zww )  
     143      ! 
     144      IF( nn_timing == 1 )   CALL timing_stop('dyn_zdf_exp') 
    123145      ! 
    124146   END SUBROUTINE dyn_zdf_exp 
Note: See TracChangeset for help on using the changeset viewer.