replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - HOw to make a flowchart of a code form the text of the code
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HOw to make a flowchart of a code form the text of the code

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Wed Dec 12, 2012 6:48 am    Post subject: HOw to make a flowchart of a code form the text of the code Reply with quote

I have a huge FORTRAN program. I am trying to understand the structure of the program. Unfortunately it doesn't have a flowchart.

I want to know is there any procedure inside the SilverFrost FTN 95 Express or VS to draw a summary of the program or ideally a flowchart of the program?

I figured out that there are minus/plus sign on the left hand side of the code text which summarizes subroutines and IF commands. I need something more elaborate.

Any comment in this regard is welcome.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Wed Dec 12, 2012 9:35 am    Post subject: Reply with quote

The only tool that I know of is plusFORT from Polyhedron but I don't think that it will give you a flow chart.
Back to top
View user's profile Send private message AIM Address
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Wed Dec 12, 2012 10:23 am    Post subject: Re: Reply with quote

PaulLaidler wrote:
The only tool that I know of is plusFORT from Polyhedron but I don't think that it will give you a flow chart.


Is it compatible with SilverFRost FTN 95 Express?
Back to top
View user's profile Send private message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Wed Dec 12, 2012 10:41 am    Post subject: Re: Reply with quote

PaulLaidler wrote:
The only tool that I know of is plusFORT from Polyhedron but I don't think that it will give you a flow chart.


It is not free. I am looking for somthing free like SilverFrost FTN 95.
If you know anything free, let me know.

Thanks in advance.

Khoshravan
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Wed Dec 12, 2012 10:12 pm    Post subject: Reply with quote

http://www.fortran.com/diagram.html

Eddie
Back to top
View user's profile Send private message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Fri Dec 14, 2012 10:20 am    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
http://www.fortran.com/diagram.html

Eddie


Could you please explain about this site.
I couldn't understand if it is a program in FORTRAN doing what I want or is it something else?
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Fri Dec 14, 2012 12:44 pm    Post subject: Reply with quote

Well, it is more elaborate than the FTN95 listing. Also it is free. (2 of your requests)

What it does is the sort of thing I used to do on a listing printout years ago, which is to indicate the "span" of DO loops (even when they are nested) and block IF statements by lines down the left side of the page. As it is in Fortran, and it has the source code, it could be modified.

If you want more sophisticated, i.e. to draw a flow chart with rectangles and diamonds with linking lines, you may have to either spend a lot of money, or do it yourself by reading the source code you have in front of you.

It isn't clear to me what you mean by huge. 500, 1000, 10,000 lines? How many subroutines? Is it easy-to-read fortran, or the sort of incomprehensible rubbish that used to be written by PhD students with no comments, and 1000 line subroutines? If it is truly huge, with hundreds of subroutines, you might also use a call tree analyser, like this one:

http://drn.digitalriver.com/product/view/id/16268

Whichever way you go, there is no substitute for immersing yourself in understanding the Fortran code itself.

As to whether anything does what you want - you could either specify what exactly you want more fully or give various bits of free software a trial of your own. Alternatively, find your own helpful Fortran expert who is prepared to spend time teaching you how to do it. As your profile does not say where you are, it is difficult for even the most helpful individual to offer ... but if you are in the UK and wanted me to look at your problem I would.

Eddie
Back to top
View user's profile Send private message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Fri Dec 14, 2012 4:55 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
Well, it is more elaborate than the FTN95 listing. Also it is free. (2 of your requests)

What it does is the sort of thing I used to do on a listing printout years ago, which is to indicate the "span" of DO loops (even when they are nested) and block IF statements by lines down the left side of the page. As it is in Fortran, and it has the source code, it could be modified.

If you want more sophisticated, i.e. to draw a flow chart with rectangles and diamonds with linking lines, you may have to either spend a lot of money, or do it yourself by reading the source code you have in front of you.

It isn't clear to me what you mean by huge. 500, 1000, 10,000 lines? How many subroutines? Is it easy-to-read fortran, or the sort of incomprehensible rubbish that used to be written by PhD students with no comments, and 1000 line subroutines? If it is truly huge, with hundreds of subroutines, you might also use a call tree analyser, like this one:

http://drn.digitalriver.com/product/view/id/16268

Whichever way you go, there is no substitute for immersing yourself in understanding the Fortran code itself.

As to whether anything does what you want - you could either specify what exactly you want more fully or give various bits of free software a trial of your own. Alternatively, find your own helpful Fortran expert who is prepared to spend time teaching you how to do it. As your profile does not say where you are, it is difficult for even the most helpful individual to offer ... but if you are in the UK and wanted me to look at your problem I would.

Eddie


Dear Eddie

Thanks for your reply.

This program is written in 80s (1980). It doesn't have any complicated FORTRAN commands. It consists of only DO, IF and 4 basic operations (+,-,*,/). It is solving sets of differential equations concerning wave propagation. It is about 7,000 lines and has 57 subroutines.
I have a book explaining the theory but still it is not easy to understand the code.

You are correct. I have to put time to find out how it works out.
I am from Iran. Here FORTRAN is sort of history and nobody works with it. I learned it in 80s when I was a university student.

Anyway thanks for offer and comments. Let me see how it goes. Maybe I will ask for your help if it is needed.

BR
Khoshravan
Back to top
View user's profile Send private message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Fri Dec 14, 2012 4:56 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:

It isn't clear to me what you mean by huge. 500, 1000, 10,000 lines? How many subroutines? Is it easy-to-read fortran, or the sort of incomprehensible rubbish that used to be written by PhD students with no comments, and 1000 line subroutines? If it is truly huge, with hundreds of subroutines,

As to whether anything does what you want - you could either specify what exactly you want more fully or give various bits of free software a trial of your own. Alternatively, find your own helpful Fortran expert who is prepared to spend time teaching you how to do it. As your profile does not say where you are, it is difficult for even the most helpful individual to offer ... but if you are in the UK and wanted me to look at your problem I would.

Eddie


Dear Eddie

Thanks for your reply.

This program is written in 80s (1980). It doesn't have any complicated FORTRAN commands. It consists of only DO, IF and 4 basic operations (+,-,*,/). It is solving sets of differential equations concerning wave propagation. It is about 7,000 lines and has 57 subroutines.
I have a book explaining the theory but still it is not easy to understand the code.

You are correct. I have to put time to find out how it works out.
I am from Iran. Here FORTRAN is sort of history and nobody works with it. I learned it in 80s when I was a university student.

Anyway thanks for offer and comments. Let me see how it goes. Maybe I will ask for your help if it is needed.

BR
Khoshravan
Back to top
View user's profile Send private message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Fri Dec 14, 2012 4:57 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:

It isn't clear to me what you mean by huge. 500, 1000, 10,000 lines? How many subroutines? Is it easy-to-read fortran, or the sort of incomprehensible rubbish that used to be written by PhD students with no comments, and 1000 line subroutines? If it is truly huge, with hundreds of subroutines,

As to whether anything does what you want - you could either specify what exactly you want more fully or give various bits of free software a trial of your own. Alternatively, find your own helpful Fortran expert who is prepared to spend time teaching you how to do it. As your profile does not say where you are, it is difficult for even the most helpful individual to offer ... but if you are in the UK and wanted me to look at your problem I would.

Eddie


Dear Eddie

Thanks for your reply.

This program is written in 80s (1980). It doesn't have any complicated FORTRAN commands. It consists of only DO, IF and 4 basic operations (+,-,*,/). It is solving sets of differential equations concerning wave propagation. It is about 7,000 lines and has 57 subroutines.
I have a book explaining the theory but still it is not easy to understand the code.

You are correct. I have to put time to find out how it works out.
I am from Iran. Here FORTRAN is sort of history and nobody works with it. I learned it in 80s when I was a university student.

Anyway thanks for offer and comments. Let me see how it goes. Maybe I will ask for your help if it is needed.

BR
Khoshravan
Back to top
View user's profile Send private message
khoshravan



Joined: 03 Dec 2012
Posts: 31

PostPosted: Fri Dec 14, 2012 5:05 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:

It isn't clear to me what you mean by huge. 500, 1000, 10,000 lines? How many subroutines? Is it easy-to-read fortran, or the sort of incomprehensible rubbish that used to be written by PhD students with no comments, and 1000 line subroutines? If it is truly huge, with hundreds of subroutines,

As to whether anything does what you want - you could either specify what exactly you want more fully or give various bits of free software a trial of your own. Alternatively, find your own helpful Fortran expert who is prepared to spend time teaching you how to do it. As your profile does not say where you are, it is difficult for even the most helpful individual to offer ... but if you are in the UK and wanted me to look at your problem I would.

Eddie


Dear Eddie

Thanks for your reply.

This program is written in 80s (1980). It doesn't have any complicated FORTRAN commands. It consists of only DO, IF and 4 basic operations (+,-,*,/). It is solving sets of differential equations concerning wave propagation. It is about 7,000 lines and has 57 subroutines.
I have a book explaining the theory but still it is not easy to understand the code.

You are correct. I have to put time to find out how it works out.
I am from Iran. Here FORTRAN is sort of history and nobody works with it. I learned it in 80s when I was a university student.

Anyway thanks for offer and comments. Let me see how it goes. Maybe I will ask for your help if it is needed.

BR
Khoshravan
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Fri Dec 14, 2012 8:52 pm    Post subject: Reply with quote

I guessed Iran.

With only (!) 57 subroutines, it should not be very difficult to work out which subroutine calls or is called by what. You can normally express this these relationships in a diagram. Then you need to know, in rough terms, what each routine actually does. Some routines are called from several places, and these are doing clearly defined tasks like finding determinants of matrices, or transforming vectors in space that crop up again and again in your algorithm. Routines that care called only once, and in sequence, are probably dividing the algorithm into manageable chunks. Given the 1980's date of the program, it is likely that several routines exist to read in the data, and check it for consistency; similarly, one or more routines probably deal with printing out the results in neat tables. Some routines may deal with reporting errors, or the progress of a calculation.

If there are any routines missing from the source code, they could be from a library that you don't have. Then you might be in trouble! If they are graphics routines, it means that the program draws its results as well as printing them. If the missing routines have names like F004AF then you are missing a library that does something like matrix operations.

Assuming it is all there, and self contained, what is left are the routines that actually solve your problem!

Depending on how much documentation you have, it may be worth puzzling out what data is stored in which arrays - or you might get this from the printout section of the program.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group