Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Local variables



David W. Halliday wrote:
>Jan Theron wrote:
>
>> Dear Fortran users
>>
>> I am compiling a 10,000 line F90 code with Absoft and have run into
>> some problems. XLF works fine and handles the makefile without any
>> errors.
>>
>> The compilation involves preprocessing .F file with #include ***.h
>> statements (using cpp), then compiles the .f files. However, the
>> variables defined in the *.h files are not visible to the compiler; it
>> treats any variables pre-defined in the *.h files as local variables
>> in the *.f files and wants them to be re-declared. I even went as far
>> as copying mpif.h, for example,, into multiple include paths to ensure
>> that Absoft sees the file. Are there any flags I can use to overcome
>> this problem?
>>
>> Error messagges:
>> ***********
>> REAL :: tstart,tend
>> ^
>> cf90-1643 f90fe: WARNING DIST_GLOBAL, File = dist_global.f, Line = 32,
>> Column = 16
>> local variable TSTART never referenced.
>
> No problem here: The compiler is simply "warning" you that the
>local variable TSTART has been declared, but is never referenced. (The
>warning is in order to help the programmer catch cases of misspellings,
>especially if IMPLICIT NONE is /not/ in effect.)
>
>> ***********
>> & MAPS,JMAP(IMAP),KMAP(IMAP),LMAP(IMAP),
>> ^
>> cf90-232 f90fe: ERROR DRNBDY, File = drnbdy.f, Line = 260, Column = 34
>> IMPLICIT NONE is specified in the local scope, therefore an explicit
>> type must be specified for function "JMAP".
>
> This looks like it's a continuation line, so, in order to help here
>we will need to see the preceding lines. However, it appears that
>somehow the compiler is seeing JMAP(IMAP) as a function invocation, or
>some such. Perhaps, due to compiler flags (including implicit
>flags/default settings), the compiler isn't seeing this as a
>continuation line?
>

The times when I have seen this error in the context you describe, there
was a function of the same name that had already been linked in. I don't
remember the details but it could happen with certain intrinsics or if
you inadvertently have created more than one thing using that name.
Regardless, the simplest fix was always to rename my function/variable to dodge
the conflict. Conversely, if you rename the item and the error goes away,
you know there is a name conflict and can do whatever fix you like for
the permanent solution.


>> ***********
>>
>>
>>
>> F90 flags:
>> ***********
>> -s -YEXT_NAMES=LCS -YEXT_SFX=_ -YDEALLOC=CACHE -altivec
>> ***********
>>
>> Thanks
>>
>>
>> Dr. Johannes N. Theron
>> ...

--

Tim

Intellectuals solve problems: geniuses prevent them. -Albert Einstein,
physicist, Nobel laureate (1879-1955)
_______________________________________________
fortran-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/fortran-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Local variables (From: "Jan Theron" <email@hidden>)
 >Re: Local variables (From: "David W. Halliday" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.