lanzone
asked on
fortran to javascript conversion
Hello,
I have an old fortran program that does a bunch of calculations based on 10 input variables. there are many DO loops and IF statements through out the source code.
is there a program out there or service anyone has used to convert the code from fortran to javascript.
the ultimate goal is to turn this old dos program into a web interface since it is just calculations and nothing else.
I have an old fortran program that does a bunch of calculations based on 10 input variables. there are many DO loops and IF statements through out the source code.
is there a program out there or service anyone has used to convert the code from fortran to javascript.
the ultimate goal is to turn this old dos program into a web interface since it is just calculations and nothing else.
If it is just if and do's let's hve a look.
I do not know fortran at all, but I have been in IT since 1986 so I do know if and do ;)
I do not know fortran at all, but I have been in IT since 1986 so I do know if and do ;)
Hmm me and my big mouth ;) http://en.wikipedia.org/wiki/Fortran_language_features
@mplungjan - Michel, oh yeah. Fortran has been around for a long time, and a huge number of "improvements" have been made over that time.
It has been ages since I last programmed in Fortran, but even then it was a non-trivial language.
It has been ages since I last programmed in Fortran, but even then it was a non-trivial language.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
That was my suggestion, dcesari :)
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
looking at Antlr now and trying to figure it out.
ASKER
i'm having no luck with the conversion.. it might just be too old of FORTRAN code to work with..
How about posting the Fortran, a decent editor macro might be able to bash it into shape.
ASKER
see attachment for the fortran program
had to rename it as a txt file, but it's called cell1.for
CELL1.txt
had to rename it as a txt file, but it's called cell1.for
CELL1.txt
Holy *%ç&
Is the READ from file or a user input?
Is the READ from file or a user input?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Is
float stc[], cvolt[], lsp[];
valid javascript? If so, what version?
I see this page https://developer.mozilla.org/en/JavaScript_typed_arrays
float stc[], cvolt[], lsp[];
valid javascript? If so, what version?
I see this page https://developer.mozilla.org/en/JavaScript_typed_arrays
Well, you are right, it should be
var stc=[], cvolt=[], lsp=[];
I did not mean to use these arraybuffer extensions you are indicating. Since these fortran arrays are not very big, I think it is reasonable to use standard js arrays (lists) for them.
As I said it is just a first guess out of my editor, no testing, so there may be many errors, it is not a definite solution.
var stc=[], cvolt=[], lsp=[];
I did not mean to use these arraybuffer extensions you are indicating. Since these fortran arrays are not very big, I think it is reasonable to use standard js arrays (lists) for them.
As I said it is just a first guess out of my editor, no testing, so there may be many errors, it is not a definite solution.
ASKER
thanks for all of the help. this is a good base to see where I need to get it from here..
If you or anyone could program the rest of this, please contact me and let me know a price for the project.
thank you guys !
If you or anyone could program the rest of this, please contact me and let me know a price for the project.
thank you guys !
Thanks, please see my profile on EE for contacting me on more specific Fortran matters.
Most of the stuff I could find would "convert" fortran to something like HTML for a pretty (e.g., color hilighted) display.