- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
Version of ifort is 9.1. Iwould like to check the actual parameter list ina subroutine using IARGPTR(). Compiling results in'undefined reference to iargptr_'.Any suggestions?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am nearly 100% certain that this is a documentation error - that routine was supported on DEC's OpenVMS but not on other platforms where the concept doesn't exist. We must have missed removing it from the manual at the move to Intel.
What specfically are you trying to do? Perhaps there's another way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
In fact I'm porting VMS software to linux. I found 'iargptr' aspart of asymbol in the binary file 'fortcom', so my hope was that the documentationwas just lacking some information.
The orignal source uses iargptr to find whichof theparameters are actually set. Then functionality depends on which parameters are set. Of course this could be solved with source modification but if you know some way similar to iargptr please let me know...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, IARGPTR should not be listed in our documentation at all - it is a VMS only routine that depends on the VMS calling conventions. The writers have told me that they have removed this from the next version. You find it in the compiler binary because the same "front end" is shared (still!) with the VMS version and the string for the intrinsic name is there.
You cannot detect how many arguments were passed, since in Windows and Linux, unlike VMS, there is no argument count. The standard way of doing this in Fortran is to give the argument in the called routine the OPTIONAL attribute, make an explicit interface for that routine visible to the caller, and then use the PRESENT intrinsic to ask if the argument was passed.
If you know that the caller "omits" an argument by passing a zero by value, you can (except for assumed-shape arrays and character variables) test to see if %LOC(arg) is zero. This will be unreliable if the caller passes a shortened argument list, though.
- 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
Though non-standard, I have used the following for using default I/O file names and overriding them with parameters:
INFILE = 'file.inp'
OUTFILE = 'file.out'
K = iargc()
if (K < 2) &
write(*,*) " >>>>> WARNING: Usage: its.x [inputfile] [outputfile]"
if (K <= 0) &
write(*,*) " defaulting input to: its.inp"
if (K <= 1) &
write(*,*) " defaulting output to: its.out"
do I = 0, K
call GETARG(I, BUFF)
if (I == 1) then
call GETARG(1, INFILE)
if (INFILE == "") then
call ABORTX("MYPROGRAM")
end if
end if
if (I == 2) then
call GETARG(2, OUTFILE)
if (OUTFILE == "") then
write(*,*) " >>>>> ERROR: CANNOT READ OUTPUT FILE NAME"
call ABORTX("MYPROGRAM")
end if
end if
end do
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page