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/2014/dev_r4650_UKMO14.12_STAND_ALONE_OBSOPER/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/2014/dev_r4650_UKMO14.12_STAND_ALONE_OBSOPER/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90 @ 5034

Last change on this file since 5034 was 5034, checked in by andrewryan, 9 years ago

merge with trunk

  • Property svn:keywords set to Id
File size: 5.3 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
[3294]7   !!            3.4  ! 2011-09  (H. Liu) Make it consistent with semi-implicit
8   !!                            Bottom friction (ln_bfrimp = .true.)
[1671]9   !!----------------------------------------------------------------------
10
11   !!----------------------------------------------------------------------
[5034]12   !!   dyn_bfr       : Update the momentum trend with the bottom friction contribution
[1671]13   !!----------------------------------------------------------------------
[5034]14   USE oce            ! ocean dynamics and tracers variables
15   USE dom_oce        ! ocean space and time domain variables
16   USE zdf_oce        ! ocean vertical physics variables
17   USE zdfbfr         ! ocean bottom friction variables
18   USE trd_oce        ! trends: ocean variables
19   USE trddyn         ! trend manager: dynamics
20   USE in_out_manager ! I/O manager
21   USE prtctl         ! Print control
22   USE timing         ! Timing
23   USE wrk_nemo       ! Memory Allocation
[1671]24
25   IMPLICIT NONE
26   PRIVATE
27
[5034]28   PUBLIC   dyn_bfr   !  routine called by step.F90
[1671]29
30   !! * Substitutions
31#  include "domzgr_substitute.h90"
32#  include "zdfddm_substitute.h90"
33#  include "vectopt_loop_substitute.h90"
34   !!----------------------------------------------------------------------
[2528]35   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
36   !! $Id$
37   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[1671]38   !!----------------------------------------------------------------------
39CONTAINS
40   
41   SUBROUTINE dyn_bfr( kt )
42      !!----------------------------------------------------------------------
43      !!                  ***  ROUTINE dyn_bfr  ***
44      !!
45      !! ** Purpose :   compute the bottom friction ocean dynamics physics.
46      !!
47      !! ** Action  :   (ua,va)   momentum trend increased by bottom friction trend
48      !!---------------------------------------------------------------------
49      INTEGER, INTENT(in) ::   kt   ! ocean time-step index
50      !!
[2528]51      INTEGER  ::   ji, jj       ! dummy loop indexes
52      INTEGER  ::   ikbu, ikbv   ! local integers
53      REAL(wp) ::   zm1_2dt      ! local scalar
[3294]54      REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
[1671]55      !!---------------------------------------------------------------------
56      !
[3294]57      IF( nn_timing == 1 )  CALL timing_start('dyn_bfr')
58      !
[5034]59!!gm issue: better to put the logical in step to control the call of zdf_bfr
60!!          ==> change the logical from ln_bfrimp to ln_bfr_exp !!
[3294]61      IF( .NOT.ln_bfrimp) THEN     ! only for explicit bottom friction form
62                                    ! implicit bfr is implemented in dynzdf_imp
[1708]63
[5034]64!!gm bug : time step is only rdt (not 2 rdt if euler start !)
[3294]65        zm1_2dt = - 1._wp / ( 2._wp * rdt )
[1708]66
[3294]67        IF( l_trddyn )   THEN                      ! temporary save of ua and va trends
68           CALL wrk_alloc( jpi,jpj,jpk, ztrdu, ztrdv )
69           ztrdu(:,:,:) = ua(:,:,:)
70           ztrdv(:,:,:) = va(:,:,:)
71        ENDIF
72
73
74        DO jj = 2, jpjm1
75           DO ji = 2, jpim1
76              ikbu = mbku(ji,jj)          ! deepest ocean u- & v-levels
77              ikbv = mbkv(ji,jj)
78              !
79              ! Apply stability criteria on absolute value  : abs(bfr/e3) < 1/(2dt) => bfr/e3 > -1/(2dt)
80              ua(ji,jj,ikbu) = ua(ji,jj,ikbu) + MAX(  bfrua(ji,jj) / fse3u(ji,jj,ikbu) , zm1_2dt  ) * ub(ji,jj,ikbu)
81              va(ji,jj,ikbv) = va(ji,jj,ikbv) + MAX(  bfrva(ji,jj) / fse3v(ji,jj,ikbv) , zm1_2dt  ) * vb(ji,jj,ikbv)
[5034]82             
83              ! (ISF) stability criteria for top friction
84              ikbu = miku(ji,jj)          ! first wet ocean u- & v-levels
85              ikbv = mikv(ji,jj)
86              !
87              ! Apply stability criteria on absolute value  : abs(bfr/e3) < 1/(2dt) => bfr/e3 > -1/(2dt)
88              ua(ji,jj,ikbu) = ua(ji,jj,ikbu) + MAX(  tfrua(ji,jj) / fse3u(ji,jj,ikbu) , zm1_2dt  ) * ub(ji,jj,ikbu) &
89                 &             * (1.-umask(ji,jj,1))
90              va(ji,jj,ikbv) = va(ji,jj,ikbv) + MAX(  tfrva(ji,jj) / fse3v(ji,jj,ikbv) , zm1_2dt  ) * vb(ji,jj,ikbv) &
91                 &             * (1.-vmask(ji,jj,1))
92              ! (ISF)
93             
[3294]94           END DO
95        END DO
[1708]96
[3294]97        !
98        IF( l_trddyn )   THEN                      ! save the vertical diffusive trends for further diagnostics
99           ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
100           ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
[5034]101           CALL trd_dyn( ztrdu(:,:,:), ztrdv(:,:,:), jpdyn_bfr, kt )
[3294]102           CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv )
103        ENDIF
104        !                                          ! print mean trends (used for debugging)
105        IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' bfr  - Ua: ', mask1=umask,               &
106           &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
107        !
108      ENDIF     ! end explicit bottom friction
[1671]109      !
[3294]110      IF( nn_timing == 1 )  CALL timing_stop('dyn_bfr')
[1671]111      !
112   END SUBROUTINE dyn_bfr
113
114   !!==============================================================================
115END MODULE dynbfr
Note: See TracBrowser for help on using the repository browser.