! ! $Id: rset.f,v 1.1 2000/02/15 01:57:21 aai Exp aai $. ! !{ subroutine rset(n,c,x) integer n real c real x(n) ! ! Rset: Set the elements of a REAL array to a known value. ! This version differs from the Fortran 77 version by replacing ! an explicit DO loop with vector notation. The theory is that ! vector storage instruction(s) will be compiled to accomplish ! the task when the Fortran 90 notation is used. ! ! In fact, the Fortran optimizer is likely going to generate a ! vector store on a vector platform regardless of the construct ! used. ! ! A check to assure that n is positive non-zero is included since ! a vector store might possibly be compiled which does not check. ! In other words, it's a good idea to leave nothing to chance when ! exploiting speed related hardware features. ! ! ! Usage: n The number of elements in the array to be set. ! c The value to which the elements are to be set. ! x The array to be initialized. ! ! Phillip A. Cheeseman, Purdue University Computing Center. ! if(n.gt.0) x(1:n) = c ! return ! end !}