Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

compiler problems with DFLIB.F90

Intel_C_Intel
Employee
1,797 Views
I am updating a code originally written in Fortran77 for Fortran90/95 using Compaq Visual Fortran 6.6 on Windows XP with Win32 platform. The code is pretty substantial and compiles expect for one subroutine that uses Graphics routines. I have specified that the project type is Fortran Standard Graphics and the necessary library options and include file paths. I also have the USE DFLIB statement right after the SUBROUTINE statement. When I compile the code I get an error stating "Error: The procedure name of the INTERFACE block conflicts with a name in the encompassing scoping unit" and occurs for everything defined in the DFLIB.F90 file in the Microsoft Visual StudioDF98Include folder. I then used ONLY option to specificy only the functions I was using (like SETTEXTWIDOW, SETVIEWPORT, MOVETO_W, etc) but get the same result for those functions. Not sure what's going on here. Suggestions?

Thanks,

Amy
0 Kudos
7 Replies
Steven_L_Intel1
Employee
1,797 Views

Amy,

It's hard to know for sure without seeing the code. My guess is that the subroutine where you're having problems is a contained routine in another routine or module and that you have somehow declared these routines in the outer scope. If it was done with a USE DFLIB that should be ok, but if somehow else, that might not be.

You do understand that CVF 6.6 is out of production and unsupported?

0 Kudos
ajw283
Beginner
1,797 Views
Steve,

The subroutine GRAPH (that I'm having problems with) is contained within another routine. There are in fact many subroutines that are called within the major routine. I declare USE DFLIB at the beginning of the subroutine GRAPH and not at the very beginning of the code. As I understand it that should be sufficient in order to use functions from the quickwin library as long as you have declared the project as as Fortran Quickwin or Fortran Standard Graphics type. I have attached the subroutine GRAPH as a zip file. By the way, I am aware that CVF 6.6 is out of production and unsupported but my advisor doesn't seem to think we need to update yet.

Thanks,

Amy


0 Kudos
Steven_L_Intel1
Employee
1,797 Views

Amy,

Comment out the INCLUDE 'FGRAPH.FD'. This is an older way of doing what USE DFLIB does, and the two conflict.

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,797 Views
I didn't check the code thoroughly, but my eyes stopped right at
INCLUDE 'FGRAPH.FD'
line. I presumed something similar was the case -- basically, you're probably declaring the INTERFACE twice -- once through USE DFLIB (which is allowed) and once through INCLUDE (which acts like a text substitution, ergo you have a "local" INTERFACE and a USEd interface). Get rid of those INCLUDE lines, and you should be OK.
0 Kudos
ajw283
Beginner
1,797 Views
Thanks, that solved the problem. While I'm at it, though, there are a couple other things I'm having problems with. All the MOVETO_W calls give an error "Error: The type of the actual argument differs from the type of the dummy argumen" for the first two arguments. All of the first two arguments are of type REAL and the same size (and greater than 8) though. Also the SETTEXTPOSITION calls give an error "Error: There is no matching specific subroutine for this generic subroutine call," so is it not finding that function in the quickwin library? The STATUS = LINETO_W and other similar statements don't have any errors.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,797 Views
Regarding SetTextPosition: You have array HORZ2 declared as REAL, but you use it as an integer. You probably want to change its type.

Regarding MOVETO_W/LINETO_W: their arguments are REAL(8) (i.e. DOUBLE PRECISION), so you should go through the code and change the declarations. As for LINETO_W, its arguments are also REAL(8) -- perhaps the compiler doesn't issue outright error because it's a FUNCTION? I'd expect the error message like:

"WARNING: The function arguments do not match the prototype; assume EXTERNAL (LINETO_W)"

which you certainly don't want (you'll get a linker error later on).
0 Kudos
ajw283
Beginner
1,797 Views
The corrections are made and the code runs great. Thanks for the help.
0 Kudos
Reply