https://craftofcoding.wordpress.com/2023/01/10/why-fortran-is-a-scientific-powerhouse/ Skip to content The Craft of Coding Musings on programming Menu * Home * About * Course Material (free) * FAQ * IMAGE PROCESSING * LANGUAGES * Learning to Program * PRACNIQUES (programming case studies) * Programming Stuff * Recursion * Usability, Design and Web * Useful snippets of code Why Fortran is a scientific powerhouse 10/01/2023 People often are surprised to find out how prevalent Fortran is in the real world. For instance many climate models were originally written, and continue to be maintained in Fortran (languages like Julia are attempting to unseat it, but I think Julia would be a better language if it had an ISO standard associated with it). One of the reasons Fortran still works is longevity. It's much easier to build on something that was originally developed in Fortran (which is backwards compatible), rather than starting from scratch. People always make is seem so easy, but many a re-engineering project has come unstuck because of a failure to understand how the original software worked. Fortran is also exceptionally good at doing math, and climate models are nothing if not all about crunching data and doing math. That's not to say there aren't challenges - but find me a language that doesn't have some challenges. I don't like it when people try to explain that "Python would be better", because of some cockamamie idea that its syntax is better than Fortran. Sure it's more succinct, but that's purely for the benefit of the programmer, not the machine. And who is to say explicit typing doesn't actually add some level of clarity, which is extremely important in programs that perform calculations. So how many climate models are written in Fortran? Mendez et al. [1] analyzed 16 well known climate models in 2014, all were Fortran. So in reality, most if not all are written in Fortran. Why do they still use Fortran? * Performance - Fortran is fast, in cases faster than C, and climate modelling, like so much scientific computing is about speed. (Check out [2] for language benchmarks). * Parallelism - Performance necessitates parallelism, and Fortran was doing that before other languages even knew what it was. * Reuse - Backwards compatibility means that existing libraries can easily be reused. * Arrays - Fortran treats arrays with the respect they should have. It supports multi-dimensional arrays, slicing, reduction, reshaping, and many optimizations for array based calculations like vectorization. * Longevity - Climate models and the like can't be implemented in languages that aren't (i) backwards compatible, and (ii) always change. If you write code in Fortran today, it is still likely to work in 20 or 30 years time. * Effort - Do you know how much effort would be involved in re-engineering a model? New languages are problematic. * MPI - The message passing Interface (MPI) is the gateway to high-performance computing, and Fortran handles it very well. Fortran was designed for scientific computing. Sure Fortran is old, but so is Unix, and C as well. Just because languages like Julia are newer, doesn't mean it's better. Everyone thought C++ would be some sort of coding saviour as well, and look how well that turned out. People sometimes think that if something is written in a language like R, then it is pure R... but fail to understand that R itself is not pure R. R is itself composed of code made up of R, C, and Fortran. More info: 1. Mendez, M., Tinetti, F.G., Overbey, J.L., "Climate models: Challenges for Fortran development tools", in 2nd Int. Workshop on Software Engineering for High Performance Computing in Computational Science & Engineering (2014). 2. The Computer Language Bennchmarks Game P.S. Fortran often appears on those "outdated languages" lists, but the lists are often compiled by people who have little or no clue about anything to do with computing, let alone programming languages. Advertisement Share this: * LinkedIn * Pinterest * Email * Facebook * Twitter * Like this: Like Loading... Related Posted in: Fortran, legacy, programming | Tagged: benefits of Fortran , fortran, scientific programming in Fortran Post navigation Another year, another piece of boring technology (or perhaps not?) Search for: [ ] [Search] Recent Posts * Why Fortran is a scientific powerhouse * Another year, another piece of boring technology (or perhaps not?) * Kenya Hara on technology * Tips for potential CS grad students * It's the end of social media as we know it, and I feel fine Archives * January 2023 * December 2022 * November 2022 * October 2022 * September 2022 * August 2022 * July 2022 * June 2022 * May 2022 * April 2022 * March 2022 * February 2022 * January 2022 * December 2021 * November 2021 * October 2021 * September 2021 * July 2021 * June 2021 * May 2021 * April 2021 * March 2021 * February 2021 * January 2021 * December 2020 * November 2020 * October 2020 * September 2020 * August 2020 * July 2020 * June 2020 * May 2020 * April 2020 * March 2020 * February 2020 * January 2020 * December 2019 * November 2019 * October 2019 * September 2019 * August 2019 * July 2019 * June 2019 * May 2019 * April 2019 * March 2019 * February 2019 * January 2019 * December 2018 * November 2018 * October 2018 * September 2018 * August 2018 * July 2018 * June 2018 * May 2018 * April 2018 * March 2018 * February 2018 * January 2018 * December 2017 * November 2017 * October 2017 * September 2017 * August 2017 * July 2017 * June 2017 * May 2017 * April 2017 * March 2017 * February 2017 * January 2017 * December 2016 * November 2016 * October 2016 * September 2016 * August 2016 * July 2016 * June 2016 * May 2016 * April 2016 * March 2016 * February 2016 * January 2016 * December 2015 * November 2015 * October 2015 * September 2015 * June 2015 * May 2015 * April 2015 * March 2015 * January 2015 * December 2014 * November 2014 * June 2014 * May 2014 * April 2014 * March 2014 * January 2014 * December 2013 * November 2013 * October 2013 * September 2013 * July 2013 * June 2013 Meta * Register * Log in * Entries feed * Comments feed * WordPress.com Blog at WordPress.com. [Close and accept] Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, including how to control cookies, see here: Cookie Policy * Follow Following + [wpcom-] The Craft of Coding Join 330 other followers [ ] Sign me up + Already have a WordPress.com account? Log in now. * + [wpcom-] The Craft of Coding + Customize + Follow Following + Sign up + Log in + Copy shortlink + Report this content + View post in Reader + Manage subscriptions + Collapse this bar %d bloggers like this: [b]