- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to move an existing fortran application to a 64-bit processor. I am running Fortran 10.1.021. When trying to compile a subroutine that has worked well for umteen years, I get these error messages which I do not understand.
My code looks something like:
--------------------------------------------------------------------------------------------
SUBROUTINE TABOUT()
CHARACTER*4 LINEA(33)
INTEGER*4 NTL
.....
CALL CENTER(LINEA, NTL)
......
END
SUBROUTINE CENTER(STRING, LENGTH)
CHARACTER*132 STRING
.....
------------------------------------------------------------------------------
With this, I get the error message:
H:Model(line) Error: Character length argument mismatch [LINEA]
H:Model(line) Error: The shape mismatching rules of actual arguments and dummy arguments have been violated. [LINEA]
I am at a loss. Any assistence will be appreciated. Note that theoffending array in the source routine and the subroutine are the same size. Both arrayshave been explicitly types INTEGER*4.Finally, I tried converting the arrays into equivalent Integer*4 arrays. Yet no luck; I continue to see this sameerrror message.
Thanks in Advance.
Jim
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could say the error checking is pedantic, if you don't care about using standard Fortran or running on a platform other than those supported by Intel. If you do care, you could turn CENTER into a MODULEor CONTAINS function, and so avoid a conflicting 2nd declaration of the character string. I'm assuming you didn't like the f77 standard options.
INTEGER*4 also is a potential conflict with INTEGER, depending on which options you pass to ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thankyou for your quick reply.
I had to look it up; "pedantic" is the perfect word describing INTEL's error checking.
I just want to get my program to run on this Intel platform; I dont really care if my code is "standard" That said, I looked into converting my CENTER subroutine into a CONTAINS function. This (i dont think) works as my CENTER subroutine is called from multiple subroutines. These other subroutines give the same error messages as I originally listed.
I am afraid of turning on, globally, the F77 standards as my application is wrought with non-standard stuff. Could I compile these subroutines only under the F77option??
So, what has got this particular version of Intel Fortran so bollixed up? (My code runs fine on CVF). And how do I fix it??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This error can be devastating if the passed argument is not large enough.
The other error is that you are passing a whole array to an argument declared as a scalar. That too is illegal in all revisions of Fortran.
If you want the compiler to ignore the error, go into the Diagnostics property page and turn off "Check routine interfaces" and "Generate interface blocks". You will place yourself at risk of not being notifiied of other, more serious errors. Another solution would be to declare a CHARACTER*132 variable, EQUIVALENCE it to LINEA and pass that instead.
In most cases, declaring a character dummy argument with an explicit length is a mistake. Last week I heard a Fortran standards committee member argue that all compilers should complain about this usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your CHARACTER*132 variable, and EQUIVALENCE statement suggestion did the trick.
Many Thanks.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page