From j.s.morgan@liverpool.ac.uk  Wed Mar 29 13:04:31 2000
Received: from mailhub1.liv.ac.uk (mailhub1.liv.ac.uk [138.253.100.94])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id NAA20808
	for <SC22WG5@dkuug.dk>; Wed, 29 Mar 2000 13:04:29 +0200 (CEST)
	(envelope-from j.s.morgan@liverpool.ac.uk)
Received: from pcmail1.liv.ac.uk ([138.253.252.13])
	by mailhub1.liv.ac.uk with esmtp (Exim 2.12 #1)
	id 12aGGo-0003OA-00; Wed, 29 Mar 2000 11:04:19 +0000
Received: from [138.253.102.198] (helo=pc102198.liv.ac.uk)
	by pcmail1.liv.ac.uk with smtp (Exim 2.12 #1)
	id 12aGGn-0005IX-00; Wed, 29 Mar 2000 12:04:17 +0100
From: Steve Morgan <J.S.Morgan@liverpool.ac.uk>
Reply-To: J.S.Morgan@liverpool.ac.uk
To: Phillip Helbig <helbig@man.ac.uk>
Cc: SC22WG5@dkuug.dk
Subject: Re: (SC22WG5.1737) Interpretation 001
In-Reply-To: <200003291018.MAA20681@dkuug.dk>
Message-ID: <SIMEON.10003291217.D@pc102198.liverpool.ac.uk>
Date: Wed, 29 Mar 2000 12:04:17 +0100 (GMT Daylight Time)
Priority: NORMAL
X-Mailer: Simeon for Win32 Version 4.1.5 Build (43)
X-Authentication: IMSP
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

Phillip,

Thanks for your mail. I've commented below.

Steve.

On Wed, 29 Mar 2000 12:17:46 +0100 Phillip Helbig 
<helbig@man.ac.uk> wrote:

> > However, I tried the following code on 4 compilers 
> > (Salford, NAS, Sun's F90 and NAG's F90) and they all assume 
> > that the variable j in the implied DO creates the variable 
> > j. Each gives an error message for the  
> > INTEGER::j statement indicating that j has already been 
> > defined in the scope i.e. it has been exported from the 
> > module.
> 
> I assume that they print the value 11 for j?
>

No, they all failed to compile!

 
> > Module mod1
> 
> Compaq Fortran does this:
> 
> *ex
> DISK$SCRATCH:[HELBIG]TEST.F90;1 15 lines
> 
> $ type test.f90
> Module mod1
> 
> INTEGER :: A(10)=(/(j,j=1,10)/)
> 
> End Module mod1
> 
> Program prog1
> 
> USE mod1
> INTEGER :: j
> 
> PRINT *, "j = ",j
> 
> End Program
> 
> $ fortran test
> $ link test
> $ r test
> j =            0
> $
> 
> Full checking:
> 
> $ fortran test/standard=f95
> 
> no errors.
> 
> I assume this is the correct behaviour?
>

Yes, as long as j is initialised (by the compiler) to zero 
but the important point, of course, is that j is not 
exported from the module.

 
> XLF90 also prints j = 0.

---------------------------------------------------------------------
Dr. J. S. Morgan                Tel. 0151-794-3746 (3719 for messages)
Computing Services Department   Fax. 0151-794-3759
The University of Liverpool     email. J.S.Morgan @ liverpool.ac.uk
Chadwick Building
Peach Street
Liverpool L69 7ZF
---------------------------------------------------------------------

