- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Calling code:
I__ = FWriteF(OutFile, 'My string is %s'//Char(0), MyString, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Function definition (in another library file):
Integer Function FWriteF(File,Format,
& Arg1, Arg2, Arg3, Arg4,
& Arg5, Arg6, Arg7, Arg8,
& Arg9, Arg10, Arg11, Arg12,
& Arg13, Arg14, Arg15, Arg16)
Implicit None
Integer File
Character(LEN=*) :: Format
! Character Format(*)
Character Format(*) passes compilation, but raises a run-time error because "the 2nd argument is an array but value actually passed is a scalar".
When I do Character(LEN=*) :: Format; compilation fails as below:
ifc -c c_formoutput.F -I/sandbox/linux/include -Dunix -Dlinux -Vaxlib -I../../src -I../../../af/src -I../../../cmn/src -132 -g -w -C -O0 -fPIC -o ../../../build/obj/debug/linux/mydir/c_formoutput.o
external function FWRITEF
*Compiler Internal Error* : Please report to Intel Corporation
compilation aborted for c_formoutput.F (code 1)
Upgrading to 8.x is not an option for me; but any pointers on how to resolve this?
Character Format(*) works fine with Sun Workshop Pro and IBM VisualAge Fortran compilers. In fact, in those compilers, it is not even required to put in all those zeroes in the function call to make the argument numbers match.
2nd question -- any easy way in Fortran77 to make variable function arguments like in C?
I__ = FWriteF(OutFile, 'My string is %s'//Char(0), MyString, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Function definition (in another library file):
Integer Function FWriteF(File,Format,
& Arg1, Arg2, Arg3, Arg4,
& Arg5, Arg6, Arg7, Arg8,
& Arg9, Arg10, Arg11, Arg12,
& Arg13, Arg14, Arg15, Arg16)
Implicit None
Integer File
Character(LEN=*) :: Format
! Character Format(*)
Character Format(*) passes compilation, but raises a run-time error because "the 2nd argument is an array but value actually passed is a scalar".
When I do Character(LEN=*) :: Format; compilation fails as below:
ifc -c c_formoutput.F -I/sandbox/linux/include -Dunix -Dlinux -Vaxlib -I../../src -I../../../af/src -I../../../cmn/src -132 -g -w -C -O0 -fPIC -o ../../../build/obj/debug/linux/mydir/c_formoutput.o
external function FWRITEF
*Compiler Internal Error* : Please report to Intel Corporation
compilation aborted for c_formoutput.F (code 1)
Upgrading to 8.x is not an option for me; but any pointers on how to resolve this?
Character Format(*) works fine with Sun Workshop Pro and IBM VisualAge Fortran compilers. In fact, in those compilers, it is not even required to put in all those zeroes in the function call to make the argument numbers match.
2nd question -- any easy way in Fortran77 to make variable function arguments like in C?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Never mind. There were calls like Format(i) that I had to change to Format(i:i).
Quick question -- isn't Format a reserved word? I am surprised that this works.
Quick question -- isn't Format a reserved word? I am surprised that this works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fortran has no reserved words.

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