CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Fortran Compiler error.

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 24, 2005, 09:20
Default Fortran Compiler error.
  #1
John.
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.
  Reply With Quote

Old   October 24, 2005, 12:13
Default Re: Fortran Compiler error.
  #2
andy
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.

  Reply With Quote

Old   October 24, 2005, 14:05
Default Re: Fortran Compiler error.
  #3
Vinod Dhiman
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
  Reply With Quote

Old   October 25, 2005, 05:13
Default Re: Fortran Compiler error.
  #4
John.
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.
  Reply With Quote

Old   October 25, 2005, 05:32
Default Re: Fortran Compiler error.
  #5
andy
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.

  Reply With Quote

Old   October 25, 2005, 14:18
Default Re: Fortran Compiler error.
  #6
John.
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.
  Reply With Quote

Old   October 25, 2005, 17:04
Default Re: Fortran Compiler error.
  #7
Jeff Moder
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).

  Reply With Quote

Old   October 25, 2005, 20:20
Default Re: Fortran Compiler error.
  #8
Mani
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.)
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Native ParaView Reader Bugs tj22 OpenFOAM Paraview & paraFoam 267 July 20, 2015 22:29
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 05:48
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31


All times are GMT -4. The time now is 18:02.