- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I try to compile a F90-Code with the Visual Fortran Composer XE 2011, which worked quiet fine in the Compaq visual fortran environment.
The compiler error I get is
> error #7938: Character length argument mismatch
when executing for example the following code-fragment
[bash] CALL LINE ('M2',) SUBROUTINE LINE (NAME,) CHARACTER NAME*8 END SUBROUTINE [/bash]
So a shorter string as expected is passed to the subroutine. Unfortunately this programming-style is used very often in my big project. I changed the Compiler options
(>Fortran>Run-Time) Check Array and String Bound to No
(>Fortran>Diagnostics) Check Routine Interfaces to No
without any success.
Related problems were discussed in:
http://software.intel.com/en-us/blogs/2009/03/31/doctor-fortran-in-ive-come-here-for-an-argument
http://software.intel.com/en-us/forums/showthread.php?t=64550&wapkw=%28error+%237938%29
Maybe someone has an idea?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your old code does similar things, you should fix it. If it only has incorrect declarations, on the other hand, just don't allow the compiler to check for consistency between actual and dummy argument lists.
Consider the following example.
[fortran]subroutine pmsg(str) character*8 :: str str(5:5)='X' write(*,*)str return end subroutine pmsg program tst call pmsg('XY') end program tst [/fortran]The behavior of the program is unpredictable, as you can see from the following runs.
S:\> ifort strng.f90
S:\> strng
XY 8
S:\> ifort /debug strng.f90
S:\> strng
forrtl: severe (157): Program Exception - access violation
S:\> ifort /warn strng.f90
S:\> strng
strng.f90(9): error #7938: Character length argument mismatch. ['XY']
Which of these behaviors would you find acceptable with your large program?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Effectively, it was a common source of problems in CVF.
The best solution is to replace all fixed lengths declarations for character arguments in functions and subroutines.
So change
CHARACTERNAME*8
to
CHARACTERNAME*(*)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
next problem: Same project and the error is:
fatal error LNK1104: cant open "dformd.lib" LINK
We use subroutines like
CALL DATE_AND_TIME ( date, time)
which as far as I know are included through
USE DFLIB
How can I solve this link-problems with VisualStudio and the Intel Compiler?
I found a related thread:
http://software.intel.com/en-us/forums/showthread.php?t=42445
but I dont know how to handle with these files. Sorry, I am uncertain in such cases.
Additionally I read about newer libraries in:
http://www.adras.com/Graphics-Lib-Help.t2416-142.html
Do I need the discussed libraries IFQWIN, IFCORE and IFPORT?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using specific extensions of the Compaq compiler, you will should find the CVF to ifort conversion document useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We cannot answer this question, since we do not know what is in your code.
It is possible that your sources have unneeded USE statements that were put in as a stop-gap. If so, the linker will as for those libraries not to satisfy needed externals, as is common, but simply to honor directives to link those libraries.
If that is the case, you can use the /NODEFAULTLIB:dformd.lib linker option. If the linking goes through, you then know that any USE statements that correspond to that library are superfluous, and so on.
You can also dump the symbol tables of the .OBJ files to see which ones call for CVF libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page