program $
implicit none
double precision a(30),b(30),c(30),d(30) !dimensions of coils: m
common /coils/a,b,c,d
double precision e(30)
common /e/e
integer ncoil
integer icoil
! character unit
common /nc/ncoil
open(1,file='1.txt',status='old')
read(1,*) ncoil
!read(1,*) unit
do icoil=1,ncoil !get the dimensions of each coil
read(1,*)c(icoil),d(icoil),b(icoil),a(icoil),e(icoil)
end do
close(1)
pause
end program $
Transpose 发表于 2023-2-11 18:54
大概率是你的数据有问题,比如没有用分隔符隔开,或者数据量不足等等,最好把报错给出来 ...
li913 发表于 2023-2-13 14:55
检查txt的编码格式,用ansi
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |