id summary reporter owner description type status priority milestone component version severity resolution keywords cc branch_review mp_status wp_comment
899 trasbc with key_vvl jamesharle nemo "Around ln 160 in trasbc.F90 the surface boundary condition content trend (sbc_tsc) is populated having been previously allocated, but not intialised (from a cold start). It's populated for i=2:end-1 and j=2:end, which struck me as a little odd (why end-1 in i and end in j). I first noticed this as the uninitialised row and columns occasionally (depending on compile options etc) contain NaNs and blow up my model run. I first thought that these uninitialised cells shouldn't matter as they're in the halo, which when needed are updated with an exchange with neighbouring processors, thus removing the uninitialised values. However if I've tracked this correctly the sbc_tsc array is used to update tsb (aka ptb) in tranxt.F90 (around ln 322 and 328 - subroutine tra_nxt_vvl). This is looped over the full i and j so my NaN jumps into tsb (ptb). Now when tra_adv and tra_adv_tvd are called the NaN from tsb (ptb) makes it's way into the halo of the upstream flux zwx & zwy (~ln 128 traadv_tvd.F90) . In calculating the total advective trend (~ln 157) the NaN jumps to an interior ocean point as ztra at j=2 relies on zwy(j) - zwy(j-1) - this is subsequently propagated into tsa (aka pta) and tsn (aka ptn) so in 3 time steps the model blows up. Now I can solve this by intialising sbc_tsc(:,:) = 0 around ln 147 in the trasbc.F90 routine or by looping over i=1:end j=1:end at ln 160 in trasbc.F90 - both give slightly different answers. Looking at the code I would have thought one would loop over the full i and j for sbc_tsc to make the halo calculation in the total advective trend consistent with the
neighbouring processor - as by setting sbc_tsc to zero in the first row and first and last columns would remove the correction to the surface tracer field prior to the flux calculation and be inconsistent with the neighbouring processor interior points - e.g the last interior row of the processor to the south would have the surface flux correction and therefore there will be an albeit small difference in the horizontal flux calculation (there isn't, as far as I can see, lbc_lnk prior to this - hence the propagation of the NaN into the interior)." Bug closed normal OCE release-3.4 fixed SBC VVL charris