Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Subsetting an array with unknown array size

$
0
0

I want to select elements in an array that meet a certain condition.

program subsetting

implicit none
real,dimension(100)::A
! I declare an array(say,B) elements of which are greater than 0.15 in A

call random_number(A)
! I have to select elements that are greater than 0.15 and store them in B

end program subsetting

The problem here is that I don't know how many elements are greater than 0.15. How can I write a code for getting the array B?


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>