- Fortran Wiki - This is a user maintaned website containing many links to resources on Fortran (generic programming, string handling, interoperability with other languages, object oriented programming, GUI development, compilers, build tools, unit testing, etc.)
- Fortran Wikipedia Page - The Fortran page on Wikipedia is quite resourceful on the history and semantics of the language. A list of language features for Fortran 95 has it's own page.
- User notes on Fortran programming - An old practical guide to the Fortran language (FORTRAN 77 and Fortran 90).
- Fortran Best Practices - A collection of modern canonical ways of doing thins in Fortran.
- [Intel Fortran Compiler Developer Guide and Reference](https://software.intel.com/en-
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module interop | |
use, intrinsic :: iso_c_binding, only: c_int | |
implicit none | |
contains | |
subroutine fillint(arr) bind(c) | |
integer(c_int), intent(inout) :: arr(:) | |
integer :: i | |
arr = [(i**2,i=1,size(arr))] | |
end subroutine | |
end module |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! test_mmap.f90 | |
! | |
! compile with: | |
! gfortran -Wall -O2 -o test_mmap test_mmap.f90 | |
! | |
! inspired by the work: | |
! Rojc, B., & Depolli, M. (2021). A Resizable C++ Container using Virtual Memory. In ICSOFT (pp. 481-488). | |
! https://www.scitepress.org/Papers/2021/105571/105571.pdf | |
! | |
! so far I've only tested this on MacOS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile with g++ -o bisect.cxx poly.o -I<path/to/boost> | |
#include <cmath> | |
#include <iostream> | |
#include <boost/math/tools/roots.hpp> | |
// Functor providing termination condition | |
// Determines convergence in x based on if the relative or absolute tolerance are satisfied | |
template<class T> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<NotepadPlus> | |
<UserLang name="Fortran Namelist" ext="nml" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00! 01 02 03 04</Keywords> | |
<Keywords name="Numbers, prefix1">.</Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"file_patterns": ["*.fypp", "*.fy90"], | |
"working_dir": "${file_path}", | |
"cmd": ["fypp", "${file}", "${file_base_name}.f90"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! Can be used currently | |
#:def optval(lhs,opt,default) | |
${lhs}$ = ${default}$ | |
if (present(${opt}$)) ${lhs}$ = ${opt}$ | |
#:enddef | |
#! This is the F202X conditional expression syntax | |
#:def optval2(opt,default) | |
present(${opt}$)) ? ${opt}$ : ${default}$ | |
#:enddef |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module lapack | |
implicit none | |
interface | |
subroutine sgetrf(m,n,a,lda,ipiv,info) | |
integer, intent(in) :: m, n, lda | |
real, intent(inout) :: a(lda,*) | |
integer, intent(out) :: ipiv(*) | |
integer, intent(out) :: info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module pad_mod | |
implicit none | |
interface padl | |
module procedure padl_blank | |
module procedure padl_char | |
end interface | |
interface padr |