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

Ignore:
Timestamp:
2008-06-23T11:05:02+02:00 (16 years ago)
Author:
ctlod
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/BDY/bdytra.F90

    r911 r1125  
    11MODULE bdytra 
    2    !!================================================================================= 
     2   !!====================================================================== 
    33   !!                       ***  MODULE  bdytra  *** 
    44   !! Ocean tracers:   Flow Relaxation Scheme of tracers on each open boundary 
    5    !!================================================================================= 
     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   !!---------------------------------------------------------------------- 
    69#if defined key_bdy 
    7    !!--------------------------------------------------------------------------------- 
    8    !!   'key_bdy'      :                         Unstructured Open Boundary Conditions 
    9    !!--------------------------------------------------------------------------------- 
     10   !!---------------------------------------------------------------------- 
     11   !!   'key_bdy'                     Unstructured Open Boundary Conditions 
     12   !!---------------------------------------------------------------------- 
    1013   !!   bdy_tra        : Relaxation of tracers on unstructured open boundaries 
    11    !!--------------------------------------------------------------------------------- 
    12    !! * Modules used 
     14   !!---------------------------------------------------------------------- 
    1315   USE oce             ! ocean dynamics and tracers variables 
    1416   USE dom_oce         ! ocean space and time domain variables  
    1517   USE bdy_oce         ! ocean open boundary conditions 
    1618   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
     19   USE in_out_manager  ! I/O manager 
    1720 
    1821   IMPLICIT NONE 
    1922   PRIVATE 
    2023 
    21    !! * Accessibility 
    2224   PUBLIC bdy_tra     ! routine called in tranxt.F90  
    2325 
    24    !! * Substitutions 
    25  
    26    !!--------------------------------------------------------------------------------- 
    27    !!   OPA 9.0 , LODYC-IPSL  (2003) 
    28    !!--------------------------------------------------------------------------------- 
     26   !!---------------------------------------------------------------------- 
     27   !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     28   !! $Id: $  
     29   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     30   !!---------------------------------------------------------------------- 
    2931 
    3032CONTAINS 
    3133 
    3234   SUBROUTINE bdy_tra( kt ) 
    33       !!------------------------------------------------------------------------------ 
     35      !!---------------------------------------------------------------------- 
    3436      !!                 ***  SUBROUTINE bdy_tra  *** 
    3537      !!                     
     
    3739      !!              case of unstructured open boundaries. 
    3840      !!  
    39       !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in  
    40       !!             a three-dimensional baroclinic ocean model with realistic 
    41       !!             topography. Tellus, 365-382. 
    42       !!  History : 
    43       !!   9.0  !  05-01 (J. Chanut, A. Sellar) Original 
    44       !!------------------------------------------------------------------------------ 
    45       !! * Arguments 
     41      !! Reference : Engedahl H., 1995, Tellus, 365-382. 
     42      !!---------------------------------------------------------------------- 
    4643      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.  
    4751 
    48       !! * Local declarations 
    49       REAL(wp) :: zwgt                       ! boundary weight 
    50       INTEGER ::   jb, jk, jgrd              ! dummy loop indices 
    51       INTEGER ::   ii, ij                    ! 2D addresses 
    52       !!------------------------------------------------------------------------------ 
    53  
    54       jgrd=1 !: Everything is at T-points here 
    55   
    56       DO jb = 1, nblen(jgrd) 
    57         DO jk = 1, jpkm1 
    58           ii = nbi(jb,jgrd) 
    59           ij = nbj(jb,jgrd) 
    60           zwgt = nbw(jb,jgrd) 
    61  
    62           ! Temperature relaxation at the boundary    
    63           ta(ii,ij,jk) = ( ta(ii,ij,jk)*(1.-zwgt)  +  tbdy(jb,jk)*zwgt ) & 
    64                                                           * tmask(ii,ij,jk)          
    65  
    66           ! Salinity relaxation at the boundary    
    67           sa(ii,ij,jk) = ( sa(ii,ij,jk)*(1.-zwgt)  +  sbdy(jb,jk)*zwgt ) & 
    68                                                           * tmask(ii,ij,jk) 
    69     
     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) 
    7066        END DO 
    7167      END DO  
    72  
    73       CALL lbc_lnk( ta, 'T', 1. ) ! Boundary points should be updated 
    74       CALL lbc_lnk( sa, 'T', 1. ) ! 
     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 
    7573 
    7674   END SUBROUTINE bdy_tra 
     75    
    7776#else 
    78    !!--------------------------------------------------------------------------------- 
    79    !!   Default option                                                    Empty module 
    80    !!--------------------------------------------------------------------------------- 
     77   !!---------------------------------------------------------------------- 
     78   !!   Dummy module                   NO Unstruct Open Boundary Conditions 
     79   !!---------------------------------------------------------------------- 
    8180CONTAINS 
    82    SUBROUTINE bdy_tra      ! Empty routine 
     81   SUBROUTINE bdy_tra(kt)      ! Empty routine 
     82      WRITE(*,*) 'bdy_tra: You should not have seen this print! error?', kt 
    8383   END SUBROUTINE bdy_tra 
    8484#endif 
    8585 
    86    !!================================================================================= 
     86   !!====================================================================== 
    8787END MODULE bdytra 
Note: See TracChangeset for help on using the changeset viewer.