Print

Print


   	Date: Wed, 12 Jan 2000 14:24:42 -0500
   	Original-Sender: Michael Metcalf <[log in to unmask]>
   	MIME-Version: 1.0
   	Content-Disposition: inline
   	Content-Transfer-Encoding: 8bit
   	X-MIME-Autoconverted: from quoted-printable to 8bit by 
naga.mailbase.ac.uk id TAA00885
   	Subject: Qustion on the WHERE statement
   	From: Michael Metcalf <[log in to unmask]>
   	To: "Rector, David" <[log in to unmask]>
   	Cc: "[log in to unmask]" <[log in to unmask]>
   	X-List: [log in to unmask]
   	X-Unsub: To leave, send text 'leave comp-fortran-90' to 
[log in to unmask]
   	X-List-Unsubscribe: 
<mailto:[log in to unmask]>
   	Content-Transfer-Encoding: 8bit
   	
   	
   	where (ltest(1:nx,1:ny,1:nz)) a(1:nx,1:ny,1:nz) = b(1:nx,1:ny,1:nz) +
   	c(1:nx,1:ny,1:nz)
   	
   	is the only way to do it. The logical array expression and the array
   	variables  must all be conformable (of the same rank and shape). See 
also
   	"Fortran 90/95 Explained", section 6.8.
   	
   	Regards,
   	
   	Mike Metcalf

Note that for Fortran 95 compilers, or any Fortran compiler supporting
the FORALL statement, this array assignment can also be expressed as

  forall (i=1:nx,j=1:ny,k=1:nz, ltest(i,j,k)) a(i,j,k) = b(i,j,k) + c(i,j,k) 
	
allowing you to express the range of subscripts in each dimension only once,
but requiring the use of explicit index variables such as i, j, k. 




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%