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/2011/dev_r2802_NOCL_bfrimp/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/2011/dev_r2802_NOCL_bfrimp/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90 @ 2872

Last change on this file since 2872 was 2872, checked in by hliu, 13 years ago

1) added the semi-implicit bottom friction code (3 in DYN, 1 in ZDF), 2) added par_AMM7/12.h90, 3) added two arch files for NOCL mobius and ubuntu linux

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