Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Fortran Programming Language

F Compiler has function to analysis Module?


The Module in F is similar with the Class in C++. In C++ Compiler,  it
has Class viewer to analysis its the classes in that program. But in
F, I can't find it.
Think two cases:
1.Use Module who contain sub-Module who also contain sub-sub-Module.
Later I forget the "use" relations between lots of files.
2. I want to known the subroutine and function in a Module. I have to
look and find it in the source code. If it has 200 subroutines in this
Module and the source code is made by others, the work may very
truble.

So, I want to ask: is there any simple and effective way to analysis
the source codes and can directly get the subroutine or fuction names
in a Module without first deeply read the source codes???

On Jun 5, 10:18 am, li.sim@gmail.com wrote:

> The Module in F is similar with the Class in C++.

I don't agree. I think of a module as a namespace where I put a
related set of procedures and or definitions of related user-defined
types (UDTs). I often define several UDTs in a module.

> In C++ Compiler,  it
> has Class viewer to analysis its the classes in that program. But in
> F, I can't find it.
> Think two cases:
> 1.Use Module who contain sub-Module who also contain sub-sub-Module.
> Later I forget the "use" relations between lots of files.
> 2. I want to known the subroutine and function in a Module.

I use a global private in a module and thus force myself to declare
entities that are used by other program units and must be declared
PUBLIC. I write

module foo_mod
implicit none
private
public :: some_dt,some_func,some_sub
! further code
end module foo_mod

> I have to
> look and find it in the source code. If it has 200 subroutines in this
> Module and the source code is made by others, the work may very
> truble.

Most modules should not contain 200 subroutines.

> So, I want to ask: is there any simple and effective way to analysis
> the source codes and can directly get the subroutine or fuction names
> in a Module without first deeply read the source codes???

The public names will appear at the top if you follow my suggested
convention.

<li.sim@gmail.com> wrote:
> The Module in F is similar with the Class in C++.

Beliavsky has addressed your questions at least as well as I could. He
also addressed the above, which is more of a side point to your actual
questions, but I'd like to emphasize and agree with his point there.

I have seen other C++ users try to think of modules as being like C++
classes. There was even one person who came to a J3 meeting and was
pushing to pretty much redo the language around that concept. I think
that the analogy between those two features is poor and will cause far
more confusions than insights.

The Fortran derived type is a much closer starting point for comparison
to a C++ class. In fact, F2003 adds something called a CLASS, and it is
an extension of the capabilities of derived types - not of modules.

--
Richard Maine                    | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle           |  -- Mark Twain

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc