Skip to content

Commit

Permalink
ice_dyn_vp: initialize residual vector to zero
Browse files Browse the repository at this point in the history
The arrays Fx, Fy that hold the residual (Ax - b) are not initialized to
sero before being passed to 'residual_vec', and this subroutine only
loops through ice points (and not the whole of the arrays).

In debug mode, this leads to NaNs being involved in some computations
during the 'global_sum_prod' calls used to compute the norm of the
residual just after it's computed. This is only triggered in certain
tests of the 'decomp_suite'.

Initialize the residual vector (arrays Fx and Fy) to zero. This allows
the 'decomp_suite' to pass when ran with 'bfbflag = reprosum'.
  • Loading branch information
phil-blain committed Jul 27, 2022
1 parent 3a36c09 commit 693fd29
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cicecore/cicedynB/dynamics/ice_dyn_vp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,8 @@ subroutine anderson_solver (icellt , icellu , &
vrel (:,:,iblk))

! Compute nonlinear residual norm (PDE residual)
Fx = c0
Fy = c0
call matvec (nx_block , ny_block , &
icellu (iblk) , icellt (iblk), &
indxui (:,iblk) , indxuj (:,iblk), &
Expand Down

0 comments on commit 693fd29

Please sign in to comment.