do while循环读取两个txt遇到的小错误

do while(.true.)
    read(11,"(A512)",iostat=status1)cRead
    if(status1/=0) exit
    CALL parserRead(cRead)
    !write(*,*)lat,lon
    lon=lon-97
    lat=lat-21

    READ(14,"(A512)",iostat=status2)dRead
    if(status2/=0) exit
    CALL parserRead1(dRead)
    !write(*,*)lat1,lon1
    lon1=lon1-97
    lat1=lat1-21

 .......  

11文件比13文件多出很多行。这样循环,在运行的时候,结果就不是预想的那样了。

改成两个do while就好了。

猜你喜欢

转载自www.cnblogs.com/stelliformzm/p/13160444.html