Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Question about DATA statement initialisation in a module
Hello,

A colleague had some code like:

MODULE mydata
PRIVATE
REAL, PUBLIC, SAVE, DIMENSION(10)::emc
DATA emc/1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0/
END MODULE mydata

which compiled with no problems. When he USEd the module mydata in some othe
r code and
printed out the values of "emc" he always got zeroes. I never use DATA state
ments anymore,
so I changed the code to

MODULE mydata
PRIVATE
REAL, PUBLIC, PARAMETER, DIMENSION(10)::emc = &
(/1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0/)
END MODULE mydata

and, as expected, when he printed out the "emc" numbers they were now 1.0,2.
0,...10.0.

My question is, why doesn't the first module make the emc numbers available?
 Oh, and both
forms worked using the PGI compiler. Only the SGI f90 compiler gave zeroes f
or the first form.

Thanks,

paulv


Report this thread to moderator Post Follow-up to this message
Old Post
Paul Van Delst
07-30-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:32 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.