From 48fc1809e1ce07e0c625a073c0144ba54c17f68d Mon Sep 17 00:00:00 2001 From: Philippe Blain Date: Wed, 30 Sep 2020 09:25:43 -0400 Subject: [PATCH] ice_grid: initialize 'tarea' to 0 In subroutine 'init_grid2', the array 'tarea' is initialized in a loop on indices {ilo, ihi} and {jlo, jhi}, but is then used in subroutine 'makemask' in a loop on indices {1, nx_block} and {1, ny_block}, potentially causing an uninitialized value to be used (at line 1693). 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 d50cf5fa1..359a76763 100644 --- a/cicecore/cicedynB/infrastructure/ice_grid.F90 +++ b/cicecore/cicedynB/infrastructure/ice_grid.F90 @@ -384,7 +384,7 @@ subroutine init_grid2 ! T-grid cell and U-grid cell quantities !----------------------------------------------------------------- -! tarea(:,:,:) = c0 + tarea(:,:,:) = c0 !$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block) do iblk = 1, nblocks