|
[Sponsors] |
October 24, 2005, 10:20 |
Fortran Compiler error.
|
#1 |
Guest
Posts: n/a
|
Hi,
I am doing a simulation using a Fortran code where I need to calculate the error function. I use the DERFC function. When I call it, I get the following errors: Error 220 at (192:A.F) : This entity has not been given a type ^ Error 166 at (192:A.F) : Type conformance violation on assignment When I get rid of the 'implicit none' command from the Fortran code, it compiles and works fine. Does anyone know what my problem is? Regards, John. |
|
October 24, 2005, 13:13 |
Re: Fortran Compiler error.
|
#2 |
Guest
Posts: n/a
|
You have not declared the type of something on line 192 (if that is what 192:A.F means). At a guess it is the type of your external function but you have not provided much to go on.
|
|
October 24, 2005, 15:05 |
Re: Fortran Compiler error.
|
#3 |
Guest
Posts: n/a
|
Hi
Yes, Andy is right. You have not declared that particular entity, which it shows in error. You have to declare it. When you switch off IMPLICIT NONE it takes it as real or integer according to whether that particular variable starts with any character from I to N or any other else, and does the function. So, look out for that variable, then see whether its global or local, and accordingly declare it at the proper position. Vinod Dhiman |
|
October 25, 2005, 06:13 |
Re: Fortran Compiler error.
|
#4 |
Guest
Posts: n/a
|
Hi guys,
Thank you borh for your comments. The function is built into fortran though, it is called DERFC and calculates the error function. I don't understand why I need to declare it if it is a function which Fortran has internally. Thanks. |
|
October 25, 2005, 06:32 |
Re: Fortran Compiler error.
|
#5 |
Guest
Posts: n/a
|
Unless you check the other variables on the line in question we do not know that it is the function derfc that has not been declared.
Of course, RTFM will tell you but one thought strikes me: the fortran language will expect you to use the generic function erfc rather than the specific function derfc and omitting the specific declarations would be a good way to indicate this to users. |
|
October 25, 2005, 15:18 |
Re: Fortran Compiler error.
|
#6 |
Guest
Posts: n/a
|
Hi Andy,
I have narrowed the problem down to the DERFC command, I know it is not other variables on the line in question. I woul dnot post a question unless I had established this. John. |
|
October 25, 2005, 18:04 |
Re: Fortran Compiler error.
|
#7 |
Guest
Posts: n/a
|
Is this the GNU intrinsic defined below ?
DErFC: REAL(KIND=2) function. X: REAL(KIND=2); scalar; INTENT(IN). Maybe the KIND of the argument you are passing to DERFC (such as DERFC(x)) is not kind(x)=2. You could check this, or you could just use ERFC: ErFC: REAL function, the `KIND=' value of the type being that of argument X. X: REAL; scalar; INTENT(IN). |
|
October 25, 2005, 21:20 |
Re: Fortran Compiler error.
|
#8 |
Guest
Posts: n/a
|
Can you show us the line of code in question? What does the argument to the function look like, and of what type is the argument? It is important that the argument be of the correct type, and that all argument types (if more than one argument) match, for the specific function.Some compilers may take care of mismatches by type conversion, or simply won't report it, but you should prefer the "picky" compiler that actually tells you that something is wrong here.
As a side note, I don't think the error function erfc is part of the FORTRAN standard (which is not a problem, unless you want your code to be portable.) |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 12:39 |
c++ libraries and solver compiling | vaina74 | OpenFOAM Installation | 13 | February 3, 2012 18:43 |
OpenFOAM install on Ubuntu Natty 11.04 | bkubicek | OpenFOAM | 13 | May 26, 2011 06:48 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |