From c136267896615793c42ec959d03698d5483a1ac8 Mon Sep 17 00:00:00 2001 From: Philippe Blain Date: Wed, 30 Sep 2020 09:25:43 -0400 Subject: [PATCH] ice_grid: initialize 'uvm' to 0 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. (#180), 2018-09-22) [1], so uncomment it. [1] https://github.com/CICE-Consortium/CICE/pull/180 --- cicecore/cicedynB/infrastructure/ice_grid.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicecore/cicedynB/infrastructure/ice_grid.F90 b/cicecore/cicedynB/infrastructure/ice_grid.F90 index 693dac074..5308236a8 100644 --- a/cicecore/cicedynB/infrastructure/ice_grid.F90 +++ b/cicecore/cicedynB/infrastructure/ice_grid.F90 @@ -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