Yeah, that would be fine expect the program needs to write all of the intermediate values do the screen. I've found the answer though, adding
if (mod(i,100) .eq. 0) then
write(unit=7,fmt="(3e15.7)") variable1, v2, v3
end if
at the end of the DO loop, where 7 is an output file.
I've written a program in Fortran which has a do loop of the form
do i=0,20000
(operations)
end do
I want the program to print the values of the do loop, but only want it to print every 100th value of i (i.e. i=100,200,300,400...20000), can anyone suggest a way to do this?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.