Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageHi 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
Post Follow-up to this messageIn 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 areabout 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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.