use of undefined values with ln_botmix_triad
In branch_4.2, when ln_botmix_triad = .true.:
- in
tra_ldf_triad_t(traldf_triad.F90), we have:
! Define pt_rhs halo points for multi-point haloes in bilaplacian case
IF( nldf_tra == np_blp_it .AND. kpass == 1 ) THEN ; iij = nn_hls
ELSE ; iij = 1
ENDIF
...
IF( ln_botmix_triad ) THEN
DO kp = 0, 1 !== Horizontal & vertical fluxes
DO_2D( iij, iij-1, iij, iij-1 )
zah_slp_ip1 = zah_ip1 * triadi(ji+1,jj,jk,1,kp)
--> when iij = 1 the do loop DO_2D( iij, iij-1, iij, iij-1 ) becomes DO_2D( 1, 0, 1, 0 ), and triadi is used on ji = Nie0+1. Same story for tradj that is used on jj = Nje0+1.
--> when iij = nn_hls = 2 the do loop DO_2D( iij, iij-1, iij, iij-1 ) becomes DO_2D( 2, 1, 2, 1 ), and triadi is used on ji = Nie0+2. Same story for tradj that is used on jj = Nje0+2.
- in
ldf_slp_triad(ldfslp.F90), we have:
DO kp = 0, 1 ! k-index of triads
DO jl = 0, 1
ip = jl ; jp = jl ! i- and j-indices of triads (i-k and j-k planes)
DO jk = 1, jpkm1
! Must mask contribution to slope from dz/dx at constant s for triads jk=1,kp=0 that poke up though ocean surface
znot_thru_surface = REAL( 1-1/(jk+kp), wp ) !jk+kp=1,=0.; otherwise=1.0
DO_2D( nn_hls, nn_hls-1, nn_hls, nn_hls-1 )
...
triadi(ji+ip,jj ,jk,1-ip,kp) = zti_lim * zisw
--> when nn_hls = 1, when jl = ìp = 0, triadiis defined only until ji = Nie0. Same story for triadjthat is defined only until jj = Nje0. In this case, tra_ldf_triad_t is therefore using undefined values of triadi with laplacien or bilaplacien.
--> when nn_hls = 2, when jl = ìp = 0, triadiis defined only until ji = Nie0+1. Same story for triadjthat is defined only until jj = Nje0+1. In this case, tra_ldf_triad_t is therefore using undefined values of triadi only if we use bilaplacien.