[Fortran] 纯文本查看 复制代码
Program GetBeta
DIMENSION MIU(3), ALPHA(6), BETA(10)
REAL MIU, ALPHA, BETA, MIU0, ALPHA0, BETAX, BETAY, BETAZ,BETA0
CHARACTER T1*20, T2*20, T3*20
OPEN (UNIT=1, FILE='data.tmp', STATUS='OLD' )
READ(1,50) T1
READ(1,100) ( MIU(I),I=1,3)
READ(1,50) T2
READ(1,100) ( ALPHA(I),I=1,6)
READ(1,50) T3
READ(1,100) ( BETA(I),I=1,10)
CLOSE(1)
50 FORMAT(A20)
100 FORMAT(5(1X,E15.8E2))
MIU0=SQRT(MIU(1)*MIU(1)+MIU(2)*MIU(2)+MIU(3)*MIU(3))
ALPHA0=(ALPHA(1)+ALPHA(3)+ALPHA(6))/3.0
BETAX=(BETA(1)+BETA(3)+BETA(8))*0.6
BETAY=(BETA(2)+BETA(4)+BETA(9))*0.6
BETAZ=(BETA(5)+BETA(7)+BETA(10))*0.6
BETA0=SQRT(BETAX*BETAX+BETAY*BETAY+BETAZ*BETAZ)
C WRITE(*,200) ( MIU(I),I=1,3)
WRITE(*,50) T1
WRITE(*,200) MIU0
WRITE(*,*) '================='
C WRITE(*,200) ( ALPHA(I),I=1,6)
WRITE(*,50) T2
WRITE(*,200) ALPHA0
WRITE(*,*) '================='
C WRITE(*,200) ( BETA(I),I=1,10)
WRITE(*,50) T3
WRITE(*,200) BETA0
200 FORMAT(1X,E15.8E2)
END