Skip to content

Commit

Permalink
ice_grid: initialize 'uvm' to 0
Browse files Browse the repository at this point in the history
In subroutine 'makemask', the array 'uvm' is initialized in a loop on indices
{ilo, ihi} and {jlo, jhi}, but is then used in a loop on indices {1, nx_block} and
{1, ny_block}, potentially causing an uninitialized value to be used (at line 1672).

Initialize the whole array to zero first, to avoid using uninitialized values.
The initialization to zero is actually commented out, following
10c446a (Dummy and unused variables. (CICE-Consortium#180), 2018-09-22) [1], so uncomment it.

[1] CICE-Consortium#180
  • Loading branch information
phil-blain committed Jan 27, 2021
1 parent a76893a commit c136267
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cicecore/cicedynB/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ subroutine makemask
!-----------------------------------------------------------------

bm = c0
! uvm = c0
uvm = c0

!$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block)
do iblk = 1, nblocks
Expand Down

0 comments on commit c136267

Please sign in to comment.