Is Python Suitable for Integrating and Updating Legacy Engineering Software?

Click For Summary

Discussion Overview

The discussion revolves around the suitability of Python for integrating and updating legacy engineering software originally written in Fortran and other languages. Participants explore various programming languages and tools that could facilitate the reprogramming and integration of these older applications into a cohesive software suite for modern 64-bit Windows machines.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses a desire to reprogram legacy engineering software in Python, questioning its suitability compared to C or its variants.
  • Another participant suggests C#.NET as a reasonable choice for the task.
  • A different participant mentions that Microsoft Visual Studio supports Fortran through a third-party add-on, allowing integration with other languages for GUI development.
  • There is a suggestion to package Fortran code as a DLL to be used with Python, although the participant admits to lacking practical experience with this approach.
  • Python with numpy is proposed as a good choice, with references to various Python distributions available for Windows.
  • One participant recommends converting iterative solutions to vectorized solutions using numpy, while also mentioning Cython for performance improvements.
  • There is a request for clarification regarding the availability of Fortran support in Microsoft Visual Studio, leading to a confirmation that it is indeed a third-party add-on.

Areas of Agreement / Disagreement

Participants present multiple competing views regarding the best programming language and approach for the task, with no consensus reached on a single solution.

Contextual Notes

Participants discuss various programming environments and tools, but there is uncertainty regarding the current support and availability of specific Fortran-to-C conversion tools and the integration of legacy code with modern languages.

Who May Find This Useful

Engineers and software developers involved in updating or integrating legacy engineering software, particularly those familiar with Fortran and interested in modern programming languages like Python or C#.NET.

bigaggie
Messages
40
Reaction score
0
So, my company has quite a few old programs for calculating solutions to bearings, annular seals, etc. The calculations are iterative in nature, and none of these old programs are really integrated together, which is problematic. Plus they're in Fortran (or something else), and don't run on our newer computers. So I would like to reprogram some of them to run on 64 bit Windows machines. But I'm not sure what language to use for something like this. We'd like to package them together into a software suite that we can distribute among our engineering group. I know some Python, and I think I could do it in Python relatively quickly, but is this really something that Python's suitable for? Should we be looking at C (or one of its variants)?
 
Technology news on Phys.org
C#.NET would be a reasonable choice.
 
If the company is paying for the job, Microsoft Visual Studio supports Fortran (but not in the free VS Express versions). All the languages are integrated with each other, so if you want to leave your Fortran code untouched and add a graphical user interface in a different language, you can.

I agree the .NET framework would be a reasonable choice for any new code. Use whichever language is easiest to translate your old code into (which probably means "old school" C, rather than C++ or C#).

There used to be a very good fortran-to-C conversion program, called, unimaginatively, f2c. I don't know if it's still around or supported though. Try Google.
 
EDIT: If you can package up the Fortran code as a DLL, you could use the existing code from another language like Python. I don't have any practical experience with this, though. Otherwise...

Python with numpy would be a good choice.

http://www.numpy.org/

There are several Python distributions for windows that probably have all you need, like Anaconda, Canopy, WinPython, and Portable Python.

http://code.google.com/p/winpython/
http://continuum.io/downloads
https://www.enthought.com/products/canopy/
http://portablepython.com/

I use WinPython. The default install is just a directory, with no registry changes. It's only as invasive as you want it to be. But Portable Python may be even more convenient in this way since it's meant to be run off a USB stick.

And here's a site with many pre-compiled scientific Python modules for windows:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

With numpy, you want to try to convert an iterative solution to a vectorized solution. Usually this is very straightforward, but some cases may take some thought. In the case where only an iterative solution will work, I've found Cython fairly easy to use for massive speedups without having to write C by hand:

http://cython.org/
 
Last edited:
Thanks for the help guys. Looks like we'll have to find a co-op or something (we're a bunch of mech engineers).
 

Similar threads

Replies
16
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
4
Views
4K
Replies
2
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 67 ·
3
Replies
67
Views
25K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
15
Views
5K