Opened 4 weeks ago

Last modified 4 weeks ago

#2412 new Bug

potential out-of-bounds in bdydta/bdytides?

Reported by: smasson Owned by: systeam
Priority: low Milestone:
Component: BDY Version: trunk
Severity: minor Keywords:
Cc:

Description

Context

Following #2399, I had a closer look at the use of ssh and u2d/u3d arrays in bdy routines and I found that:

in bdydta, we have:

IF( cn_dyn2d(jbdy) == 'frs' ) THEN   ;   ilen1(:)=idx_bdy(jbdy)%nblen(:)
ELSE                                 ;   ilen1(:)=idx_bdy(jbdy)%nblenrim(:)
ENDIF
IF ( dta_bdy(jbdy)%lneed_ssh   ) dta_bdy_s(jbdy)%ssh(1:ilen1(1)) = dta_bdy(jbdy)%ssh(1:ilen1(1))
IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%u2d(1:ilen1(2)) = dta_bdy(jbdy)%u2d(1:ilen1(2))
IF ( dta_bdy(jbdy)%lneed_dyn2d ) dta_bdy_s(jbdy)%v2d(1:ilen1(3)) = dta_bdy(jbdy)%v2d(1:ilen1(3))

which is coherent with what we have in bdytides

! JC: If FRS scheme is used, we assume that tidal is needed over the whole
! relaxation area      
IF( cn_dyn2d(ib_bdy) == 'frs' ) THEN   ;   ilen0(:) = idx_bdy(ib_bdy)%nblen   (:)
ELSE                                   ;   ilen0(:) = idx_bdy(ib_bdy)%nblenrim(:)
ENDIF

However since I rewrote bdydta,

  • ssh is always allocated and used only on the rim
  • u2d and v2d are used and allocated only on the rim except if ln_full_vel = T, see bdy_dta_init

There is nothing here related to the choice of FRS scheme…

I don't really know bdytides but I suspect we could have a problem here…

Same story in the 4.0-HEAD…

Analysis


Fix


Commit History (0)

(No commits)

Change History (1)

comment:1 Changed 4 weeks ago by jchanut

I think that the problem is again that with FRS on 2d mode: you need barotropic velocity data over the whole boundary region. If I understood well the new code, we need an extended provision of data for 2d velocities ONLY if total vs baroclinic velocities are read.
For ssh it is true that it is needed only at rim-points and only with Flather.

Note: See TracTickets for help on using tickets.