| Re: where and non-conformable arrays |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.fortran · Group Profile
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Sep 13, 2008 05:10
> On Sep 13, 2:48 am, Dan aol.com> wrote:
>> B = -9999.
>> WHERE( A /= -9999. ) B(1:size(A)) = A
> And ineffiently: many elements of B will be set twice.
> That's what the elsewhere clause is for.
It is hard to make generalizations on efficiency, but
it is likely that testing a value is slower than
assigning a value. One possible exception would be
avoiding the write to the swap file if you are
thrashing virtual storage. There are better fixes
in that case, though.
-- glen
|