Skip to content

Commit

Permalink
Merge pull request #349 from DusanJovic-NOAA/dycore_a2b_ord2_bugfix
Browse files Browse the repository at this point in the history
Adjust do loop bounds in a2b_ord2 to prevent reading from uninitialized memory
  • Loading branch information
laurenchilutti authored Jul 16, 2024
2 parents 577fd5e + bb89a58 commit 1720f85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/compiler_flags_Intel_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(CMAKE_Fortran_FLAGS_REPRO "-O2 -debug minimal -fp-model consistent -qoverrid

set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -debug minimal -fp-model source -qoverride-limits -qopt-prefetch=3")

set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays")

set(CMAKE_Fortran_LINK_FLAGS "")

Expand Down
4 changes: 2 additions & 2 deletions model/a2b_edge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ subroutine a2b_ord2(qin, qout, gridstruct, npx, npy, is, ie, js, je, ng, replace

if (gridstruct%bounded_domain) then

do j=js-2,je+1+2
do i=is-2,ie+1+2
do j=js,je+1
do i=is,ie+1
qout(i,j) = 0.25*(qin(i-1,j-1)+qin(i,j-1)+qin(i-1,j)+qin(i,j))
enddo
enddo
Expand Down

0 comments on commit 1720f85

Please sign in to comment.