Skip to content

Commit

Permalink
ice_dyn_vp: fix #42
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-blain committed Aug 9, 2022
1 parent d2e6e18 commit ef5858e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cicecore/cicedynB/dynamics/ice_dyn_vp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2709,6 +2709,7 @@ subroutine fgmres (zetax2 , etax2 , &
real (kind=dbl_kind) :: &
norm_residual , & ! current L^2 norm of residual vector
inverse_norm , & ! inverse of the norm of a vector
norm_rhs , & ! L^2 norm of right-hand-side vector
nu, t ! local temporary values

integer (kind=int_kind) :: &
Expand Down Expand Up @@ -2748,6 +2749,15 @@ subroutine fgmres (zetax2 , etax2 , &
arnoldi_basis_x = c0
arnoldi_basis_y = c0

! solution is zero if RHS is zero
norm_rhs = sqrt(global_sum_prod(bx(:,:,:), bx(:,:,:), distrb_info, field_loc_NEcorner) + &
global_sum_prod(by(:,:,:), by(:,:,:), distrb_info, field_loc_NEcorner))
if (norm_rhs == c0) then
solx = bx
soly = by
return
endif

! Residual of the initial iterate

!$OMP PARALLEL DO PRIVATE(iblk)
Expand Down

0 comments on commit ef5858e

Please sign in to comment.