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.
#1401 (Missing call in lbc_lnk in bdydyn2d.F90) – NEMO

Opened 10 years ago

Closed 10 years ago

#1401 closed Bug (fixed)

Missing call in lbc_lnk in bdydyn2d.F90

Reported by: nemo_user Owned by: mocavero
Priority: high Milestone:
Component: OCE Version: trunk
Severity: Keywords:
Cc:

Description

In bdy_dyn2d_fla :

_

!!! REPLACE spgu with nemo_wrk work space

! Fill temporary array with ssh data (here spgu):
igrd = 1
spgu(:,:) = 0.0
DO jb = 1, idx%nblenrim(igrd)

ii = idx%nbi(jb,igrd)
ij = idx%nbj(jb,igrd)
spgu(ii, ij) = dta%ssh(jb)

END DO


If T and U or V points of the boundary are not located on the same processor, then it does not use spgu to compute Flather velocities at the boundary.
Therefore one should add :

CALL lbc_lnk( spgu(:,:), 'T', 1. )

after the loop.

Commit History (1)

ChangesetAuthorTimeChangeLog
4999mocavero2014-12-23T20:13:30+01:00

bug fix, see ticket #1401

Change History (3)

comment:1 Changed 10 years ago by clevy

  • Owner changed from NEMO team to mocavero ??

comment:2 Changed 10 years ago by mocavero

  • Owner changed from mocavero ?? to mocavero

I'm investigating this.

comment:3 Changed 10 years ago by mocavero

  • Resolution set to fixed
  • Status changed from new to closed

I agree with the comment. Let consider the original code:

spgu(:,:) = 0.0
DO jb = 1, idx%nblenrim(igrd)

ii = idx%nbi(jb,igrd)
ij = idx%nbj(jb,igrd)
spgu(ii, ij) = dta%ssh(jb)

END DO
!
igrd = 2 ! Flather bc on u-velocity;
! ! remember that flagu=-1 if normal velocity direction is outward
! ! I think we should rather use after ssh ?
DO jb = 1, idx%nblenrim(igrd)

ii = idx%nbi(jb,igrd)
ij = idx%nbj(jb,igrd)
flagu => idx%flagu(jb,igrd)
iim1 = ii + MAX( 0, INT( flagu ) ) ! T pts i-indice inside the boundary
iip1 = ii - MIN( 0, INT( flagu ) ) ! T pts i-indice outside the boundary
!
zcorr = - flagu * SQRT( grav * phur(ii, ij) ) * ( pssh(iim1, ij) - spgu(iip1,ij) )

! jchanut tschanges: Set zflag to 0 below to revert to Flather scheme
! Use characteristics method instead
zflag = ABS(flagu)
zforc = dta%u2d(jb) * (1._wp - z1_2*zflag) + z1_2 * zflag * pua2d(iim1,ij)
pua2d(ii,ij) = zforc + (1._wp - z1_2*zflag) * zcorr * umask(ii,ij,1)

END DO

iip1 could be outside the range of the first loop (i.e. if flagu is equal to -1), then the call to the lbc_bdy_lnk has been added.

Note: See TracTickets for help on using tickets.