Skip to content

Commit

Permalink
ice_grid: initialize 'tarea' to 0
Browse files Browse the repository at this point in the history
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] #180
  • Loading branch information
phil-blain committed Jan 27, 2021
1 parent 85da31d commit a76893a
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 @@ -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
Expand Down

0 comments on commit a76893a

Please sign in to comment.