主题:求助!有关读数据的问题
我在一段程序中用WRITE(77,11) ((qesm(i,k),I=1,ix,1),k=1,kz,1)方式读出文件precg12,其中有ix=304,kz=80,所以文件precg12中有24320个数据,现在我要用24320个数据作为一个求解空间电场,所以要将这数据再读入qesm数组中去计算。这是我写的一小段读数据的程序,不过老是错误。
subroutine shi
integer,parameter :: sk=24320,ix=304,kz=80
integer i,k
real qesm(i,k),c(sk)
open(4,file="precg12")
11 format(es20.10)
do x=1,24320
read(4,11) c(x)
enddo
read(c,11) ((qesm(i,k),i=1,ix,1),k=1,kz,1)
write(*,*) qesm
return
end
老是出现以下错误:
E:\study\shiyan\seet1.for
E:\study\shiyan\seet1.for(9769) : Error: A CHARACTER data type is required in this context.
read(c,11) ((qesm(i,k),i=1,ix,1),k=1,kz,1)
^
E:\study\shiyan\seet1.for(9751) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [I]
integer i,k
----------------^
E:\study\shiyan\seet1.for(9751) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [K]
integer i,k
--------------希望哪位大侠能帮帮忙!万分感谢!
subroutine shi
integer,parameter :: sk=24320,ix=304,kz=80
integer i,k
real qesm(i,k),c(sk)
open(4,file="precg12")
11 format(es20.10)
do x=1,24320
read(4,11) c(x)
enddo
read(c,11) ((qesm(i,k),i=1,ix,1),k=1,kz,1)
write(*,*) qesm
return
end
老是出现以下错误:
E:\study\shiyan\seet1.for
E:\study\shiyan\seet1.for(9769) : Error: A CHARACTER data type is required in this context.
read(c,11) ((qesm(i,k),i=1,ix,1),k=1,kz,1)
^
E:\study\shiyan\seet1.for(9751) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [I]
integer i,k
----------------^
E:\study\shiyan\seet1.for(9751) : Error: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [K]
integer i,k
--------------希望哪位大侠能帮帮忙!万分感谢!