Re: combine SPAWN and SPAWN_MULTIPLE (fwd)

Rolf Rabenseifner (Rabenseifner@RUS.Uni-Stuttgart.DE)
Tue, 30 Apr 1996 17:39:06 +0100 (DST)

Hi,

this is a mail to all vendors in this group.

My questions:
- Does your compiler can run the code below correctly?
- And without issuing warnings?

The background:
---------------

answer:
>>
>> I tested the following example - but I have no Fortran 77 standard
>> document to decide if the argument is definitely false.
>>
>> program char_array
>> character*7 s, c(5)
>> s = 'string-xyz'
>> c(1)='array-abcdefghijkl'
>> c(2)='array-x'
>> c(3)='array-y'
>> c(4)='array-z'
>> c(5)='array-============'
>> call sub('abcd',1)
>> call sub(s,1)
>> call sub(c,5)
>> stop
>> end
>>
>> subroutine sub(c,n)
>> character*(*) c(*)
>> integer n
>> write(*,*) 'sub',n
>> do 1, i=1,n
>>C write(*,*) len(c),len(c(i)),' -> ',c(i)
write(*,*) len(c(i)),' -> ',c(i)
>> 1 continue
>> return
>> end
>>
>> Is this example correct in Fortran 77?
>>
>> Can someone answer this question?
>
> This is the advice I got from a colleague (Ian Hounam):
>
> The ANSI Fortran standard requires array dummy arguments to be
> associated with an array or array element (section 15.9.3.3).
> If you fix the illegal call to LEN in SUB, nag_pfort (the NAG
> f77 standard verifier) produces the following message:
(Okay "len(c)" is wrong.)
>
> Error: Wrong structure for argument C (no. 1) in ref to SUB in CHAR_ARRAY
>
> Although this is illegal, it should not give problems with most modern
> compilers.
>
> Vince
>
>--
>K. V. Fernando
>Numerical Algorithms Group Ltd
>Jordan Hill
>Oxford OX2 8DR
>UK
>
>phone: + 44 1865 511245
>fax : + 44 1865 310139
>email: vince@nag.co.uk

Normally -- I'm looking at the "choice" arguments -- we do not
care about such details in the hope that all compilers make
no problem.

With "choice" we had a problem at Cray.

Therefore my question to all vendors:
Does your compiler can run the code above correctly?

And to Vince:
Is section 15.9.3.3 discribing all arrays or only string-arrays?

Rolf


Rolf Rabenseifner (Computer Center )
Rechenzentrum Universitaet Stuttgart (University of Stuttgart)
Allmandring 30 Phone: ++49 711 6855530
D-70550 Stuttgart 80 FAX: ++49 711 6787626
Germany rabenseifner@rus.uni-stuttgart.de