- 积分
- 1574
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-3-24
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
读取dat文件时,只能读取一部分,然后就报错。97个时刻,如果只读取前66个时刻就是对的,t设置成97时就报错。
dat文件我用grads验证过,几个变量大小确实没问题。
fortran代码如下:
program rarwh
implicit none
integer,parameter::mix=300,mjx=300,mkx=42,t=97
real,dimension(1:mix,1:mjx,1:mkx,1:t)::w,pres
real,dimension(1:mix,1:mjx,1:t)::slp,max_dbz
integer i,j,tim,irec,tem
open(2,file='hov2.dat',status='unknown',form='unformatted',access='direct',recl=mix*mjx*4)
irec=0
do tim=1,t
print*,'readtime=',tim
do tem=1,mkx
irec=irec+1
read(2,rec=irec)((w(i,j,tem,tim),i=1,mix),j=1,mjx)
enddo
do tem=1,mkx
irec=irec+1
read(2,rec=irec)((pres(i,j,tem,tim),i=1,mix),j=1,mjx)
enddo
irec=irec+1
read(2,rec=irec)((slp(i,j,tim),i=1,mix),j=1,mjx)
irec=irec+1
read(2,rec=irec)((max_dbz(i,j,tim),i=1,mix),j=1,mjx)
print*,'readnumber=',irec
print*,'w=',w(100,100,12,tim)
print*,'pres=',pres(20,20,1,tim)
print*,'slp=',slp(20,20,tim)
print*,'max_dbz=',max_dbz(30,30,tim)
enddo
close(2)
print*,'read1'
end
ctl文件如下:
dset ^hov2.dat
undef -9.99e8
title OUTPUT FROM WRF V3.5 MODEL
xdef 300 linear 122.69362 0.00750752
ydef 300 linear 15.63215 0.00750752
zdef 42 linear 1 1
tdef 97 linear 06Z09SEP2008 60MN
VARS 4
W 42 0 z-wind component (m s-1)
pressure 42 0 Model pressure (hPa)
slp 1 0 Sea Levelp Pressure (hPa)
max_dbz 1 0 Max Reflectivity (-)
ENDVARS
设置t=97时的报错如下:
/opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o): In function `__hpf_myprocnum':
initpar.c:(.text+0x2): relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o)
/opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o): In function `__hpf_ncpus':
initpar.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_tcpus' defined in COMMON section in /opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o)
/opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o): In function `__hpf_getioproc':
initpar.c:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_ioproc' defined in COMMON section in /opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o)
/opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o): In function `__hpf_is_ioproc':
initpar.c:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_ioproc' defined in COMMON section in /opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o)
initpar.c:(.text+0x38): relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o)
/opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o): In function `__hpf_abort':
initpar.c:(.text+0x5f): relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o)
/opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o): In function `__hpf_abortp':
initpar.c:(.text+0xeb): relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o)
/opt/pgi_10.6/linux86-64/10.6/lib/libpgf90.a(initpar.o): In function `__hpf_initarg':
initpar.c:(.text+0x127): relocation truncated to fit: R_X86_64_PC32 against `.bss'
initpar.c:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against `.bss'
initpar.c:(.text+0x17b): relocation truncated to fit: R_X86_64_PC32 against `.bss'
initpar.c:(.text+0x18b): additional relocation overflows omitted from the output
设置t=66及以下的结果:
w= -0.2603974
pres= 989.2549
slp= 993.2188
max_dbz= 0.000000
readtime= 63
readnumber= 5418
w= 0.5705950
pres= 989.3369
slp= 993.3005
max_dbz= 0.6033028
readtime= 64
readnumber= 5504
w= 0.1832751
pres= 989.9285
slp= 993.8995
max_dbz= 47.93919
readtime= 65
readnumber= 5590
w= -0.1748168
pres= 989.1619
slp= 993.1291
max_dbz= 21.45039
readtime= 66
readnumber= 5676
w= -4.2526715E-02
pres= 988.8116
slp= 992.7697
max_dbz= 16.73418
read1
谢谢各位大神!
|
|