CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Fortran vs. C++ (http://www.cfd-online.com/Forums/main/117827-fortran-vs-c.html)

mb.pejvak May 15, 2013 21:51

Fortran vs. C++
 
which one is more effective c++ or fortran 2008? particularly in CFD.

massive_turbulence May 16, 2013 01:56

I saw this thread on stackoverflow with lots of arguments for and against fortran/C and I guess it all comes down to legacy code in Fortran. I notice you mentioned Fortran 2008 which should be backwards compatible with any other Fortran code which is one advantage. I'm guessing that OOP programming doesn't make things any faster so using C++ is again pointless. If you have more experience with Fortran over C++ you might as well use Fortran. A lot of CFD code seems to be written in Fortran and converting things over does require some experience in C/C++. Many Fortran programmers mention that Fortran has built in methods which are just as easily found within C/C++ libraries. C++ 11 is now capable of complex numbers or was that something included way back when.

It might all come down to who you are working with and whether team production is faster using Fortran. I personally don't like Fortrans syntax and have converted Fortran code I liked to C++.

akidess May 16, 2013 02:59

Some more recommended reading:
C vs Fortran for HPC
What makes Fortran fast
How much better are Fortran compilers really


All times are GMT -4. The time now is 09:23.