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.
dynbfr.F90 in branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90 @ 2690

Last change on this file since 2690 was 2690, checked in by gm, 13 years ago

dynamic mem: #785 ; homogeneization of the coding style associated with dyn allocation

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1MODULE dynbfr
2   !!==============================================================================
3   !!                 ***  MODULE  dynbfr  ***
4   !! Ocean dynamics :  bottom friction component of the momentum mixing trend
5   !!==============================================================================
6   !! History :  3.2  ! 2008-11  (A. C. Coward)  Original code
7   !!----------------------------------------------------------------------
8
9   !!----------------------------------------------------------------------
10   !!   dyn_bfr      : Update the momentum trend with the bottom friction contribution
11   !!----------------------------------------------------------------------
12   USE oce             ! ocean dynamics and tracers variables
13   USE dom_oce         ! ocean space and time domain variables
14   USE zdf_oce         ! ocean vertical physics variables
15   USE trdmod          ! ocean active dynamics and tracers trends
16   USE trdmod_oce      ! ocean variables trends
17   USE in_out_manager  ! I/O manager
18   USE prtctl          ! Print control
19
20   IMPLICIT NONE
21   PRIVATE
22
23   PUBLIC   dyn_bfr    !  routine called by step.F90
24
25   !! * Substitutions
26#  include "domzgr_substitute.h90"
27#  include "zdfddm_substitute.h90"
28#  include "vectopt_loop_substitute.h90"
29   !!----------------------------------------------------------------------
30   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
31   !! $Id$
32   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
33   !!----------------------------------------------------------------------
34CONTAINS
35   
36   SUBROUTINE dyn_bfr( kt )
37      !!----------------------------------------------------------------------
38      !!                  ***  ROUTINE dyn_bfr  ***
39      !!
40      !! ** Purpose :   compute the bottom friction ocean dynamics physics.
41      !!
42      !! ** Action  :   (ua,va)   momentum trend increased by bottom friction trend
43      !!---------------------------------------------------------------------
44      USE oce, ONLY:   ztrduv => tsa   ! tsa used as 4D workspace
45      !!
46      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
47      !!
48      INTEGER  ::   ji, jj       ! dummy loop indexes
49      INTEGER  ::   ikbu, ikbv   ! local integers
50      REAL(wp) ::   zm1_2dt      ! local scalar
51      !!---------------------------------------------------------------------
52      !
53      zm1_2dt = - 1._wp / ( 2._wp * rdt )
54
55      IF( l_trddyn )   THEN                      ! temporary save of ua and va trends
56         ztrduv(:,:,:,1) = ua(:,:,:)
57         ztrduv(:,:,:,2) = va(:,:,:)
58      ENDIF
59
60# if defined key_vectopt_loop
61      DO jj = 1, 1
62         DO ji = jpi+2, jpij-jpi-1   ! vector opt. (forced unrolling)
63# else
64      DO jj = 2, jpjm1
65         DO ji = 2, jpim1
66# endif
67            ikbu = mbku(ji,jj)          ! deepest ocean u- & v-levels
68            ikbv = mbkv(ji,jj)
69            !
70            ! Apply stability criteria on absolute value  : abs(bfr/e3) < 1/(2dt) => bfr/e3 > -1/(2dt)
71            ua(ji,jj,ikbu) = ua(ji,jj,ikbu) + MAX(  bfrua(ji,jj) / fse3u(ji,jj,ikbu) , zm1_2dt  ) * ub(ji,jj,ikbu)
72            va(ji,jj,ikbv) = va(ji,jj,ikbv) + MAX(  bfrva(ji,jj) / fse3v(ji,jj,ikbv) , zm1_2dt  ) * vb(ji,jj,ikbv)
73         END DO
74      END DO
75
76      !
77      IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
78         ztrduv(:,:,:,1) = ua(:,:,:) - ztrduv(:,:,:,1)
79         ztrduv(:,:,:,2) = va(:,:,:) - ztrduv(:,:,:,2)
80         CALL trd_mod( ztrduv(:,:,:,1), ztrduv(:,:,:,2), jpdyn_trd_bfr, 'DYN', kt )
81      ENDIF
82      !                                          ! print mean trends (used for debugging)
83      IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' bfr  - Ua: ', mask1=umask,               &
84         &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
85      !
86   END SUBROUTINE dyn_bfr
87
88   !!==============================================================================
89END MODULE dynbfr
Note: See TracBrowser for help on using the repository browser.