Re: Windows gfortran binaries
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Thu, 15 Mar 2007 13:17:02 -0700
Beliavsky <beliavsky@xxxxxxx> wrote:
On Mar 15, 2:11 pm, Ken Fairfield <K...@xxxxxxxxxxxxxxxxxxxxx> wrote:
....character (len=1), parameter :: letters(2) = (/"a","b"/)
....integer, intent(in) :: ivec(:)
write (*,*) "a" // letters(ivec)
...Is "letters(ivec)" standard-conforming?
Yes, letters(ivec) is standard-conforming -- it is an example of a
"vector subscript", a very useful feature introduced in Fortran 90.
In addition to letters(ivec) being a vector subscript, there is one
other thing going on here that might not be obvious to some (but is fine
and standard-conforming).
Because letters(ivec) is an array, the concatenation here is an
elemental operation. Suppose, by way of example, that ivec=[1,2,2], so
that letters(ivec)=["a","b","b"]. The concatenation does *NOT*
concatenate the elements of the array together. Instead, it elementally
concatenates the scalar "a" with each element of the array. Thus
"a"//letters(ivec) evaluates to the array ["aa","ab","ab"].
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Windows gfortran binaries
- From: Brooks Moses
- Re: Windows gfortran binaries
- References:
- Windows gfortran binaries
- From: FX
- Re: Windows gfortran binaries
- From: Beliavsky
- Re: Windows gfortran binaries
- From: Ken Fairfield
- Re: Windows gfortran binaries
- From: Beliavsky
- Windows gfortran binaries
- Prev by Date: Re: MR&C 7.9
- Next by Date: Re: MR&C 7.9
- Previous by thread: Re: Windows gfortran binaries
- Next by thread: Re: Windows gfortran binaries
- Index(es):
Relevant Pages
|