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 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90 – NEMO

Ignore:
Timestamp:
2010-12-27T18:33:53+01:00 (13 years ago)
Author:
rblod
Message:

Update NEMOGCM from branch nemo_v3_3_beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90

    • Property svn:executable deleted
    r1740 r2528  
    88   !!            3.0  !  2008-04  (NEMO team)  add in the reference version 
    99   !!            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 
    1012   !!---------------------------------------------------------------------- 
    1113#if defined key_bdy  
     
    3436 
    3537   !!---------------------------------------------------------------------- 
    36    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     38   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    3739   !! $Id$  
    38    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     40   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    3941   !!---------------------------------------------------------------------- 
    40  
    4142CONTAINS 
    4243 
     
    5455      INTEGER, INTENT( in ) ::   kt   ! Main time step counter 
    5556      !! 
    56       INTEGER  ::   ib, ik, igrd      ! dummy loop indices 
    57       INTEGER  ::   ii, ij            ! 2D addresses 
    58       REAL(wp) ::   zwgt              ! boundary weight 
     57      INTEGER  ::   jb, jk         ! dummy loop indices 
     58      INTEGER  ::   ii, ij, igrd   ! local integers 
     59      REAL(wp) ::   zwgt           ! boundary weight 
    5960      !!---------------------------------------------------------------------- 
    6061      ! 
    61       IF(ln_bdy_dyn_frs) THEN ! If this is false, then this routine does nothing.  
    62  
     62      IF(ln_dyn_frs) THEN      ! If this is false, then this routine does nothing.  
     63         ! 
    6364         IF( kt == nit000 ) THEN 
    6465            IF(lwp) WRITE(numout,*) 
    65             IF(lwp) WRITE(numout,*) 'bdy_dyn : Flow Relaxation Scheme on momentum' 
     66            IF(lwp) WRITE(numout,*) 'bdy_dyn_frs : Flow Relaxation Scheme on momentum' 
    6667            IF(lwp) WRITE(numout,*) '~~~~~~~' 
    6768         ENDIF 
    6869         ! 
    6970         igrd = 2                      ! Relaxation of zonal velocity 
    70          DO ib = 1, nblen(igrd) 
    71             DO ik = 1, jpkm1 
    72                ii = nbi(ib,igrd) 
    73                ij = nbj(ib,igrd) 
    74                zwgt = nbw(ib,igrd) 
    75                ua(ii,ij,ik) = ( ua(ii,ij,ik) * ( 1.- zwgt ) + ubdy(ib,ik) * zwgt ) * umask(ii,ij,ik) 
     71         DO jb = 1, nblen(igrd) 
     72            DO jk = 1, jpkm1 
     73               ii   = nbi(jb,igrd) 
     74               ij   = nbj(jb,igrd) 
     75               zwgt = nbw(jb,igrd) 
     76               ua(ii,ij,jk) = ( ua(ii,ij,jk) * ( 1.- zwgt ) + ubdy(jb,jk) * zwgt ) * umask(ii,ij,jk) 
    7677            END DO 
    7778         END DO 
    7879         ! 
    7980         igrd = 3                      ! Relaxation of meridional velocity 
    80          DO ib = 1, nblen(igrd) 
    81             DO ik = 1, jpkm1 
    82                ii = nbi(ib,igrd) 
    83                ij = nbj(ib,igrd) 
    84                zwgt = nbw(ib,igrd) 
    85                va(ii,ij,ik) = ( va(ii,ij,ik) * ( 1.- zwgt ) + vbdy(ib,ik) * zwgt ) * vmask(ii,ij,ik) 
     81         DO jb = 1, nblen(igrd) 
     82            DO jk = 1, jpkm1 
     83               ii   = nbi(jb,igrd) 
     84               ij   = nbj(jb,igrd) 
     85               zwgt = nbw(jb,igrd) 
     86               va(ii,ij,jk) = ( va(ii,ij,jk) * ( 1.- zwgt ) + vbdy(jb,jk) * zwgt ) * vmask(ii,ij,jk) 
    8687            END DO 
    8788         END DO  
     89         CALL lbc_lnk( ua, 'U', -1. )   ;   CALL lbc_lnk( va, 'V', -1. )   ! Boundary points should be updated 
    8890         ! 
    89          CALL lbc_lnk( ua, 'U', -1. )   ! Boundary points should be updated 
    90          CALL lbc_lnk( va, 'V', -1. )   ! 
    91          ! 
    92       ENDIF ! ln_bdy_dyn_frs 
    93  
     91      ENDIF ! ln_dyn_frs 
     92      ! 
    9493   END SUBROUTINE bdy_dyn_frs 
    9594 
    9695 
    97 #if defined key_dynspg_exp || defined key_dynspg_ts 
     96# if defined   key_dynspg_exp   ||   defined key_dynspg_ts 
     97   !!---------------------------------------------------------------------- 
     98   !!   'key_dynspg_exp'        OR              explicit sea surface height 
     99   !!   'key_dynspg_ts '                  split-explicit sea surface height 
     100   !!---------------------------------------------------------------------- 
     101    
    98102!! Option to use Flather with dynspg_flt not coded yet... 
     103 
    99104   SUBROUTINE bdy_dyn_fla( pssh ) 
    100105      !!---------------------------------------------------------------------- 
     
    102107      !!              
    103108      !!              - Apply Flather boundary conditions on normal barotropic velocities  
    104       !!                (ln_bdy_dyn_fla=.true. or ln_bdy_tides=.true.) 
     109      !!                (ln_dyn_fla=.true. or ln_tides=.true.) 
    105110      !! 
    106111      !! ** WARNINGS about FLATHER implementation: 
     
    119124      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pssh 
    120125 
    121       INTEGER  ::   ib, igrd                         ! dummy loop indices 
     126      INTEGER  ::   jb, igrd                         ! dummy loop indices 
    122127      INTEGER  ::   ii, ij, iim1, iip1, ijm1, ijp1   ! 2D addresses 
    123128      REAL(wp) ::   zcorr                            ! Flather correction 
     
    129134      ! ---------------------------------!  
    130135      
    131       IF(ln_bdy_dyn_fla .OR. ln_bdy_tides) THEN ! If these are both false, then this routine does nothing.  
     136      IF(ln_dyn_fla .OR. ln_tides) THEN ! If these are both false, then this routine does nothing.  
    132137 
    133138         ! Fill temporary array with ssh data (here spgu): 
    134          igrd = 1 
     139         igrd = 4 
    135140         spgu(:,:) = 0.0 
    136          DO ib = 1, nblenrim(igrd) 
    137             ii = nbi(ib,igrd) 
    138             ij = nbj(ib,igrd) 
    139             IF( ln_bdy_dyn_fla ) spgu(ii, ij) = sshbdy(ib) 
    140             IF( ln_bdy_tides )   spgu(ii, ij) = spgu(ii, ij) + sshtide(ib) 
     141         DO jb = 1, nblenrim(igrd) 
     142            ii = nbi(jb,igrd) 
     143            ij = nbj(jb,igrd) 
     144            IF( ln_dyn_fla ) spgu(ii, ij) = sshbdy(jb) 
     145            IF( ln_tides )   spgu(ii, ij) = spgu(ii, ij) + sshtide(jb) 
    141146         END DO 
    142147         ! 
    143          igrd = 2      ! Flather bc on u-velocity;  
     148         igrd = 5      ! Flather bc on u-velocity;  
    144149         !             ! remember that flagu=-1 if normal velocity direction is outward 
    145150         !             ! I think we should rather use after ssh ? 
    146          DO ib = 1, nblenrim(igrd) 
    147             ii  = nbi(ib,igrd) 
    148             ij  = nbj(ib,igrd)  
    149             iim1 = ii + MAX( 0, INT( flagu(ib) ) )   ! T pts i-indice inside the boundary 
    150             iip1 = ii - MIN( 0, INT( flagu(ib) ) )   ! T pts i-indice outside the boundary  
     151         DO jb = 1, nblenrim(igrd) 
     152            ii  = nbi(jb,igrd) 
     153            ij  = nbj(jb,igrd)  
     154            iim1 = ii + MAX( 0, INT( flagu(jb) ) )   ! T pts i-indice inside the boundary 
     155            iip1 = ii - MIN( 0, INT( flagu(jb) ) )   ! T pts i-indice outside the boundary  
    151156            ! 
    152             zcorr = - flagu(ib) * SQRT( grav * hur_e(ii, ij) ) * ( pssh(iim1, ij) - spgu(iip1,ij) ) 
    153             zforc = ubtbdy(ib) + utide(ib) 
     157            zcorr = - flagu(jb) * SQRT( grav * hur_e(ii, ij) ) * ( pssh(iim1, ij) - spgu(iip1,ij) ) 
     158            zforc = ubtbdy(jb) + utide(jb) 
    154159            ua_e(ii,ij) = zforc + zcorr * umask(ii,ij,1)  
    155160         END DO 
    156161         ! 
    157          igrd = 3      ! Flather bc on v-velocity 
     162         igrd = 6      ! Flather bc on v-velocity 
    158163         !             ! remember that flagv=-1 if normal velocity direction is outward 
    159          DO ib = 1, nblenrim(igrd) 
    160             ii  = nbi(ib,igrd) 
    161             ij  = nbj(ib,igrd)  
    162             ijm1 = ij + MAX( 0, INT( flagv(ib) ) )   ! T pts j-indice inside the boundary 
    163             ijp1 = ij - MIN( 0, INT( flagv(ib) ) )   ! T pts j-indice outside the boundary  
     164         DO jb = 1, nblenrim(igrd) 
     165            ii  = nbi(jb,igrd) 
     166            ij  = nbj(jb,igrd)  
     167            ijm1 = ij + MAX( 0, INT( flagv(jb) ) )   ! T pts j-indice inside the boundary 
     168            ijp1 = ij - MIN( 0, INT( flagv(jb) ) )   ! T pts j-indice outside the boundary  
    164169            ! 
    165             zcorr = - flagv(ib) * SQRT( grav * hvr_e(ii, ij) ) * ( pssh(ii, ijm1) - spgu(ii,ijp1) ) 
    166             zforc = vbtbdy(ib) + vtide(ib) 
     170            zcorr = - flagv(jb) * SQRT( grav * hvr_e(ii, ij) ) * ( pssh(ii, ijm1) - spgu(ii,ijp1) ) 
     171            zforc = vbtbdy(jb) + vtide(jb) 
    167172            va_e(ii,ij) = zforc + zcorr * vmask(ii,ij,1) 
    168173         END DO 
     174         CALL lbc_lnk( ua_e, 'U', -1. )   ! Boundary points should be updated 
     175         CALL lbc_lnk( va_e, 'V', -1. )   ! 
    169176         ! 
    170       ENDIF ! ln_bdy_dyn_fla .or. ln_bdy_tides 
     177      ENDIF ! ln_dyn_fla .or. ln_tides 
    171178      ! 
    172179   END SUBROUTINE bdy_dyn_fla 
Note: See TracChangeset for help on using the changeset viewer.