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.
obcdyn3d.F90 in branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC – NEMO

source: branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obcdyn3d.F90 @ 2797

Last change on this file since 2797 was 2797, checked in by davestorkey, 13 years ago

Delete BDY module and first implementation of new OBC module.

  1. Initial restructuring.
  2. Use fldread to read open boundary data.
File size: 5.4 KB
Line 
1MODULE obcdyn3d
2   !!======================================================================
3   !!                       ***  MODULE  obcdyn  ***
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_obc 
14   !!----------------------------------------------------------------------
15   !!   'key_obc' :                    Unstructured Open Boundary Condition
16   !!----------------------------------------------------------------------
17   !!   obc_dyn3d        : apply open boundary conditions to baroclinic velocities
18   !!   obc_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 obc_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   obc_dyn3d     ! routine called in dynspg_flt (free surface case ONLY)
30
31   !!----------------------------------------------------------------------
32   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
33   !! $Id: obcdyn.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 obc_dyn3d( kt )
39      !!----------------------------------------------------------------------
40      !!                  ***  SUBROUTINE obc_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_obc ! loop index
48      !!
49
50      DO ib_obc=1, nb_obc
51
52!!$         IF ( using Orlanski radiation conditions ) THEN
53!!$            CALL obc_rad( kt,  obcidx(ib_obc) )
54!!$         ENDIF
55
56         SELECT CASE( nn_dyn3d(ib_obc) )
57         CASE(jp_none)
58            CYCLE
59         CASE(jp_frs)
60            CALL obc_dyn3d_frs( idx_obc(ib_obc), dta_obc(ib_obc), kt )
61         CASE DEFAULT
62            CALL ctl_stop( 'obc_dyn3d : unrecognised option for open boundaries for baroclinic velocities' )
63         END SELECT
64      ENDDO
65
66   END SUBROUTINE obc_dyn3d
67
68   SUBROUTINE obc_dyn3d_frs( idx, dta, kt )
69      !!----------------------------------------------------------------------
70      !!                  ***  SUBROUTINE obc_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 obc_dyn3d_frs
113
114
115#else
116   !!----------------------------------------------------------------------
117   !!   Dummy module                   NO Unstruct Open Boundary Conditions
118   !!----------------------------------------------------------------------
119CONTAINS
120   SUBROUTINE obc_dyn3d( kt )      ! Empty routine
121      WRITE(*,*) 'obc_dyn_frs: You should not have seen this print! error?', kt
122   END SUBROUTINE obc_dyn3d
123#endif
124
125   !!======================================================================
126END MODULE obcdyn3d
Note: See TracBrowser for help on using the repository browser.