[FLASH-USERS] Segmentation fault due to POINTER_INTENT_OUT

Klaus Weide klaus at flash.uchicago.edu
Fri Nov 10 14:58:53 EST 2017


On Thu, 9 Nov 2017, Yingchao Lu wrote:

> Using ftn compiler on cori, segmentation fault is encountered and
> backtracked to the subroutine in hy_memReleaseBlkPtr.F90.
> 
....
> 
> I solved it by using -DPOINTER_INTENT_OUT=pointer. Does this cause problems
> for any other part of the code?

Hi Yingchao,

You solution is a good one. It should not cause any problems with either 
the current or near-future versions of the code.

The header file "FortranLangFeatures.fh" (included already in releases 
since FLASH 4.2 or so) is used to enable or disable use of a couple of 
compiler features that were introduced officially in Fortran 2003 or 2008, 
but are also implemented by many compilers that don't fully support those 
standards. These features, including using INTENT(OUT) on POINTER variable 
declaration, can help a compiler in making optimization decisions, and can 
help eliminate code errors. None of them are needed for code correctness.

If you can come up with a preprocessor test for detecting your compiler 
that has problems with "POINTER,INTENT(OUT)", along the lines of the tests 
already in Simulation/FortranLangFeatures.fh, you should add it there;
and I would appreciate a copy so we can make it available in the next code 
release!

Klaus



More information about the flash-users mailing list