Re: Optional arguments (again) on Sun



Hi,

There is an explicit prohibition on the dim= variable
being an optional dummy argument. Try something like this:

if( present( opt1) )then
local_opt1 = opt1
endif

if( present( opt1) )then
... sum( ... , dim= local_opt1)
else
... sum( ... )
endif

Modify to suit.

Salvatore wrote:
Hi there,
A colleague who has access to a Sun machine has tried out some codes
of mine, and we're stuck on a compile error I can't figure out, given
the discussion on this newsgroup a couple of days ago.

I created a small sample I am attaching, ad he's getting the
following:
----------------------- compile log ---------------

ires = size(a1,dim=opt1)
^
"tv2.f90", Line = 5, Column = 22: ERROR: This actual argument must not
be an optional dummy argument.

f90: COMPILE TIME 0.050000 SECONDS
f90: MAXIMUM FIELD LENGTH 5025462 DECIMAL WORDS
f90: 6 SOURCE LINES
f90: 1 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI

-------------------------------------------- tv2.f90 ----------------
subroutine checkv(ires,a1,opt1)
integer :: a1(:,:)
integer, optional :: opt1

ires = size(a1,dim=opt1)
end subroutine checkv
----------------------------------------------------------------------

Thoughts anybody?
Thanks in advance
Salvatore Filippone



--
Cheers!

Dan Nagle
Purple Sage Computing Solutions, Inc.
.