Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to figure out the code

Status
Not open for further replies.

rajabadsha

Programmer
May 4, 2006
11
CA
I am trying to figure out the following code:
do iw=1,nw
irecl = irecl + 1
write(10,rec=irecl) (cplot(iw,ip),ip=1,np)
enddo

The output is written to a file called contour.dat. cplot is initiated to an array of 1000 * 1000. As a new programmer in Fortran I did not really understand the format of the write statement in the above loop. What does (cplot(iw,ip),ip=1,np) means?
Thanks
 
Code:
! do this nw times, iw is the loop counter
do iw=1,nw
   ! increase the record count
   irecl = irecl + 1
   ! write the irecl'th record
   ! it contains cplot(iw,1..np)
   ! cplot is an array
   write(10,rec=irecl) (cplot(iw,ip),ip=1,np)
! end of loop
enddo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top