Skip to content

Latest commit

 

History

History
 
 

contiguous

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Fortran 2008 contiguous arrays

Fortran 2018 contiguous arrays are discussed in pp.139-145 of "Modern Fortran Explained: Incorporating Fortran 2018". In general, operating on contiguous arrays is faster than non-contiguous arrays. A non-contiguous array actual argument into a contiguous subroutine dummy argument is incorrect syntax. GCC < 9 may fail with SIGSEGV or SIGABRT in this case, dependent on array size. Other compiler correct this incorrect syntax by temporary array opy-in, copy-out which is slower.

Example output

 .\build\contiguous\contig.exe
At line 56 of file ../contiguous/contiguous.f90
Fortran runtime warning: An array temporary was created
 F contig:   0.001 sec.
 T contig:   0.005 sec.

References

Fortran 2008 Contiguity