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.
obctra.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/obctra.F90 @ 2865

Last change on this file since 2865 was 2865, checked in by davestorkey, 13 years ago
  1. Updates for dynspg_exp option.
  2. Implement time_offset functionality in obc_dta.
  3. Add option to specify boundaries in the namelist.
  4. Re-activate obc_vol option.
  5. Update to namelist control of tidal harmonics.
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1MODULE obctra
2   !!======================================================================
3   !!                       ***  MODULE  obctra  ***
4   !! Ocean tracers:   Flow Relaxation Scheme of tracers on each open boundary
5   !!======================================================================
6   !! History :  1.0  !  2005-01  (J. Chanut, A. Sellar)  Original code
7   !!            3.0  !  2008-04  (NEMO team)  add in the reference version
8   !!----------------------------------------------------------------------
9#if defined key_obc
10   !!----------------------------------------------------------------------
11   !!   'key_obc'                     Unstructured Open Boundary Conditions
12   !!----------------------------------------------------------------------
13   !!   obc_tra            : Apply open boundary conditions to T and S
14   !!   obc_tra_frs        : Apply Flow Relaxation Scheme
15   !!----------------------------------------------------------------------
16   USE oce             ! ocean dynamics and tracers variables
17   USE dom_oce         ! ocean space and time domain variables
18   USE obc_oce         ! ocean open boundary conditions
19   USE obcdta, ONLY:   bf
20   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
21   USE in_out_manager  ! I/O manager
22
23   IMPLICIT NONE
24   PRIVATE
25
26   PUBLIC obc_tra      ! routine called in tranxt.F90
27
28   !!----------------------------------------------------------------------
29   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
30   !! $Id$
31   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
32   !!----------------------------------------------------------------------
33CONTAINS
34
35   SUBROUTINE obc_tra( kt )
36      !!----------------------------------------------------------------------
37      !!                  ***  SUBROUTINE obc_dyn3d  ***
38      !!
39      !! ** Purpose : - Apply open boundary conditions for baroclinic velocities
40      !!
41      !!----------------------------------------------------------------------
42      INTEGER, INTENT( in ) :: kt     ! Main time step counter
43      !!
44      INTEGER               :: ib_obc ! Loop index
45
46      DO ib_obc=1, nb_obc
47
48         SELECT CASE( nn_tra(ib_obc) )
49         CASE(jp_none)
50            CYCLE
51         CASE(jp_frs)
52            CALL obc_tra_frs( idx_obc(ib_obc), dta_obc(ib_obc), kt )
53         CASE DEFAULT
54            CALL ctl_stop( 'obc_tra : unrecognised option for open boundaries for T and S' )
55         END SELECT
56      ENDDO
57
58   END SUBROUTINE obc_tra
59
60   SUBROUTINE obc_tra_frs( idx, dta, kt )
61      !!----------------------------------------------------------------------
62      !!                 ***  SUBROUTINE obc_tra_frs  ***
63      !!                   
64      !! ** Purpose : Apply the Flow Relaxation Scheme for tracers at open boundaries.
65      !!
66      !! Reference : Engedahl H., 1995, Tellus, 365-382.
67      !!----------------------------------------------------------------------
68      INTEGER,         INTENT(in) ::   kt
69      TYPE(OBC_INDEX), INTENT(in) ::   idx  ! OBC indices
70      TYPE(OBC_DATA),  INTENT(in) ::   dta  ! OBC external data
71      !!
72      REAL(wp) ::   zwgt           ! boundary weight
73      INTEGER  ::   ib, ik, igrd   ! dummy loop indices
74      INTEGER  ::   ii, ij         ! 2D addresses
75      !!----------------------------------------------------------------------
76      !
77      !
78      igrd = 1                       ! Everything is at T-points here
79      DO ib = 1, idx%nblen(igrd)
80         DO ik = 1, jpkm1
81            ii = idx%nbi(ib,igrd)
82            ij = idx%nbj(ib,igrd)
83            zwgt = idx%nbw(ib,igrd)
84            ta(ii,ij,ik) = ( ta(ii,ij,ik) + zwgt * ( dta%tem(ib,ik) - ta(ii,ij,ik) ) ) * tmask(ii,ij,ik)         
85            sa(ii,ij,ik) = ( sa(ii,ij,ik) + zwgt * ( dta%sal(ib,ik) - sa(ii,ij,ik) ) ) * tmask(ii,ij,ik)
86         END DO
87      END DO 
88      !
89      CALL lbc_lnk( ta, 'T', 1. )   ; CALL lbc_lnk( sa, 'T', 1. )    ! Boundary points should be updated
90      !
91      IF( kt .eq. nit000 ) CLOSE( unit = 102 )
92   !
93   END SUBROUTINE obc_tra_frs
94   
95#else
96   !!----------------------------------------------------------------------
97   !!   Dummy module                   NO Unstruct Open Boundary Conditions
98   !!----------------------------------------------------------------------
99CONTAINS
100   SUBROUTINE obc_tra(kt)      ! Empty routine
101      WRITE(*,*) 'obc_tra: You should not have seen this print! error?', kt
102   END SUBROUTINE obc_tra
103#endif
104
105   !!======================================================================
106END MODULE obctra
Note: See TracBrowser for help on using the repository browser.