Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Filling a 3-D array in an unusual way

$
0
0

Suppose you have an integer array iTime(4,4,5) which is initially filled as follows (where nSeason = 5):

do iSeason = 1,nSeason
  read(5,*) (iTime(1,J,iSeason), iTime(2,J,iSeason), J = 1,4)
enddo

Now supposed that you set the J=2 elements of this array upstream of this read loop and only wish to read in 3 pairs of integers.  In this way, you'd like to control distribution of the read integer values by setting the the J-index as 1, 3-4.  I hope my description is clear.

I've never tried to do this before.  Is there an easy way to do this?  Is there any way to do this?

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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