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.
bdytra.F90 in trunk/NEMO/OPA_SRC/BDY – NEMO

source: trunk/NEMO/OPA_SRC/BDY/bdytra.F90 @ 1125

Last change on this file since 1125 was 1125, checked in by ctlod, 16 years ago

trunk: BDY package code review (coding rules), see ticket: #214

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1MODULE bdytra
2   !!======================================================================
3   !!                       ***  MODULE  bdytra  ***
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_bdy
10   !!----------------------------------------------------------------------
11   !!   'key_bdy'                     Unstructured Open Boundary Conditions
12   !!----------------------------------------------------------------------
13   !!   bdy_tra        : Relaxation of tracers on unstructured open boundaries
14   !!----------------------------------------------------------------------
15   USE oce             ! ocean dynamics and tracers variables
16   USE dom_oce         ! ocean space and time domain variables
17   USE bdy_oce         ! ocean open boundary conditions
18   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
19   USE in_out_manager  ! I/O manager
20
21   IMPLICIT NONE
22   PRIVATE
23
24   PUBLIC bdy_tra     ! routine called in tranxt.F90
25
26   !!----------------------------------------------------------------------
27   !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)
28   !! $Id: $
29   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
30   !!----------------------------------------------------------------------
31
32CONTAINS
33
34   SUBROUTINE bdy_tra( kt )
35      !!----------------------------------------------------------------------
36      !!                 ***  SUBROUTINE bdy_tra  ***
37      !!                   
38      !! ** Purpose : Apply the Flow Relaxation Scheme for tracers in the 
39      !!              case of unstructured open boundaries.
40      !!
41      !! Reference : Engedahl H., 1995, Tellus, 365-382.
42      !!----------------------------------------------------------------------
43      INTEGER, INTENT( in ) ::   kt
44      !!
45      REAL(wp) ::   zwgt           ! boundary weight
46      INTEGER  ::   ib, ik, igrd   ! dummy loop indices
47      INTEGER  ::   ii, ij         ! 2D addresses
48      !!----------------------------------------------------------------------
49      !
50      IF(ln_bdy_tra_frs) THEN ! If this is false, then this routine does nothing.
51
52      IF( kt == nit000 ) THEN
53         IF(lwp) WRITE(numout,*)
54         IF(lwp) WRITE(numout,*) 'bdy_tra : Flow Relaxation Scheme for tracers'
55         IF(lwp) WRITE(numout,*) '~~~~~~~'
56      ENDIF
57      !
58      igrd = 1                       ! Everything is at T-points here
59      DO ib = 1, nblen(igrd)
60         DO ik = 1, jpkm1
61            ii = nbi(ib,igrd)
62            ij = nbj(ib,igrd)
63            zwgt = nbw(ib,igrd)
64            ta(ii,ij,ik) = ( ta(ii,ij,ik) * (1.-zwgt) + tbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik)         
65            sa(ii,ij,ik) = ( sa(ii,ij,ik) * (1.-zwgt) + sbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik)
66        END DO
67      END DO 
68      !
69      CALL lbc_lnk( ta, 'T', 1. )   ! Boundary points should be updated
70      CALL lbc_lnk( sa, 'T', 1. )   !
71      !
72      ENDIF ! ln_bdy_tra_frs
73
74   END SUBROUTINE bdy_tra
75   
76#else
77   !!----------------------------------------------------------------------
78   !!   Dummy module                   NO Unstruct Open Boundary Conditions
79   !!----------------------------------------------------------------------
80CONTAINS
81   SUBROUTINE bdy_tra(kt)      ! Empty routine
82      WRITE(*,*) 'bdy_tra: You should not have seen this print! error?', kt
83   END SUBROUTINE bdy_tra
84#endif
85
86   !!======================================================================
87END MODULE bdytra
Note: See TracBrowser for help on using the repository browser.