- #1
1994Bhaskar
- 134
- 0
Hey guys i am a little confused in how to write arrays to a output file in FORTRAN 77. Here is the piece of code:
Please assume that rri and eei arrays have been defined correctly above
open (16,file='output.out')
write (16,6100) rri eei
format (5e16.8)
However in the output file i am getting pretty jumbled up data:
Something like this:
"
0.12000000E+03 0.20742290E-09 0.41478867E-09 0.82941372E-09 0.16583648E-08
0.33154214E-08 0.66271448E-08 0.13243838E-07 0.26458146E-07 0.52832895E-07
0.10543041E-06 0.21019709E-06 0.41852488E-06 0.83179448E-06 0.16488514E-05
0.32565192E-05 0.63985245E-05 0.12480863E-04 0.24097285E-04 0.45863812E-04
0.85564378E-04 0.15526781E-03 0.27122637E-03 0.44993835E-03 0.69682466E-03
0.98711330E-03 0.12499488E-02 0.13803427E-02 0.12944919E-02 0.99909339E-03
0.60891981E-03 0.27673235E-03 0.86567616E-04 0.16818065E-04 0.18057130E-05
0.95199966E-07 0.22493871E-08 0.23612230E-10 0.12315050E-12 0.37242291E-15
0.72817779E-18 0.99201003E-21 0.99685794E-24 0.77166103E-27 0.47569850E-30
0.23964260E-33 0.10068188E-36 0.35851855E-40 0.10959223E-43 0.29017715E-47
0.66667887E-51 0.13035555E-54 0.19643613E-58 0.59575854E-88 0.00000000E+00
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00
"
As you guys can see that i can't make out from the final output file that what is rri and what was part of eei array.
My preferred format would be:
"
rri eei
0.12000000E+03 0.12000000E+03
0.10543041E- 060.32565192E-05
0.33154214E-08 0.33154214E-08
0.10543041E-06
0.32565192E-05
"
The values are just a representation not the actual. It's just to represent the format i want the contents to be written in the output file.
Now as much as i have understood till now the format line: format (5e16.8) decides this arrangement. So any known format which would help this problem ?
I am unfamiliar with fortran 77.
Please assume that rri and eei arrays have been defined correctly above
open (16,file='output.out')
write (16,6100) rri eei
format (5e16.8)
However in the output file i am getting pretty jumbled up data:
Something like this:
"
0.12000000E+03 0.20742290E-09 0.41478867E-09 0.82941372E-09 0.16583648E-08
0.33154214E-08 0.66271448E-08 0.13243838E-07 0.26458146E-07 0.52832895E-07
0.10543041E-06 0.21019709E-06 0.41852488E-06 0.83179448E-06 0.16488514E-05
0.32565192E-05 0.63985245E-05 0.12480863E-04 0.24097285E-04 0.45863812E-04
0.85564378E-04 0.15526781E-03 0.27122637E-03 0.44993835E-03 0.69682466E-03
0.98711330E-03 0.12499488E-02 0.13803427E-02 0.12944919E-02 0.99909339E-03
0.60891981E-03 0.27673235E-03 0.86567616E-04 0.16818065E-04 0.18057130E-05
0.95199966E-07 0.22493871E-08 0.23612230E-10 0.12315050E-12 0.37242291E-15
0.72817779E-18 0.99201003E-21 0.99685794E-24 0.77166103E-27 0.47569850E-30
0.23964260E-33 0.10068188E-36 0.35851855E-40 0.10959223E-43 0.29017715E-47
0.66667887E-51 0.13035555E-54 0.19643613E-58 0.59575854E-88 0.00000000E+00
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00
"
As you guys can see that i can't make out from the final output file that what is rri and what was part of eei array.
My preferred format would be:
"
rri eei
0.12000000E+03 0.12000000E+03
0.10543041E- 060.32565192E-05
0.33154214E-08 0.33154214E-08
0.10543041E-06
0.32565192E-05
"
The values are just a representation not the actual. It's just to represent the format i want the contents to be written in the output file.
Now as much as i have understood till now the format line: format (5e16.8) decides this arrangement. So any known format which would help this problem ?
I am unfamiliar with fortran 77.