From: James Tursa on 20 May 2010 09:43 "Baalzamon " <baalzamon_moridin(a)yahoo.com> wrote in message <ht36t0$dc8$1(a)fred.mathworks.com>... > I am attempting to convert some old fortran codes and becoming somewhat annoyed by the apparent jumping of code. WOuld I be correct in assuming that the code is read top to bottom and in line number order? If so where does the do label numbers figure into this scheme? Any advice from fortan programmers would be appreciated. To be explicit I think the coxde was written in F77... You could try to use an automated converter to get the bulk of the conversion done. e.g., here: http://www.mathworks.com/matlabcentral/fileexchange/5260-f2matlab Another alternative is to leave the Fortran code basically intact but put a front end mex interface on it so you can call it directly from MATLAB. How large is the code? James Tursa
From: Steven Lord on 20 May 2010 12:15 "dpb" <none(a)non.net> wrote in message news:ht3e5a$r7h$1(a)news.eternal-september.org... > Baalzamon wrote: *snip* > Also, if have future specific questions regarding the code itself c.l.f is > active and very helpful w/ several who are both ML and Fortran-literate. For clarification, since the OP (Original Poster) and others may not be familiar with the abbreviation: c.l.f refers to the comp.lang.fortran newsgroup, which should be available via Google Groups (http://groups.google.com) or other sites that provide general access to newsgroups. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: dpb on 20 May 2010 14:35 Steven Lord wrote: > "dpb" <none(a)non.net> wrote in message > news:ht3e5a$r7h$1(a)news.eternal-september.org... >> Baalzamon wrote: > > *snip* > >> Also, if have future specific questions regarding the code itself c.l.f is >> active and very helpful w/ several who are both ML and Fortran-literate. > > For clarification, since the OP (Original Poster) and others may not be > familiar with the abbreviation: c.l.f refers to the comp.lang.fortran > newsgroup, which should be available via Google Groups > (http://groups.google.com) or other sites that provide general access to > newsgroups. Yes, I had spelled it out in the previous sentence before abbreviating... :) As for access, the free newsservers from news.eternal-september.org that I'm currently using or aioe.org mirror comp.lang.fortran as well as cssm so a news reader can be pointed to the server rather than requiring the use of the terrible google-groups web interface. Nothing other than a registration w/ a valid e-mail address is required of either; access is generally available within a few hours of signup after their access update 'bot runs... --
From: Steven Lord on 20 May 2010 17:36 "dpb" <none(a)non.net> wrote in message news:ht3vgb$tl1$1(a)news.eternal-september.org... > Steven Lord wrote: >> "dpb" <none(a)non.net> wrote in message >> news:ht3e5a$r7h$1(a)news.eternal-september.org... *snip* >> For clarification, since the OP (Original Poster) and others may not be >> familiar with the abbreviation: c.l.f refers to the comp.lang.fortran >> newsgroup, which should be available via Google Groups >> (http://groups.google.com) or other sites that provide general access to >> newsgroups. > > Yes, I had spelled it out in the previous sentence before abbreviating... > :) *blink* *blink* I KNOW I read through your posting to try to make sure you _hadn't_ used the full term before I posted. At least twice. *sigh* Guess I need to either make an appointment with the eye doctor or to avoid quickly checking CSSM just before heading to lunch. Sorry. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Greg Heath on 20 May 2010 21:46
On May 20, 8:18 am, Rune Allnor <all...(a)tele.ntnu.no> wrote: > On 20 Mai, 13:37, "Baalzamon " <baalzamon_mori...(a)yahoo.com> wrote: > > > I am attempting to convert some old fortran codes and becoming somewhat annoyed by the apparent jumping of code. > > The infamous spaghetti style coding > > http://en.wikipedia.org/wiki/Spaghetti_code > > is the main reason why you ought not learn fortran at all. > It was obsolete 40 years ago. The only reason it remains > in use is the vast amount of legacy code present. > > > WOuld I be correct in assuming that the code is read top to bottom and in line number order? > > No. It *starts* that way, but from the first jump / break / > continue / > goto statement you are on your own with respect to untangling program > flow. Hence the spaghetti metafor. > > > If so where does the do label numbers figure into this scheme? > > They are the spots at which a jump / break / continue / goto might > refer. One serious problem with fortran is that there is no > convenient > way to find out where the jump that landed on the label was made. > > > Any advice from fortan programmers would be appreciated. To be explicit I think the coxde was written in F77... > > Don't write fortran. It might be more cost effective to find > out what the program is supposed to do, and then develop and > code the algorithm from scratch in matlab, C, C++ or Java. > > No kidding. I have had the pleasure of disentangling a FORTRAN numerical optimization program that used a plethora of subroutines and goto/contimue statements. When finished, the FORTRAN code was not dissimilar to that used in MATLAB. However, I had no incentive to convert it to MATLAB because I didn't know how to compile MATLAB to make it run as fast. A lot depends on how comfortable you are with FORTRAN, what you plan to do with the program in the futire, and how much time you can spare. Hope this helps. Greg |