Fortran Compiler Terminology: Dummy Variables and Attributes -


Can anyone explain to me that there is a dummy variable or feature in the parser / compiler? Pure (former)> Pure Synthesis F (X, Y) Actual, IntOUT :: X, Y, CC Real: A, BC Real, SAVE :: C = 3.14E0 parameter (C) = 3.14) E0, X = 32, Y = X) X = Y + 2 * SIN (Y) END


  cetin @ unique: ~ / lab / secret / Tapenade $ gafforan-xf 77-c 1.f 1.f: 6.37: parameter (c = 3.14E, x = 32, y = x) 1 error: in the parameter 'x' (1) 1.f Conflict with dummy characteristic: 3.38: Real, INTENT (INOUT) :: X, Y, C1 Error: Symbol (1) is not a dummy variable  

  cetin @ unique: ~ / lab / secret / tapenade $ ifort -c 1.f 1.f (3): error # 6451: a dummy logic n ame is required in this context [c] real, intent (INOUT ) :: X, Y, C ---------------------------------- --- ^ 1.F ( 6): Error # 6406: Multiple declarations of anti attributes or names. [X] parameter (c = 3.14E, x = 32, y = x) ------------------------------- ^ 1.F (6): Error # 6406: Multiple declarations of anti attributes or names. [Y] parameter (C = 3.14E, X = 32, Y = X) ------------------------------- - ------- ^ 1.f (6): Error # 6592: This symbol should be the argument of a defined parameter, a calculator, or an investigation function which evaluates for compile-time constants [x] Parameter (C = 3.14E, X = 32, Y = X) ---------------------------------  > 

Fortran passes through context. The dummy attribute corresponds to those variables that are passed in the function (in X and Y in your case). The parameter description is expected to be somewhat stable, but since it is passed in the X function, it does not really mean any kind since. There is a way to set the parameter statement constants - it has nothing with any sub-routine parameters.

When you get an error saying that C is not a dummy variable, then, that means they do not search in the list of variables The functions that will be passed through / in the - Your announcement is only F (x, y) : no c in sight though you dummy Are not explicitly using the attribute, you have the INTENT (INOUT) attribute, which means that these variables are consistent with the subroutine input / output.

To achieve whatever you want, you have a substrate that looks like this:

  Suburban F (X, Y) None is contained! These dummy variables are real, intro (out) :: X, Y! These substrines are variables in the real real :: A, B real, parameter, save :: c = 3.14E0x = y + 2 * sin (y) and substrin f  

me full Not sure what you are trying to do - you're announcing the net suburban word, which means without a side effect, a subarroutine, but you intent (inout) Is using for your variable, which means that X and y can be changed during execution.

By submitting a variable in the declaration declaration of a sub method, REAL :: C = 3.14E0 , contained save < Generates a variable with / code> attribute If you want to save it from call to call, you have done the right thing by clearly adding the save attribute to make it clear that you are doing.

I am not a parser / compiler, but I think that to answer your question, dummy attribute means that you are getting only one indicator - You do not need any allocation space, because the variable used in the function call already has allocated space.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -