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 branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/BDY – NEMO

source: branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/BDY/bdytra.F90 @ 4434

Last change on this file since 4434 was 3211, checked in by spickles2, 12 years ago

Stephen Pickles, 11 Dec 2011

Commit to bring the rest of the DCSE NEMO development branch
in line with the latest development version. This includes
array index re-ordering of all OPA_SRC/.

  • Property svn:keywords set to Id
File size: 3.9 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_frs        : 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_frs     ! routine called in tranxt.F90
25
26   !! * Control permutation of array indices
27#  include "oce_ftrans.h90"
28#  include "dom_oce_ftrans.h90"
29
30   !!----------------------------------------------------------------------
31   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
32   !! $Id$
33   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE bdy_tra_frs( kt )
38      !!----------------------------------------------------------------------
39      !!                 ***  SUBROUTINE bdy_tra_frs  ***
40      !!                   
41      !! ** Purpose : Apply the Flow Relaxation Scheme for tracers in the 
42      !!              case of unstructured open boundaries.
43      !!
44      !! Reference : Engedahl H., 1995, Tellus, 365-382.
45      !!----------------------------------------------------------------------
46      INTEGER, INTENT( in ) ::   kt
47      !!
48      REAL(wp) ::   zwgt           ! boundary weight
49      INTEGER  ::   ib, ik, igrd   ! dummy loop indices
50      INTEGER  ::   ii, ij         ! 2D addresses
51      !!----------------------------------------------------------------------
52      !
53      IF(ln_tra_frs) THEN       ! If this is false, then this routine does nothing.
54         !
55         IF( kt == nit000 ) THEN
56            IF(lwp) WRITE(numout,*)
57            IF(lwp) WRITE(numout,*) 'bdy_tra_frs : Flow Relaxation Scheme for tracers'
58            IF(lwp) WRITE(numout,*) '~~~~~~~'
59         ENDIF
60         !
61         igrd = 1                       ! Everything is at T-points here
62         DO ib = 1, nblen(igrd)
63            DO ik = 1, jpkm1
64               ii = nbi(ib,igrd)
65               ij = nbj(ib,igrd)
66               zwgt = nbw(ib,igrd)
67               ta(ii,ij,ik) = ( ta(ii,ij,ik) * (1.-zwgt) + tbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik)         
68               sa(ii,ij,ik) = ( sa(ii,ij,ik) * (1.-zwgt) + sbdy(ib,ik) * zwgt ) * tmask(ii,ij,ik)
69            END DO
70         END DO 
71         !
72         CALL lbc_lnk( ta, 'T', 1. )   ; CALL lbc_lnk( sa, 'T', 1. )    ! Boundary points should be updated
73         !
74      ENDIF ! ln_tra_frs
75      !
76   END SUBROUTINE bdy_tra_frs
77   
78#else
79   !!----------------------------------------------------------------------
80   !!   Dummy module                   NO Unstruct Open Boundary Conditions
81   !!----------------------------------------------------------------------
82CONTAINS
83   SUBROUTINE bdy_tra_frs(kt)      ! Empty routine
84      WRITE(*,*) 'bdy_tra_frs: You should not have seen this print! error?', kt
85   END SUBROUTINE bdy_tra_frs
86#endif
87
88   !!======================================================================
89END MODULE bdytra
Note: See TracBrowser for help on using the repository browser.