Re: help with module
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Tue, 7 Apr 2009 21:34:59 -0700
rudra <bnrj.rudra@xxxxxxxxx> wrote:
module parameters....
ntsite=nrsite+3 ! Dimension of AS Map
In this module,when i am definning like "ntsite=nrsite+3" and so on,
its giving error like
error #6274: This statement must not appear in the specification part
of a module
ntsite=nrsite+3 ! Dimension of AS Map
and so on for all the remainning lines. does it mean i cannot declare
values in module in this way?
That isn't a declaration at all. That is an assignment statement. An
assignment statement is an executable statement - not a declaration. The
distinction is really, really important and is one of the first things
you need to learn in Fortran. In fact, the assignment statement is
usually darn close to the first statement covered in a Fortran course.
Executable statements do things when they get executed in the course of
running the program. A module never gets executed, which is why it can't
have executable statements in it. Procedures in a module can get
executed (and can have executable statements in them), but that is not
the same thing as executing the module itself.
I can't tell what you are trying to do. In particular, I can't tell when
it is that you want these assignments to happen. There is no magic "make
this formula always be true" construct. You have to put the assignment
statements somewhere in the flow of code execution and then they are
executed whenever the code flow gets to them.
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: help with module
- From: rudra
- Re: help with module
- References:
- help with module
- From: rudra
- help with module
- Prev by Date: Re: Help fortran 90
- Next by Date: Re: help with module
- Previous by thread: help with module
- Next by thread: Re: help with module
- Index(es):
Relevant Pages
|