[Fortran] 纯文本查看 复制代码
PROGRAM GASJOURNAL
DIMENSION H(61,61),P(61,61),Y(61),X(61)
DATA B,R,C0,AN,PA,EDA,EPSON/60.0E-3,25.0E-3,5.0E-5,6.0E4,1.013E5,1.79E-5,0.8/
OPEN(8,FILE='PRESSURE.DAT',STATUS='UNKNOWN')
OPEN(9,FILE='HIGHT.DAT',STATUS='UNKNOWN')
OPEN(11,FILE='LOAD.DAT',STATUS='UNKNOWN')
PI=3.1415926
N=61
N1=N-1
M=61
M1=M-1
DX=2.0*PI/N1
DY=2.0/M1
OMEGA=AN*2.0*PI/60
U=OMEGA*R
ALENDA=6.0*EDA*U*R/PA/C0**2
ALFA=(R/B*DX/DY)**2
SUM1=0.0
S=D*B
CALL SUBH (N,M,DX,EPSON,H)
CALL SUBP (N,M,DX,EPSON,ALFA,ALENDA,H,P)
CALL SUBM(N,M,P)
ALENDA=6.0*EDA*U*R/PA/C0**2
SUM1=ALENDA*S*SUM1
DO I=1,N
X(I)=(I-1)*DX
ENDDO
DO J=1,M
Y(J)=(J-1.0)*DY-0.5
ENDDO
WRITE(8,40)Y(1),(Y(J),J=1,M)
DO I=1,N
WRITE(8,40)X(I)*180.0/PI,(P(I,J),J=1,M)
ENDDO
WRITE(9,40)Y(1),(Y(J),J=1,M)
DO I=1,N
WRITE(9,40)X(I)*180.0/PI,(H(I,J),J=1,M)
END DO
!WRITE(8,40)AX,(H(I,J),J=1,M)
!WRITE(9,40)AX,(P(I,J),J=1,M)
WRITE(11,*) '承载力=',SUM1
40 FORMAT(62(E12.6,1X))
STOP
END
SUBROUTINE SUBH(N,M,DX,EPSON,H)
DIMENSION H(N,M)
DO I=1,N
SETA=(I-1.0)*DX
DO J=1,M
H(I,J)=1.0+EPSON*COS(SETA)
ENDDO
ENDDO
RETURN
END
SUBROUTINE SUBP(N,M,DX,EPSON,ALFA,ALENDA,H,P)
DIMENSION H(N,M),P(N,M)
DO I=2,N-1
DO J=2,M-1
P(I,J)=1.1
ENDDO
END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