Software Archive
Read-only legacy content
17061 Discussions

WHERE and array sections

Intel_C_Intel
Employee
251 Views
Hi!

I am unsure whether I can use WHERE for array sections, e.g.:


REAL a(10),b(10) 
WHERE (a(1:5)>0.0) a(1:5)=b(1:5) 


Would this work such that a(6:10) are left untouched regardless of the values in a(6:10), or do I need to create temporary variables, i.e.


REAL a(10),b(10),c(5),d(5) 
c=a(1:5) 
d=b(1:5) 
WHERE (c>0.0) c=d 
a(1:5)=c 


Thanks,

Olof
0 Kudos
0 Replies
Reply