|
本人刚刚接触Fortran代码,想将图片红框中所有1的那一部分对应E的最小值获得,然后所有2对应E的最小值获得,3对应E的最小值……以此类推,然后将对应最小值那一行输出到文件中,比如:3个红色框的部分,将它们最小值获得后写入文件中变成:
Step number 39 scan point 1 E= -571.251770020
Step number 5 scan point 2 E= -571.252807617
Step number 4 scan point 3 E= -571.253234863
……
这个代码是我自己尝试写的,不过问题还没解决,只解决了红框中那一列中有多少个数。还望各位有什么思路或者代码修改不吝惜赐教,谢谢。
[Fortran] 纯文本查看 复制代码 03 | integer i , j , num , num 1 , num 2 , lines , k , num 4 |
04 | integer , allocatable :: x ( : ) , y ( : ) |
05 | real , allocatable :: z ( : ) , minz ( : ) , minumz ( : ) |
06 | open ( 12 , file = 'result.txt' ) |
11 | write ( * , * ) 'How many lines:' |
15 | allocate ( minz ( lines ) ) |
16 | allocate ( minumz ( lines ) ) |
18 | read ( 12 , "(12x,I4,12x,I6)" ) x ( i ) , y ( i ) |
21 | else if ( y ( i ) /= num 1 ) then |
36 | open ( 12 , file = 'result.txt' ) |
43 | read ( 12 , "(38x,f16.9)" ) z ( k ) |
48 | write ( 14 , "(f16.9)" ) minz |
|
|