From dde75b8a388829395c5b4b44dc23dcf7ed78fc4e Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 7 Oct 2024 18:32:19 -0600 Subject: [PATCH] Intel builds: add /heap-arrays:1000 compile flag We have been having issues with stack overflows in FAST.Farm when large wind grids were passed to AWAE. This was eventually tracked down to line 1078 in AWAE.f90 which reads: `m%u_IfW_Low%PositionXYZ = p%Grid_low` The `p%Grid_low` is of unknown size at compile time, but can be extremely large (3x160000 or more). This copy involves a temporary array and would normally be handled on the stack, but could result in an overflow for some models. By setting the `/heap-arrays:1000` any operation resulting in a temporary array of unknown array size at compile time will use the heap for the temprary array, and as will any array known at compile time to be larger than 1000 kB. Testing shows that this fixes issue #2053, and will likely also solve #843 and #2241 See https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2024-2/heap-arrays.html for reference. --- vs-build/FAST-farm/FAST-Farm.vfproj | 6 +++--- vs-build/FASTlib/FASTlib.vfproj | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vs-build/FAST-farm/FAST-Farm.vfproj b/vs-build/FAST-farm/FAST-Farm.vfproj index e7c3152f30..5f1d3153bd 100644 --- a/vs-build/FAST-farm/FAST-Farm.vfproj +++ b/vs-build/FAST-farm/FAST-Farm.vfproj @@ -25,7 +25,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/vs-build/FASTlib/FASTlib.vfproj b/vs-build/FASTlib/FASTlib.vfproj index 7a94c7ae68..32c624b94e 100644 --- a/vs-build/FASTlib/FASTlib.vfproj +++ b/vs-build/FASTlib/FASTlib.vfproj @@ -23,7 +23,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -122,7 +122,7 @@ - +