Re: Fortran Users! Is there a better way to do this?
Tuomo Stauffer <[email protected]>
| Newsgroups | gmane.comp.emulators.turnkey-mvs |
|---|---|
| Message-ID | <[email protected]> |
A long time since I used Fortran - besides which level you are using? Anyway - why not put the whole thing in format clause? Let the compiler do what it does best? That was and still is one of the power of Fortran almost no other language shares, maybe PL/I but that's it. A format clause is optimized and executed as one - no real looping. Great especially in machines which had some vector processing capability - C and ilk are still far, far behind that, the libraries are getting better but.. Also, if used in "toy" MVS, I have no idea how the compiler behaves, how JES buffers, etc - but in "real" MVS/JES I had an exit which buffered the output so writing one element, a row or even a page at a time didn't make much difference. just some, probably bad, idea? have a nice day - tuomo On Sat, May 15, 2010 at 15:20, Ron Hudson <[email protected]> wrote: > > > Hey fellow fortran users.. > > I have a program that produces a long list of numbers calculated one after > the other. > I want to print these numbers 5 wide to save 'paper' > > What I am doing now: > > an array(5) > a pointer = 0 > loop > increment pointer > fill array(pointer) with next calculated result) > if pointer = 5 > print array on a line of the page > zero pointer > until done calculating > if (pointer .ge. 1) print array(1 - pointer) > ... > > Is there a better way? > > Ron > > > >