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

wrong output from a variable (newbie question)
Hi there;
Using Compaq Visual Fortran
I am using a programme, which has a main file and few other subs.
files. There is a variable NSL which is calculated within Sub. NC.f90.
File Ory.f90 has access to this variable (NSL) too. Now when I add NSL
to output part of NC.f90, as to get it in output file, the output data
from NSL is quite ok. Now if I add NSL to output part of ORY.f90, then
results are wrong.

Whichever of above I use, the main programe produced wrong output data
for NSL, exactly like when I use NSL as output in ORY.f90.

Any help, comment and suggestions?
Thanks
Darius


Report this thread to moderator Post Follow-up to this message
Old Post
Darius
05-24-05 08:57 AM


Re: wrong output from a variable (newbie question)
Hi Darius,

Darius wrote:

> Hi there;
> Using Compaq Visual Fortran
> I am using a programme, which has a main file and few other subs.
> files. There is a variable NSL which is calculated within Sub. NC.f90.
> File Ory.f90 has access to this variable (NSL) too. Now when I add NSL
> to output part of NC.f90, as to get it in output file, the output data
> from NSL is quite ok. Now if I add NSL to output part of ORY.f90, then
> results are wrong.
>
> Whichever of above I use, the main programe produced wrong output data
> for NSL, exactly like when I use NSL as output in ORY.f90.
>
> Any help, comment and suggestions?

Not really enough information to say too much here, but my guess would
be inconsistent declaration of NSL somewhere, e.g. by argument mismatch.

Would it be possible to post a cut down version to show what you are doing ?

Ian



Report this thread to moderator Post Follow-up to this message
Old Post
Ian Bush
05-24-05 01:57 PM


Re: wrong output from a variable (newbie question)
In article <1116911197.020746.122480@g47g2000cwa.googlegroups.com>,
"Darius" <dariush2003jp@yahoo.com> wrote:

> Ory.f90 has access to this variable (NSL) too.

This doesn't mean anything. I might be able to make some guesses as to
what you really mean, but that doesn't seem constructive. Your problems
sound a lot as though the code are having trouble with communicating the
variable. The above description of how it is communicated makes no
sense. I suspect that these matters are correlated - that is you
misunderstand something about the communication mechanisms.

It is no great crime to misunderstanding something. We can help with
that; makes us feel useful. But we need more data. How about some
Fortran code instead of just words?

Reasons that the above makes no sense, by the way:

1. Files don't access variables at all. Files aren't even relevant to
the Fortran language. Procedures are important, but files are not. The
difference matters; if you are  about it, that could be part of
the problem.

2. There are numerous ways that one procedure can "access" variables
from another. You present no clue which of those numerous ways you are
referring to. The different ways have different possible errors. There
are COMMON, modules, argument lists, and host association, for a start.
Or maybe you are talking about something that wouldn't actually achieve
such access at all (such as including a file with the same declarations).

--
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain

Report this thread to moderator Post Follow-up to this message
Old Post
Richard E Maine
05-24-05 08:59 PM


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 10:20 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.