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.
bdydyn3d.F90 in branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY – NEMO

source: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn3d.F90 @ 3122

Last change on this file since 3122 was 3117, checked in by cetlod, 13 years ago

dev_NEMO_MERGE_2011: add in changes BDY updates

File size: 5.4 KB
Line 
1MODULE bdydyn3d
2   !!======================================================================
3   !!                       ***  MODULE  bdydyn  ***
4   !! Unstructured Open Boundary Cond. :   Flow relaxation scheme on velocities
5   !!======================================================================
6   !! History :  1.0  !  2005-02  (J. Chanut, A. Sellar)  Original code
7   !!             -   !  2007-07  (D. Storkey) Move Flather implementation to separate routine.
8   !!            3.0  !  2008-04  (NEMO team)  add in the reference version
9   !!            3.2  !  2008-04  (R. Benshila) consider velocity instead of transport
10   !!            3.3  !  2010-09  (E.O'Dea) modifications for Shelf configurations
11   !!            3.3  !  2010-09  (D.Storkey) add ice boundary conditions
12   !!----------------------------------------------------------------------
13#if defined key_bdy 
14   !!----------------------------------------------------------------------
15   !!   'key_bdy' :                    Unstructured Open Boundary Condition
16   !!----------------------------------------------------------------------
17   !!   bdy_dyn3d        : apply open boundary conditions to baroclinic velocities
18   !!   bdy_dyn3d_frs    : apply Flow Relaxation Scheme
19   !!----------------------------------------------------------------------
20   USE oce             ! ocean dynamics and tracers
21   USE dom_oce         ! ocean space and time domain
22   USE bdy_oce         ! ocean open boundary conditions
23   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
24   USE in_out_manager  !
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   bdy_dyn3d     ! routine called in dynspg_flt (free surface case ONLY)
30
31   !!----------------------------------------------------------------------
32   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
33   !! $Id: bdydyn.F90 2528 2010-12-27 17:33:53Z rblod $
34   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
35   !!----------------------------------------------------------------------
36CONTAINS
37
38   SUBROUTINE bdy_dyn3d( kt )
39      !!----------------------------------------------------------------------
40      !!                  ***  SUBROUTINE bdy_dyn3d  ***
41      !!
42      !! ** Purpose : - Apply open boundary conditions for baroclinic velocities
43      !!
44      !!----------------------------------------------------------------------
45      INTEGER, INTENT( in ) :: kt     ! Main time step counter
46      !!
47      INTEGER               :: ib_bdy ! loop index
48      !!
49
50      DO ib_bdy=1, nb_bdy
51
52!!$         IF ( using Orlanski radiation conditions ) THEN
53!!$            CALL bdy_rad( kt,  bdyidx(ib_bdy) )
54!!$         ENDIF
55
56         SELECT CASE( nn_dyn3d(ib_bdy) )
57         CASE(jp_none)
58            CYCLE
59         CASE(jp_frs)
60            CALL bdy_dyn3d_frs( idx_bdy(ib_bdy), dta_bdy(ib_bdy), kt )
61         CASE DEFAULT
62            CALL ctl_stop( 'bdy_dyn3d : unrecognised option for open boundaries for baroclinic velocities' )
63         END SELECT
64      ENDDO
65
66   END SUBROUTINE bdy_dyn3d
67
68   SUBROUTINE bdy_dyn3d_frs( idx, dta, kt )
69      !!----------------------------------------------------------------------
70      !!                  ***  SUBROUTINE bdy_dyn3d_frs  ***
71      !!
72      !! ** Purpose : - Apply the Flow Relaxation Scheme for baroclinic velocities
73      !!                at open boundaries.
74      !!
75      !! References :- Engedahl H., 1995: Use of the flow relaxation scheme in
76      !!               a three-dimensional baroclinic ocean model with realistic
77      !!               topography. Tellus, 365-382.
78      !!----------------------------------------------------------------------
79      INTEGER                     ::   kt
80      TYPE(OBC_INDEX), INTENT(in) ::   idx  ! OBC indices
81      TYPE(OBC_DATA),  INTENT(in) ::   dta  ! OBC external data
82      !!
83      INTEGER  ::   jb, jk         ! dummy loop indices
84      INTEGER  ::   ii, ij, igrd   ! local integers
85      REAL(wp) ::   zwgt           ! boundary weight
86      !!----------------------------------------------------------------------
87      !
88      !
89      igrd = 2                      ! Relaxation of zonal velocity
90      DO jb = 1, idx%nblen(igrd)
91         DO jk = 1, jpkm1
92            ii   = idx%nbi(jb,igrd)
93            ij   = idx%nbj(jb,igrd)
94            zwgt = idx%nbw(jb,igrd)
95            ua(ii,ij,jk) = ( ua(ii,ij,jk) + zwgt * ( dta%u3d(jb,jk) - ua(ii,ij,jk) ) ) * umask(ii,ij,jk)
96         END DO
97      END DO
98      !
99      igrd = 3                      ! Relaxation of meridional velocity
100      DO jb = 1, idx%nblen(igrd)
101         DO jk = 1, jpkm1
102            ii   = idx%nbi(jb,igrd)
103            ij   = idx%nbj(jb,igrd)
104            zwgt = idx%nbw(jb,igrd)
105            va(ii,ij,jk) = ( va(ii,ij,jk) + zwgt * ( dta%v3d(jb,jk) - va(ii,ij,jk) ) ) * vmask(ii,ij,jk)
106         END DO
107      END DO
108      CALL lbc_lnk( ua, 'U', -1. )   ;   CALL lbc_lnk( va, 'V', -1. )   ! Boundary points should be updated
109      !
110      IF( kt .eq. nit000 ) CLOSE( unit = 102 )
111
112   END SUBROUTINE bdy_dyn3d_frs
113
114
115#else
116   !!----------------------------------------------------------------------
117   !!   Dummy module                   NO Unstruct Open Boundary Conditions
118   !!----------------------------------------------------------------------
119CONTAINS
120   SUBROUTINE bdy_dyn3d( kt )      ! Empty routine
121      WRITE(*,*) 'bdy_dyn_frs: You should not have seen this print! error?', kt
122   END SUBROUTINE bdy_dyn3d
123#endif
124
125   !!======================================================================
126END MODULE bdydyn3d
Note: See TracBrowser for help on using the repository browser.