[Fortran] 纯文本查看 复制代码
Read (linp, '(A)') dummy
Read (linp, '(A)') title
Read (linp, '(A)') dummy
Read (linp, *) nn, ne, nm, ndim, nen, ndn
Read (linp, '(A)') dummy
Read (linp, *) nd, nl, nmpc
部分代码:
Dimension x(200, 2), noc(300, 3), mat(300), pm(10, 3),ehs(300), nu(100), u(100), f(400), bt(2, 3), s(400, 95)
Character *16 file1, file2, file3
Character *81 dummy, title
Print *, '***************************************'
Print *, '* PROGRAM HEAT2D *'
Print *, '* HEAT 2-D WITH 3-NODED TRIANGLES *'
Print *, '* T.R.Chandrupatla and A.D.Belegundu *'
Print *, '***************************************'
!c imax = first dimension of the s - matrix, ix = 1 st dim . of x - matrix, etc .
imax = 400
ix = 200
inoc = 300
ipm = 10
Print *, 'Input Data File Name <DOS file name>'
Read '(A)', file1
linp = 10
Open (Unit=10, File=file1, Status='UNKNOWN')
Print *, 'Output Data File Name <DOS file name>'
Read '(A)', file2
lout = 11
Open (Unit=11, File=file2, Status='UNKNOWN')
Read (linp, '(A)') dummy
Read (linp, '(A)') title
Read (linp, '(A)') dummy
Read (linp, *) nn, ne, nm, ndim, nen, ndn
Read (linp, '(A)') dummy
Read (linp, *) nd, nl, nmpc
!c - - -material property thermal conductivity
npr = 1
nmpc = 0
ndn = 1
ndim = 2
nen = 3
!c element heat source, ehs(i), i = 1, . . ., ne
!c - - -nd = no . of specified temperatures
!c - - -nl = no . of nodal heat sources
!c - - -npr = 1(thermal conductivity) and nmpc = 0
Print *, 'PLOT CHOICE'
Print *, ' 1) No Plot Data'
Print *, ' 2) Create Data File for Temperatures'
Print *, 'Choose 1 or 2 '
Read (5, *) ipl
If (ipl<1 .Or. ipl>2) ipl = 1
!c - - -default is no data
If (ipl>1) Then
Print *, 'Give File Name for Plot Data'
Read '(A)', file3
lout2 = 12
Open (Unit=12, File=file3, Status='UNKNOWN')
End If
!c - - - - -coordinates
Read (linp, '(A)') dummy
Do i = 1, nn
Read (linp, *) n, (x(n,j), j=1, ndim)
End Do