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

source: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90 @ 3231

Last change on this file since 3231 was 3231, checked in by smasson, 12 years ago

dev_NEMO_MERGE_2011: supress TARGET attribute for tsa and use work arrays

  • Property svn:keywords set to Id
File size: 4.5 KB
RevLine 
[1671]1MODULE dynbfr
2   !!==============================================================================
3   !!                 ***  MODULE  dynbfr  ***
4   !! Ocean dynamics :  bottom friction component of the momentum mixing trend
5   !!==============================================================================
[2528]6   !! History :  3.2  ! 2008-11  (A. C. Coward)  Original code
[1671]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
[3116]15   USE zdfbfr          ! ocean bottom friction variables
[1671]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
[3161]20   USE timing          ! Timing
[3231]21   USE wrk_nemo        ! Memory Allocation
[1671]22
23   IMPLICIT NONE
24   PRIVATE
25
26   PUBLIC   dyn_bfr    !  routine called by step.F90
27
28   !! * Substitutions
29#  include "domzgr_substitute.h90"
30#  include "zdfddm_substitute.h90"
31#  include "vectopt_loop_substitute.h90"
32   !!----------------------------------------------------------------------
[2528]33   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
34   !! $Id$
35   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[1671]36   !!----------------------------------------------------------------------
37CONTAINS
38   
39   SUBROUTINE dyn_bfr( kt )
40      !!----------------------------------------------------------------------
41      !!                  ***  ROUTINE dyn_bfr  ***
42      !!
43      !! ** Purpose :   compute the bottom friction ocean dynamics physics.
44      !!
45      !! ** Action  :   (ua,va)   momentum trend increased by bottom friction trend
46      !!---------------------------------------------------------------------
47      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
48      !!
[2528]49      INTEGER  ::   ji, jj       ! dummy loop indexes
50      INTEGER  ::   ikbu, ikbv   ! local integers
51      REAL(wp) ::   zm1_2dt      ! local scalar
[3231]52      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
[1671]53      !!---------------------------------------------------------------------
54      !
[3161]55      IF( nn_timing == 1 )  CALL timing_start('dyn_bfr')
56      !
57      IF( .NOT.ln_bfrimp) THEN     ! only for explicit bottom friction form
[3116]58                                    ! implicit bfr is implemented in dynzdf_imp
59                                    ! H. Liu,  Sept. 2011
[1708]60
[3116]61        zm1_2dt = - 1._wp / ( 2._wp * rdt )
[1708]62
[3116]63        IF( l_trddyn )   THEN                      ! temporary save of ua and va trends
[3231]64           CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv )
65           ztrdu(:,:,:) = ua(:,:,:)
66           ztrdv(:,:,:) = va(:,:,:)
[3116]67        ENDIF
68
69
[1671]70# if defined key_vectopt_loop
[3116]71        DO jj = 1, 1
72           DO ji = jpi+2, jpij-jpi-1   ! vector opt. (forced unrolling)
[1671]73# else
[3116]74        DO jj = 2, jpjm1
75           DO ji = 2, jpim1
[1671]76# endif
[3116]77              ikbu = mbku(ji,jj)          ! deepest ocean u- & v-levels
78              ikbv = mbkv(ji,jj)
79              !
80              ! Apply stability criteria on absolute value  : abs(bfr/e3) < 1/(2dt) => bfr/e3 > -1/(2dt)
81              ua(ji,jj,ikbu) = ua(ji,jj,ikbu) + MAX(  bfrua(ji,jj) / fse3u(ji,jj,ikbu) , zm1_2dt  ) * ub(ji,jj,ikbu)
82              va(ji,jj,ikbv) = va(ji,jj,ikbv) + MAX(  bfrva(ji,jj) / fse3v(ji,jj,ikbv) , zm1_2dt  ) * vb(ji,jj,ikbv)
83           END DO
84        END DO
[1708]85
[3116]86        !
87        IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
[3231]88           ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
89           ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
90           CALL trd_mod( ztrdu(:,:,:), ztrdv(:,:,:), jpdyn_trd_bfr, 'DYN', kt )
91           CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv )
[3116]92        ENDIF
93        !                                          ! print mean trends (used for debugging)
94        IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' bfr  - Ua: ', mask1=umask,               &
95           &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
96        !
97      ENDIF     ! end explicit bottom friction
[3161]98      !
99      IF( nn_timing == 1 )  CALL timing_stop('dyn_bfr')
100      !
[1671]101   END SUBROUTINE dyn_bfr
102
103   !!==============================================================================
104END MODULE dynbfr
Note: See TracBrowser for help on using the repository browser.