- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CALL SUB(0.0)
END
SUBROUTINE SUB(F)
REAL(8) F,D
D=F
END
Not a big deal as I had only 4 instances and changed them to sue 0D0 to be safe but it was surprising.
Normally, I don't have check interfaces on for release mode, so I hadn't noticed it before. The real question is, did the compiler extend the constants in other areas for release and debug mode, and did it in fact do so for the call?
subroutine
Link Copied
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot see any sample in this thread other than the short program shown in-line in #0.
That one is special since zero has a special representation -- all zero bits in single and double precision. Therefore, an argument or a function value of zero is tolerant to mismatches between REAL*4 and REAL*8 arguments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, that's the smallest example, which you always ask for, to demo the problem. The warn interfacesoption complains when fpconstant is set, but only in release mode. Here's another with a non-zero:
SUBROUTINE TEST
call sub (0.0)call sub (1.2)
end
subroutine sub(f)
real(8) f,d
d=f
end
D:\Projects\MicrOsiris\PGMS\TEST.F90(6): error #6633: The type of the actual argument differs from the type of the dummy argument. [0.0]
D:\Projects\MicrOsiris\PGMS\TEST.F90(7): error #6633: The type of the actual argument differs from the type of the dummy argument. [1.2]
compilation aborted for D:\Projects\MicrOsiris\PGMS\TEST.F90 (code 1)
And yes, fpconstant specified.
These errors do not appear in debug mode.
- 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
This is way to much trouble for what I thought was a heads up on an erroneous error message. It is not a problem for me since the code is correct, and I guess you're sure the fpconstant is correct with the interface warning as well.
------ Build started: Project: MicrOsiris, Configuration: Debug|Win32 ------
Compiling with Intel Visual Fortran Compiler XE 12.1.1.258 [IA-32]...
TEST.F90
Build log written to "file://D:\Projects\MicrOsiris\Debug\BuildLog.htm"
MicrOsiris - 0 error(s), 0 warning(s)
---------------------- Done ----------------------
------ Build started: Project: MicrOsiris, Configuration: Release|Win32 ------
Compiling with Intel Visual Fortran Compiler XE 12.1.1.258 [IA-32]...
TEST.F90
D:\Projects\MicrOsiris\PGMS\TEST.F90(3): error #6633: The type of the actual argument differs from the type of the dummy argument. [0.0]
D:\Projects\MicrOsiris\PGMS\TEST.F90(4): error #6633: The type of the actual argument differs from the type of the dummy argument. [1.2]
compilation aborted for D:\Projects\MicrOsiris\PGMS\TEST.F90 (code 1)
Build log written to "file://D:\Projects\MicrOsiris\Release\BuildLog.htm"
MicrOsiris - 3 error(s), 0 warning(s)
---------------------- Done ----------------------
Options for diagostics are
Yes (/warn:declarations)
Yes (/warn:unused)
Yes (/warn:ignore_loc)
Yes (/warn:truncated_source)
Yes (/warn:uncalled)
Yes (/warn:interfaces)
Fortran 2003 (/stand:f03)
- 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
Compiling with Intel Visual Fortran Compiler XE 12.1.1.258 [IA-32]...
ifort /nologo /O3 /Ob0 /heap-arrays0 /Qipo /I"D:\PROJECTS\MICROSIRIS\INCLUDE" /arch:SSE3 /extend_source:132 /noaltparam /standard-semantics /stand:f03 /Qopenmp-report0 /Qpar-report0 /Qvec-report0 /Qdiag-disable:5268,5142,7416,8290,8291 /warn:declarations /warn:unused /warn:ignore_loc /warn:truncated_source /warn:uncalled /warn:interfaces /Qauto_scalar /fpe:1 /fp:strict /fpconstant /module:"Release/" /object:"Release/" /Fd"Release\vc100.pdb" /check:none /libs:qwin /c /Qvc10 /Qlocation,link,"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\\bin" "D:\Projects\MicrOsiris\PGMS\TEST.F90"
D:\Projects\MicrOsiris\PGMS\TEST.F90(3): error #6633: The type of the actual argument differs from the type of the dummy argument. [0.0]
call sub (0.0)
----------------^
D:\Projects\MicrOsiris\PGMS\TEST.F90(4): error #6633: The type of the actual argument differs from the type of the dummy argument. [1.2]
call sub (1.2)
----------------^
compilation aborted for D:\Projects\MicrOsiris\PGMS\TEST.F90 (code 1)
MicrOsiris - 3 error(s), 0 warning(s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without that I think the error messages are quite valid. I get them here compiling the example in #5 with /warn:all and other debug options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The purpose of this option is to maintain compatibility for pre-F90 code that did something like this:
double precision pi
pi = 3.1415926535897
Many F77 compilers, including DEC's, would keep all the digits in its internal conversion, and then convert down on the assignment. Fortran 90 doesn't allow that - the above is a "default real kind" constant and extra digits are thrown away. We gave you /fpconstant to get the old behavior. But it doesn't make such constants double precision when passing as arguments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I do want to thank Stevefor solving the mystery. It'sstrange the debug version didn't catch it, but I know what I have to do now.
Compiling with Intel Visual Fortran Compiler XE 12.1.1.258 [IA-32]...
ifort /nologo /debug:full /Od /I"D:PROJECTSMICROSIRISINCLUDE" /arch:SSE3 /noaltparam /standard-semantics /stand:f03 /Qopenmp-report0 /Qpar-report0 /Qvec-report0 /Qdiag-disable:5142,7416,8290,8291,7410,6009,6463,6135 /warn:declarations /warn:unused /warn:ignore_loc /warn:uncalled /warn:interfaces /real_size:64 /Qauto /Qtrapuv /Qzero /fpconstant /module:"Debug/" /object:"Debug/" /Fd"Debugvc100.pdb" /traceback /check:pointer /check:bounds /check:uninit /libs:qwin /dbglibs /Qmkl:sequential /c /Qvc10 /Qlocation,link,"c:Program Files (x86)Microsoft Visual Studio 10.0VC\bin" "D:ProjectsMicrOsirisPGMSTEST.F90"
MicrOsiris - 0 error(s), 0 warning(s)

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