linux - I want to edit my fortran generated file in fortran -
I have a Fortune 95 program, which writes an array such as this:
Do temp_final do MC = 1, N_MC do x = 0, nan y = 0, write m (1, *) x, y, array (x, y) enddo write enddo write (1, * ) TT = In my program, I am writing these values in a file, but between two temperature values, I am writing multiple times (but N_MC time) x, x, y array (x, y) value , As they mc loop Inside, you're going to N_MC steps. As the file is only generated, and the program takes a lot of time to run, so if you can recommend any technique to edit the already generated file and only the first values To keep the set and move them to another file or edit the original file and keep the changes.
My file looks like this
temporary 0.69999999999999998! (Initial value) 0 -10000000000000000 0 1 -10000000000000000 0 2 -l,0000000000000000 0 3 L,0000000000000000 0 4 L,0000000000000000 1 0 -l,0000000000000000 1 1 L,0000000000000000 1 2 L,0000000000000000 1 3 -l,0000000000000000 1 4 -l,0000000000000000 2 0 -l,0000000000000000 2 1 L,0000000000000000 2 2 -l,0000000000000000 2 3 L,0000000000000000 2 4 L,0000000000000000 3 0 -l,0000000000000000 3 1 -l,0000000000000000 3 2 L,0000000000000000 3 3 -l,0000000000000000 3 4 -l,0000000000000000 0 0 L,0000000000000000 0 1 -l,0000000000000000 0 2 L,0000000000000000 0 3 L,0000000000000000 0 4 -l,0000000000000000 1 0 L,0000000000000000 1 1 L,0000000000000000 1 2 L,0000000000000000 1 3 -l,0000000000000000 1 4 -l,0000000000000000 2 0 -l,0000000000000000 2 1 L,0000000000000000 2 2 -l,0000000000000000 2 3 L,0000000000000000 2 4 L,0000000000000000 3 0 -l,0000000000000000 3 1 -10000000000000000 3 2 10000000000000000 3 3, -10000000000000000 3-4-10000000000000000 .......... N_MC-2B And (two sets as already shown) Temporary .59999999999999998 (After that there are new array values having new temp)! In this way, I'm assuming the array for the difference is temporary. . Temp 0.09999999999999998! (Last voltage)
I do not want to set the first set of values only after that .......... Value between constant values of N_MC timing temp.
I do not know how to call a file and delete a particular section, which I do not want and it will be saved again.
NB
I want to set the first values for the transfer only 0-3, 0-9, array (i, j)
0 0 -l,0000000000000000 0 1 -l,0000000000000000 0 2 -l,0000000000000000 0 3 L,0000000000000000 0 4 L,0000000000000000 1 0 -l,0000000000000000 1 1 L,0000000000000000 1 2 1 0000000000000000 1 3 -l,0000000000000000 1 4 -l,0000000000000000 2 0 -l,0000000000000000 2 1 L,0000000000000000 2 2 - L,0000000000000000 2 3 L,0000000000000000 2 4 L,0000000000000000 3 0 -l,0000000000000000 3 1 -1 , 0000000000000000 3 2 10000000000000000 3 3-10000000000000000 3 4-10000000000000000! After that, the temperature = 0.6999999999990
not to file for the same temperature.
When you close an existing FORTRAN file and open it again, you can say That's where the first write position is.
open (unit, verb = 'write', condition = 'attachment')
Finally write your new, while
< Pre> open (unit, action = 'write', condition = 'rewind', position = 'replaces')
will erase existing content and start typing at the beginning will do it.
Comments
Post a Comment