fortran - How can gfortran tell if I am compiling f90 or f95 code? -


i understand gfortran can compile f90 or f95? how know 1 compiling? can compile f77 code? ubuntu have fortran compiler or need download gfortran?

gfortran can guess things file extension; if file has extension of .f, .f90, f95, .f03, or .f08 assume fixed (.f) or free format appropriate standards. can force compile (say) fortran2003 code option -std=f2003. eg, documentation,

-std=std

specify standard program expected conform, may 1 of `f95', `f2003', `f2008', `gnu', or `legacy'. default value std `gnu', specifies superset of fortran 95 standard includes of extensions supported gnu fortran, although warnings given obsolete extensions not recommended use in new code. `legacy' value equivalent without warnings obsolete extensions, , may useful old non-standard programs. `f95', `f2003' , `f2008' values specify strict conformance fortran 95, fortran 2003 , fortran 2008 standards, respectively; errors given extensions beyond relevant language standard, , warnings given fortran 77 features permitted obsolescent in later standards. `-std=f2008ts' allows fortran 2008 standard including additions of technical specification (ts) 29113 on further interoperability of fortran c.

note that, few exceptions, fortran standards highly backwards-compatable, "nice", standard conforming, fortran-77 code valid fortran 2003 code. main problem fortran code 80s , earlier neither "nice" nor standard-conforming.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -