[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

coverting algorithms based on FORTRAN77 to MATLAB

Posted on 2009-12-16
11
Medium Priority
?
1,469 Views
Last Modified: 2016-03-02
can anyone help me with this convertion?i have done all i know but getting stuck not getting same result as original.
PROG1.doc
prog1MATLAB.zip
0
Comment
Question by:zappelin_245
  • 5
  • 5
11 Comments
 
LVL 32

Expert Comment

by:phoffric
ID: 26060974
Can I suggest that you convert and test one function (subroutine) at a time. Then identify the ones that work. For the ones that do not work, give us your best clues as to what you think the problem is. Also providing input and the good fortran output along with the bad matlab output for the functions that do not work would be helpful.
0
 

Author Comment

by:zappelin_245
ID: 26061919
to phoffric..
First and foremost, thanks for responding my question. Actually this converting job is my first time using FORTRAN as well as MATLAB. I have done test one by one function(subroutine)at a time. The result is pretty convincing because there was no error what so ever,but the output file didn't come out as it should be. I think some of the problem are converting WRITE syntax (FORTRAN) to PRINTF syntax(MATLAB) and some format letters in WRITE syntax.
---all the matlab output was bad=(    

prog1-FORTRAN-goodOUTPUTfile.zip
0
 
LVL 15

Expert Comment

by:yuk99
ID: 26069111
Have you tried F2MATLAB:
http://www.mathworks.com/matlabcentral/fileexchange/5260

It might not convert everything perfectly, but probably will be helpful.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:zappelin_245
ID: 26069208
to yuk99..
First and foremost, thanks for responding my question. As far as i know,F2MATLAB converting FORTRAN90 to MATLAB which i have to convert from FORTRAN77 to FORTRAN90.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 26069717
Is FORTRAN90 upward compatible with FORTRAN77? If so, then maybe F2MATLAB would work??
I looked at your FORTRAN77 code in PROG1.doc. It has been so long that I forgot some of the syntax. I will download a free compiler and review documentation. It's like riding a bike. I'll get back to you.
0
 
LVL 32

Accepted Solution

by:
phoffric earned 2000 total points
ID: 26069723
Here's another converter:

f77toM: "f77toM is a Perl 5 script to convert one or more F77 or F90 files to Matlab M-files."
http://www.mathworks.cn/matlabcentral/fileexchange/167-f77tom
0
 

Author Comment

by:zappelin_245
ID: 26089617
to phoffric...
I'm so sorry replying your comment soo late. Thank you for giving me f77toM converter. Before using that script i installed activeperl in my pc n follow all instruction,but i had a problem with running that converter. I think it run perfectly, but i don't have any idea what to do next
f77toM.JPG
0
 
LVL 32

Expert Comment

by:phoffric
ID: 26090051
I just downloaded cygwin which includes f77. With a little luck, maybe I'll be able to run your FORTRAN source code. (Is your FORTRAN source complete - not missing anything?)
0
 

Author Comment

by:zappelin_245
ID: 26090583
to phoffric...
Thank you very much!! My FORTRAN source that i gave to earlier is complete.
0
 
LVL 32

Expert Comment

by:phoffric
ID: 26157404
Not sure if I got FORTRAN compiler setup right. Here are the errors when compiling your PROG1.for file:

$ f77 prog1.for
prog1.for: In subroutine `init1':
prog1.for:107:
         call rand(x0,r)
              ^
Reference to intrinsic function `RAND' as if it were a subroutine at (^)
prog1.for: Outside of any program unit:
prog1.for:107: warning:
         call rand(x0,r)
              1
prog1.for:234: (continued):
         subroutine rand(x,yfl)
                    2
Same name `rand' used for global at (2) and intrinsic at (1) [info -f g77 M INTGLOB]
prog1.for: In subroutine `select':
prog1.for:283:
         call rand(x0,r)
              ^
0
 

Author Comment

by:zappelin_245
ID: 26179564
to phoffric...
I'm so sorry replying your comment soo late. I dont have any idea why you got error when compiling it since I dont got any error. I think i just lose hope for this conversion=(
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Aerodynamic noise is the cause of the majority of the noise produced by helicopters. The inordinate amount of noise helicopters produce is a major problem in the both a military and civilian setting. To remedy this problem the use of an aerogel coat…
This video teaches viewers about errors in exception handling.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question