主题:在64位LINUX系统下用F77和C混编读写超100G的特大二进制文件问题
本人用F77和C混编读写超100G的特大二进制文件的程度,主程序和计算用F77,读写用C,本程序在UNIX下应用正常,移植到64位LINUX下出问题乐,请高手老师分别给出F77和C的编辑选项为盼!!!关键程序如下:
PARAMETER (LTRMAX=36200)
INTEGER*2 DATAK1(LTRMAX)
INTEGER*4 DATAK2(LTRMAX)
EQUIVALENCE (DATAK1(1),DATAK2(1))
IUNIT1=BOPEN(IFILE1,0)
C ___________ READ 3200 BYTES REEL HEAD _________________________
CALL BREAD(IUNIT1,3200,DATAK2,IST)
IF(IST.LE.0) THEN
WRITE(*,*) 'READ 3200 BYTES REEL HEAD ERROR !'
STOP
END IF
C ___________ READ 400 BYTES FILE HEAD __________________________
CALL BREAD(IUNIT1,400,DATAK2,IST)
IF(IST.LE.0) THEN
WRITE(*,*) 'READ 400 FILE HEAD ERROR !'
STOP
END IF
NS1=DATAK1(11) 返回的这个值不对
IFORMT=DATAK1(13) 返回的这个值也不对
stop
end
SUBROUTINE BREAD(IUNIT,LEN,IBUF,ISTAT)
INTEGER*4 IUNIT,IBUF(1),ISTAT,bbread
integer*4 len
istat=bbread(IUNIT,IBUF,len)
RETURN
END
int bbread_(fd1_pf,cbuf,len_pf)
char cbuf[];
int *fd1_pf;
int *len_pf;
{
int len;
int fd1,n;
len= *len_pf;
fd1= *fd1_pf;
/* printf("len=%d,fd1=%d\n",len,fd1);*/ 这些值显示是对的
n=read(fd1,cbuf,len);
/* printf("n=%d\n",n);*/ n显示也是对的
return(n);
}
请大家看看问题在哪里,怎么改
PARAMETER (LTRMAX=36200)
INTEGER*2 DATAK1(LTRMAX)
INTEGER*4 DATAK2(LTRMAX)
EQUIVALENCE (DATAK1(1),DATAK2(1))
IUNIT1=BOPEN(IFILE1,0)
C ___________ READ 3200 BYTES REEL HEAD _________________________
CALL BREAD(IUNIT1,3200,DATAK2,IST)
IF(IST.LE.0) THEN
WRITE(*,*) 'READ 3200 BYTES REEL HEAD ERROR !'
STOP
END IF
C ___________ READ 400 BYTES FILE HEAD __________________________
CALL BREAD(IUNIT1,400,DATAK2,IST)
IF(IST.LE.0) THEN
WRITE(*,*) 'READ 400 FILE HEAD ERROR !'
STOP
END IF
NS1=DATAK1(11) 返回的这个值不对
IFORMT=DATAK1(13) 返回的这个值也不对
stop
end
SUBROUTINE BREAD(IUNIT,LEN,IBUF,ISTAT)
INTEGER*4 IUNIT,IBUF(1),ISTAT,bbread
integer*4 len
istat=bbread(IUNIT,IBUF,len)
RETURN
END
int bbread_(fd1_pf,cbuf,len_pf)
char cbuf[];
int *fd1_pf;
int *len_pf;
{
int len;
int fd1,n;
len= *len_pf;
fd1= *fd1_pf;
/* printf("len=%d,fd1=%d\n",len,fd1);*/ 这些值显示是对的
n=read(fd1,cbuf,len);
/* printf("n=%d\n",n);*/ n显示也是对的
return(n);
}
请大家看看问题在哪里,怎么改