School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,137 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,835 people online right now. Registration is fast and FREE... Join Now!




Translation from Fortran 77 to Matlab

 

Translation from Fortran 77 to Matlab

makaialexa

23 Sep, 2009 - 01:41 PM
Post #1

New D.I.C Head
*

Joined: 12 May, 2006
Posts: 10


My Contributions
Hello... I'm not sure if this allowed here, but I need help with something here. I have a program in Fortran 77, and I have to "translate" it to Matlab. I found a couple of translators... One that translates from F77 to F90, and then one that translated F90 to Matlab.

I "did" the translation, of course, having a lot of problems later. First, I had problems "translating" the GO TO sentences, but I think I managed to get them well. Then I had problems with some declaration and inicialization of variables, but that was fixed as well.

The program in Matlab starts running pretty well, but there's some point of the code that starts to show error messages with divisions by zero, caused by some variable that doesn't change its value from zero during the execution. Maybe I messed up this code by sneaking my hands into it?... Can someone help me with a F90 compiler, so I can see if that was the problem? Because if the error is from F77's code, it can't be possible for it to work with divisions by zero...

Please, I need big help... I have to finish this for monday...

User is offlineProfile CardPM
+Quote Post


scalt

RE: Translation From Fortran 77 To Matlab

23 Sep, 2009 - 06:33 PM
Post #2

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 196



Thanked: 23 times
Dream Kudos: 25
My Contributions
How big is your program? I was given the horrible task of converting some FORTRAN 90 code to VB and just did the whole thing manually - it was only about 1500 lines. It's not too hard to do, and I didn't even know FORTRAN when I started (it's pretty easy to figure out what's going on). At first I had tried screwing around with converters but based on that experience I would say they are waaayyy more trouble than they are worth
User is offlineProfile CardPM
+Quote Post

Aeternalis

RE: Translation From Fortran 77 To Matlab

24 Sep, 2009 - 06:45 AM
Post #3

D.I.C Regular
***

Joined: 13 Jul, 2009
Posts: 273



Thanked: 25 times
My Contributions
I agree,

With Fortran being almost completely procedural, you should have no problem porting the individual functions to Matlab functions. Some of the Fortran stuff may not have obvious conversions, for instance you can overlay different data types on the same space of memory using equivalence... kinda like a Union.. its strange if you grew up with OO programming.

If you have specific problems with a piece of code post it here and we will try to help. Sorry your working on time constraints.. Can't help you there.

Aet

This post has been edited by Aeternalis: 24 Sep, 2009 - 06:46 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:09PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month