program SRME
real*4,ALLOCATABLE::SEISMIC_DATA(:)
CHARACTER*20 filename
integer*2 SAMPLE_RATE,TRACE_LENGTH,TRACE_AMOUNT
TRACE_AMOUNT=5765
filename='Z10-CH-1.sgy'
WRITE(*,*)'获得SGY数据采样率、采样长度'
OPEN(15,FILE=FILENAME,ACCESS='DIRECT',
$FORM='BINARY',RECL=2,convert='big_endian')
READ(15,REC=1859) SAMPLE_RATE
READ(15,REC=1858) TRACE_LENGTH
WRITE(*,*)'采样率=',SAMPLE_RATE,'采样长度=',TRACE_LENGTH
CLOSE(15)
ALLOCATE(SEISMIC_DATA(1:TRACE_LENGTH))
OPEN(30,FILE=FILENAME,FORM='binary',
$ACCESS='DIRECT',RECL=4,convert='big_endian')
WRITE(*,*)'读取SGY地震数据'
DO I=1,TRACE_AMOUNT
OPEN(30,FILE=FILENAME,FORM='BINARY',
$ACCESS='DIRECT',RECL=4,convert='big_endian')
DO L1=1,TRACE_LENGTH
READ(30,REC=900+60*I+(I-1)*TRACE_LENGTH+L1)
$SEISMIC_DATA(L1)
write(*,*)L1,seismic_data(l1)
END DO
PAUSE
END DO
END PROGRAM
li913 发表于 2022-9-2 14:17
试试 convert='IBM'
QQ截图20220909110452.png (82.1 KB, 下载次数: 157)
li913 发表于 2022-9-9 11:08
sgy卷头中3225-3226字节表示数据格式,你的可能是2
zy_cd 发表于 2022-9-9 16:09
确实是2,再次感谢,您也是物探专业的吗?
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |