We may earn an affiliate commission when you visit our partners.
Robert Spall

This course introduces beginning students to the basics of Fortran90/95 programming.  Out of necessity, it does not cover all aspects of the language, but enough so that students will be able to write useful codes after completion.  The course  will be of particular value to those STEM students who would like to learn a language which has stood the test of time, and is widely used in the area of scientific computing.  Also useful for those who need to work with legacy Fortran code but have no Fortran background.  Previous programming experience would be helpful but is not absolutely necessary.  The course assumes some basic ability to use a command-line interface. I will also provide a short introduction to the use of DISLIN, a graphics/widget plotting package that you can implement in your Fortran codes. All Fortran codes used as examples are downloadable, as are the course notes.

Enroll now

What's inside

Learning objective

Students will learn the basics of fortran programming with simple applications in the fields of science and engineering.

Syllabus

Write relatively simple Fortran programs. Section notes can be downloaded under Lecture 1 downloadable materials. Two codes are also available for download.
Read more

Shows where to download and install either the g95 or gfortran compiler, compiler options, etc.   

I have added a new Section 8, Lecture 29 for a quick demonstration on how to set up a simple environment to write, compile, and execute your codes. 

Section 8 will hold lectures developed after the initial release of the course (so that I do not have to record everything all over to keep lecture numbers consistent).

Understand the 3 basic "sections" of a Fortran code.

Understand  basic constant and variable types.

Students should know how to perform basic input and output operations in their codes.

Understand basic assignment statements and operator types.

Have an idea of the range of intrinsic (built-in) functions available in Fortran.

Students should be able to follow the basic logic of this simple Fortran90/95 program.

Compute Period of Simple Pendulum
Section 1 Quiz
Understand how to write code that will select certain statements to execute. Notes can be downloaded under Lecture 8 resources.

Understand logical expressions.

Understand the use of if-then-else constructs.

Understand the case construct and its value as an option to if-then-else constructs.

Paint Spraying Considerations

Questions from Sections 1 and 2 material.

Fortrtan Loops

Students should be able to successfully implement Counting DO loops into a program.

Students should be able to effectively implement CYCLE and EXIT statements into a program.

Effectively implement WHILE loops into a program.

Section 3 Quiz
Monte Carlo Code to Estimate Pi
Debug a Code
Understand the concept of arrays. Write Fortran programs effectively utilizing arrays.

Students should understand how to declare arrays in their programs.

Students should know how and when to use arrays in their programs.

Students should understand how to use intrinsic (built-in) functions for array operations.

Compute Temperature in L-Shaped Domain Using an Iterative Technique
Section 4 Quiz
Input/Output

Students should be able to implement PRINT statements in their Fortran codes.

Students should understand basic usage of the FORMAT statement in WRITE operations.

Students should be able to write code to open data files and read/write to these files.

Students should be able to read/write to unformatted files and understand the advantages and disadvantages of doing so.

Open and Read File Practice
Quiz 5
Functions, Subroutines, and Modules

Students should be able to define and implement user defined Functions in their Fortran programs.

Students should understand how and why to use Subroutines in their Fortran programs.

Students should understand the use of Modules in their Fortran programs.

Compute Flight Path of Baseball
Quiz 6
Miscellaneous Topics

Students should be able to implement timing routines into their Fortran codes.

This lecture is a brief introduction to the graphics capabilities of the DISLIN graphics package.

This is a simple example of using DISLIN to create line plots.

This is a more involved DISLIN graphics application coupled to a problem in fluid dynamics.  (Note the system will not allow the uploading of an executable, so you will need to install DISLIN and compile if you want to run towed_sphere.)

Tridiagonal Matrix Solver
Lectures that have been added after the initial course publication are included here.

Develop, compile, debug, and execute a simple Fortran code using an editor and command line approach rather than a single integrated development environment (IDE).  If you begin with this approach, you will have a much better idea of what compiler options to use.

Convert sequential Fortran codes to parallel using OpenMP

This lecture provides a very brief introduction to parallelization of Fortran codes on shared memory machines using OpenMP.

Simple code to show how to begin and end parallel regions with code.

Another "Hello World" in Parallel
Parallel Do Loop

Description of Red-Black iterative finite-difference scheme to solve Poisson equation in parallel.

The finite difference code to solve Poisson equation using Red-Black iterative scheme.  Loop-level parallelization with OpenMP.

Save this course

Save Beginning Fortran for Science and Engineering Students to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Beginning Fortran for Science and Engineering Students with these activities:
Review Command-Line Basics
Reinforce your understanding of command-line operations, which are essential for compiling and running Fortran programs.
Browse courses on Command-Line Interface
Show steps
  • Practice navigating directories using 'cd', 'ls', and 'pwd'.
  • Create, copy, and delete files using 'touch', 'cp', 'rm', and 'mkdir'.
  • Execute simple commands and understand command-line arguments.
Read 'Fortran 95/2003 Explained'
Expand your knowledge of Fortran syntax and features beyond the course's introductory scope.
Show steps
  • Read the chapters relevant to the course topics.
  • Try out the code examples provided in the book.
  • Refer to this book when you encounter difficulties in the course.
Implement Basic Algorithms in Fortran
Solidify your understanding of Fortran syntax and control structures by implementing common algorithms.
Show steps
  • Write Fortran code to sort an array of numbers.
  • Implement a search algorithm (e.g., binary search) in Fortran.
  • Create a Fortran program to calculate the factorial of a number.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Write a Fortran Tutorial
Deepen your understanding of Fortran by explaining key concepts to others.
Show steps
  • Choose a specific Fortran topic (e.g., arrays, loops, functions).
  • Write a clear and concise tutorial explaining the topic, including code examples.
  • Share your tutorial on a programming forum or blog.
Develop a Simple Scientific Simulation
Apply your Fortran skills to a practical problem by creating a simulation of a scientific phenomenon.
Show steps
  • Choose a simple scientific problem to simulate (e.g., projectile motion).
  • Design the Fortran code to model the problem, including input parameters and output results.
  • Implement the simulation in Fortran, using appropriate data structures and control flow.
  • Test and validate the simulation results against known solutions or experimental data.
Explore 'Modern Fortran Explained'
Gain a deeper understanding of advanced Fortran features and programming paradigms.
Show steps
  • Read chapters on object-oriented programming and other advanced topics.
  • Experiment with the code examples provided in the book.
  • Consider how these advanced features could be applied to your own projects.
Contribute to a Fortran Open Source Project
Enhance your Fortran skills by contributing to a real-world project and collaborating with other developers.
Show steps
  • Find a Fortran open-source project on platforms like GitHub or GitLab.
  • Explore the project's codebase and documentation.
  • Identify a bug to fix or a feature to implement.
  • Submit a pull request with your changes.

Career center

Learners who complete Beginning Fortran for Science and Engineering Students will develop knowledge and skills that may be useful to these careers:
Climate Modeler
A climate modeler develops and uses computer models to simulate the Earth's climate system and predict future climate change. This role requires strong programming skills, a deep understanding of physics and mathematics, and the ability to work with large datasets. A graduate degree is usually required for this position. This course on Fortran programming can be valuable for climate modelers. Fortran is widely used in climate modeling due to its numerical computing capabilities. This course covering Fortran90/95 and scientific computing, will help aspiring climate modelers. Understanding DISLIN, plus parallelization techniques makes a climate modeler more effective.
Computational Scientist
A computational scientist uses programming skills to solve complex problems in various scientific disciplines. This role often requires working with legacy codes or developing new algorithms for simulations and data analysis. A course on Fortran, a language widely used in scientific computing, helps build a foundation for this career. Given that this course specifically focuses on Fortran90/95 and its applications in science and engineering, it may be particularly helpful. Exposure to DISLIN, a plotting package, may also be beneficial. Expertise in parallelization of Fortran codes is a definite plus for a computational scientist.
Geophysicist
A geophysicist studies the Earth's physical properties and processes, such as earthquakes, volcanoes, and magnetic fields. This often involves using computer models to simulate seismic waves, fluid flow, and other geophysical phenomena. A geophysicist typically has an advanced degree. This course is effective for becoming a geophysicist. This course, focused on Fortran90/95 and its applications in science and engineering, may be particularly useful. Exposure to plotting packages and parallelization techniques helps geophysicists.
Scientific Programmer
A scientific programmer develops and maintains software used in scientific research and development. This often involves working with numerical methods, simulations, and data analysis tools. This course on Fortran programming is especially useful for aspiring scientific programmers. The course introduces the fundamentals of Fortran90/95, a language that has stood the test of time in scientific computing. The course's focus on practical coding examples and downloadable resources may provide a solid start. Knowledge of parallel programming and experience with plotting packages makes a scientific programmer more effective.
Simulation Engineer
A simulation engineer creates computer models of physical systems and phenomena to analyze their behavior and optimize their performance. They employ programming languages and numerical methods to develop accurate and efficient simulations. This course on Fortran would be beneficial for aspiring simulation engineers. Fortran is frequently used in engineering simulations due to its numerical computing capabilities. This course provides an introduction to the basics of Fortran programming, with examples and downloadable code, and helps one become proficient in writing simulation codes. Experience with plotting packages is a definite plus when visualizing results.
Research Scientist
A research scientist conducts experiments, analyzes data, and publishes findings to advance knowledge in a specific field. In many scientific disciplines, programming skills are essential for data analysis, modeling, and simulation. While a research scientist typically needs advanced degrees, this course on Fortran can be particularly useful. Fortran is a language widely used in scientific computing. This course introduces the basics of Fortran programming. The course provides exposure to DISLIN, a plotting package that can be beneficial for visualizing data, and the course also covers parallelization of Fortran codes.
Aerospace Engineer
An aerospace engineer designs, develops, and tests aircraft, spacecraft, and related systems. This involves using computational tools and simulations to analyze aerodynamic performance, structural integrity, and control systems. This course on Fortran may prove useful for an aerospace engineer. Fortran is a language often used in aerospace engineering for numerical simulations and analysis. With the basics of Fortran programming, one should be capable of writing engineering codes. The content on DISLIN and parallelization techniques makes an aerospace engineer more effective.
Mechanical Engineer
A mechanical engineer designs, develops, and tests mechanical devices and systems. This involves using computer-aided design (CAD) software and simulation tools to analyze stress, heat transfer, and fluid flow. This course on Fortran may be useful for a mechanical engineer. Fortran is a language used in mechanical engineering for numerical simulations and analysis. This course provides the basics of Fortran programming with applications in science and engineering. The course's focus on writing simple Fortran programs and understanding basic input/output operations are especially relevant.
Civil Engineer
A civil engineer designs, constructs, and maintains infrastructure projects such as roads, bridges, buildings, and water systems. This often involves using computer models to analyze structural stability, traffic flow, and environmental impact. This course on Fortran may be helpful for a civil engineer. Fortran is a language useful in civil engineering for numerical simulations and analysis. This course will help one write simple Fortran programs and understand basic input/output operations, especially when doing data analysis. Familiarity with plotting packages may also be useful.
Data Analyst
A data analyst examines large datasets to identify trends, patterns, and insights that can inform decision-making. Often, data analysts need to process data generated by scientific instruments or simulations. This course in Fortran programming is useful for a data analyst. Legacy scientific data may be stored in formats that require Fortran for processing. Also, the ability to write custom Fortran programs for data analysis is a valuable skill. Skills in visualization are required of a data analyst, and this course introduces plotting packages to create meaningful charts and plots.
Data Scientist
A data scientist uses programming, statistical analysis, and machine learning techniques to extract knowledge and insights from data. This often involves working with large datasets, developing predictive models, and communicating results to stakeholders. Exposure to Fortran may be useful to a data scientist. Legacy data may be stored in formats that require Fortran for processing. The course introduces the basics of Fortran programming. Skills in visualization are required, and this course introduces plotting packages to create meaningful charts and plots to present findings.
Statistician
A statistician collects, analyzes, and interprets data to draw conclusions and make predictions. This often involves using statistical software packages and programming languages to perform data analysis and modeling. This course on Fortran may be useful for a statistician. Legacy statistical data may be stored in formats that require Fortran for processing. Also, a statistician may be able to write custom Fortran programs for data analysis. Skills in visualization are required, and this course introduces plotting packages to create meaningful charts and plots.
Bioinformatician
A bioinformatician analyzes biological data using computational tools and techniques. This includes analyzing DNA sequences, protein structures, and gene expression patterns to understand biological processes and develop new therapies. This course on Fortran may be useful for a bioinformatician. Legacy biological data may be stored in formats that require Fortran for processing. Also, the ability to write custom Fortran programs for data analysis is a valuable skill. Skills in visualization are required, and this course introduces plotting packages to create meaningful charts and plots.
Financial Modeler
A financial modeler creates quantitative models to analyze financial markets, assess investment risk, and forecast financial performance. This often involves using programming languages and statistical techniques to develop complex financial models. This course on Fortran may be helpful for financial modelers. Legacy financial data may be stored in formats that require Fortran for processing. Also, the ability to write custom Fortran programs is a valuable skill. Exposure to DISLIN, a plotting package, may also be beneficial for visualizing results.
Software Engineer
A software engineer designs, develops, and tests software applications. While software engineers often work with modern languages and frameworks, understanding legacy languages like Fortran is useful. This course on Fortran programming may be useful for a software engineer. The course's instruction on Fortran90/95 helps one maintain or interface with older scientific codes or systems. The course's instruction on the use of modules and subroutines is broadly applicable across programming languages and paradigms. Software engineers typically work on collaborative project. This course can help one work with legacy projects.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Beginning Fortran for Science and Engineering Students.
Provides a comprehensive guide to Fortran 95 and 2003 standards. It valuable reference for understanding the nuances of the language and its advanced features. While the course focuses on the basics, this book offers additional depth and breadth for those who want to explore Fortran in more detail. It is commonly used as a textbook in academic settings.
Builds upon 'Fortran 95/2003 Explained' and delves into more advanced features of modern Fortran. It is particularly useful for understanding object-oriented programming in Fortran and other advanced topics. This book is more valuable as additional reading to expand your knowledge after completing the course. It good reference for those who want to use Fortran for complex scientific and engineering applications.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser