[問題] Error
forrtl severe 24 end-of-file during read ,unit 11
forrtl severe 161 Program Exception - array bounds exceeded
請問有人知道這兩個錯誤是什麼意思呢
網路上的我還是看不太懂該怎麼改正
code是先從許多數據中讀取
然後算內插
第二個error發生時是有15038筆數據
他的意思是超出電腦記憶體的容量嗎 還是code本身的問題勒
謝謝!
---------------
implicit none
integer*4::np,ng,b(2)
integer*4, allocatable::cvg_neib(:,:,:),ng_neib(:,:)
integer*4::i,j,nn
real*8,
allocatable::xp(:),yp(:),up(:),vp(:),pp(:),xg(:),yg(:),ug(:),vg(:),pg(:)
real*8::dx_ini,dy_ini,sh,mass,dt
real*8::x_max,x_min,y_max,y_min
real*8::w,wx,wy,wsum
real*8::a(10)
character*100::filename1,filename2
common/LL/x_max,x_min,y_max,y_min
common/all2/dx_ini,dy_ini,sh,mass,dt
! np = no. of particles
np=1600
! ng = no. of grids
ng=40
! entire domain including ghost paricles
x_max=2.000000E-03
x_min=-1.000000E-03
y_max=2.000000E-03
y_min=-1.000000E-03
! initial particle spacing
dx_ini=0.000025
dy_ini=0.000025
mass=0.62500006E-00
! smoothing length
sh=0.25000001E-04
dt=5.e-5
allocate(cvg_neib(2,ng,200),ng_neib(2,ng))
allocate(xp(np),yp(np),up(np),vp(np),pp(np),xg(ng),yg(ng),ug(ng),vg(ng)
,pg(ng))
write(*,*)'Keyin the filename of the input file'
read(*,*)filename1
write(*,*)
write(*,*)'Keyin the filename of the output file'
read(*,*)filename2
write(*,*)
open(11,file=filename1)
open(21,file=filename2)
! for data of particles
do i=1,11
read(11,*)
end do
do i=1,np
read(11,*)(a(j),j=1,10),b(1),b(2)
xp(i)=a(2)
yp(i)=a(3)
up(i)=a(4)
vp(i)=a(5)
pp(i)=a(8)
end do
! for data of grids
do i=1,ng-1
xg(i)=0.5
yg(i)=dy_ini*i
end do
call grid_interpolation(xp,yp,up,vp,pp,np,xg,yg,ug,vg,pg,ng)
write(21,*)'variables = "y"'
write(21,*)' "u" '
do i=1,ng
write(21,'(3(es12.5,1x))')yg(i),ug(i),vg(i)
end do
pause 'ok'
end
--
我要讀的檔案 有1600筆 每筆裡面有x y u v等共11個物理量
標顏色那 是我看不懂的地方
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.250.123
※ 編輯: HAKUKE 來自: 140.112.250.123 (01/26 23:29)
推
01/27 00:07, , 1F
01/27 00:07, 1F
推
01/27 00:13, , 2F
01/27 00:13, 2F
→
01/27 00:16, , 3F
01/27 00:16, 3F
→
01/27 00:16, , 4F
01/27 00:16, 4F
※ 編輯: HAKUKE 來自: 140.112.250.123 (01/27 01:01)
→
01/27 01:06, , 5F
01/27 01:06, 5F
※ 編輯: HAKUKE 來自: 140.112.250.123 (01/27 01:07)
討論串 (同標題文章)
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章