Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: local varia...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 10 Topic 8171 of 8774
Post > Topic >>

Re: local variable initilization

by =?GB2312?B?SmFuIFZvcmJyqLlnZ2Vu?= <Jan.Vorbrueggen@[EMAIL PROTECTED] Apr 25, 2008 at 04:42 PM

> There are three things you can do to control this.
> 1) Initialize the variable every time you enter a procedure.
>      subroutine xxx
>      x = 1.0
> 
> 2) Provide initialization on the variable declaration.
> Something like
>       subroutine  xxx
>       real  ::  x=2.0
> x is initialized exactly ONE time, usually at load time.
> X is never reinitialized to 2.0.  This form implies the
> SAVE attribute for X.  Any change to the value of X
> propagates to the next invocation of the procedure.
> 
> 3)  Explicitly SAVE the variables.  This is normally
> done when the values are too complicated to easily
> put on the variable declaration line.

Isn't there also, fourth, using a variable of derived type
with default initialzation? IIRC, it would be re-inited on
every entry.

	Jan
 




 10 Posts in Topic:
local variable initilization
Mike <SulfateIon@[EMAI  2008-04-23 20:37:45 
Re: local variable initilization
"jamesgiles@[EMAIL P  2008-04-23 20:56:08 
Re: local variable initilization
"James Van Buskirk&q  2008-04-23 22:56:59 
Re: local variable initilization
Herman D. Knoble <Skip  2008-04-24 07:29:19 
Re: local variable initilization
blitheli <blitheli@[EM  2008-04-24 06:06:32 
Re: local variable initilization
Dick Hendrickson <dick  2008-04-24 14:17:13 
Re: local variable initilization
"James Van Buskirk&q  2008-04-24 11:39:33 
Re: local variable initilization
Steve Lionel <Steve.Li  2008-04-24 15:08:36 
Re: local variable initilization
=?GB2312?B?SmFuIFZvcmJyqL  2008-04-25 16:42:21 
Re: local variable initilization
Mike <SulfateIon@[EMAI  2008-04-24 21:27:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 23:39:15 CDT 2008.