Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-02

Fortran to Pascal conversion

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lee, John

You may recall that I asked a few months ago whether anyone out there knew of one. Well I got a reply telling me about forpasc http://ilia.reznik.home.mindspring.com. I've tried this & it is a very good free converter of fortran 77 (ie oldish) to pascal (tp). Ilia tells me he isn't going to update to f90. However, the problem is that it doesn't work too well for fortran 90 (ie new style) Fortran eg it requires each subroutine in separate file which is a pain. BTW, if anyone knows another better one eg for f90 pls let me know.

So you will all not be surprised to hear that I've written my own translator for Fortran 90 + , in fpc, which seems to work ok for the good quality Fortran 90 I originally had to convert. The converter has a cli & is pretty standard fpc (or maybe tp too) so will work for any fpc supported platform. It does essentially a single pass so is very fast & assumes working & sensible ie not unstructured Fortran. It works at present best for sensible block structured Fortran eg with if then elses & not the dreaded goto(1,7,15) or other f60 horrors & with everything eg lots of subroutines etc in 1 file plus explicit variable declarations. Not sure about loadsa (or any) commons either since not sure how to convert them properly... it's best for passing params...It'll probably work best with lots of algorithmic stuff, but it won't at present (or ever? convert complex i/o & format statements properly. As with any translator, the fpc produced still needs some manual editing too.

However, I'd like some other examples to test it further, so if you have any good Fortran 90 (that actually works) eg a few 100s or 1000s of lines especially if I can run it when I've converted it to test it, please zip & email it to me. I won't of course use it except for testing.

I'll then release the (working?) converter (as fpc), including source to the normal fpc? ftp sites so you can convert at your leisure.

Regards & TIA for some contributions...