Total Pageviews

Tuesday, June 12, 2018

Programing with Fortran

History  of FORTRAN    

 FORTRAN was developed by IBM in 1950s for scientific and research purpose .The developer name is John Backus.It  is greatly used in numerical weather prediction,crystallography,computational physics and chemistry also in fluid dynamics.Its paradigm is  multi-paradigm,structured and generic.The name FORTRAN is an acronym for Formula Translation,Because it was designed to allow easy translation of math formula into code.
 Some significant features of the FORTRAN Language

*Simple to learn: When FORTRAN was design one of the objective was to write a language that was easy to learn and understand.

*Machine independent: Allows for easy transportation of a program from one machine to another machine.

*More natural ways to express mathematical function: FORTRAN permits even severely complex mathematical function to be expressed similarly to regular algebraic notation.

How to install a FORTRAN compiler and run a program
To compile a FORTRAN program first of all you have to download an IDE.For this we will use code blocks here.Code blocks is a open source cross platform IDE .You can download code blocks from here.

Download the yellow marked source file then install it.
After install the program open the code blocks and a screen will appear like this

OK!now you have to select the compiler,for set the compiler go to the setting option

The compiler must set as "GNU fortran Compiler".If it is set as default then ok.If not,Then you have to set it as default compiler.

Then set it default!!!

Now the final steps!Go to the tool chain executable option in the appeared menu.

Now set the compiler's installation directory---->If your computer is 32 bit it must be set as "C:\Program Files\CodeBlocks\MinGW" and for 64 bit windows it must be set as "C:\Program Files (x86)\CodeBlocks\MinGW"

Finally you are done!now write a program and compile.Choose the option create a new project

Now select files


Now choose fortran source then click the option go
click the yellow marked sign
then there is a option will be appeared where you want to save the file .Give your file a name is I give it mine test1
then save it!Again the previous windows will appear,you just need to set the file type f95 as it given below

Now click finish.Finally you are done!now I share with you a simple code with you which will compute the square of the integers from 1 to 15 and print them out
After  you write the code click the yellow marked sign!which is the option build and run.So now the program will started to compile.welldoneeeeee!!!!the out put will appeared like this
So this is all about compile a fortran program.Now started to solve your problem.Fell free to let me know at www.facebook.com/uomex