- 积分
- 915
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-11-2
- 最后登录
- 1970-1-1
![[撒浪嘿呦喂哦啊] 粉丝数:151 微博数:825 新浪微博达人勋](source/plugin/sina_login/img/light.png)
|
GrADS
系统平台: |
|
问题截图: |
- |
问题概况: |
读的数据是grapes模式转出来的数据postvar2012082212,现在用fortran 顺序读取,出现问题,读出u的第一个值是9.2855641E-40。而u的真正的第一个值跑到了第二个值上,整个数据都往后移了一个值。而且这个9.2855641E-40出现不止一次,这是怎么回事啊 。我用ctl画postvar2012082212这个数据,觉得数据本身是没问题的。下面是我读数据的程序和数据的ctl。怎么会出现9.2855641E-40这个啊。 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
4 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
program main
implicit none
integer, parameter :: mix=502, mjy=330,mgk=26,mt=25
integer, parameter :: nvar=5
integer :: i,j,it,k,ivar,irec,z
real(4),dimension(1:mix,1:mjy,1:mgk) :: u,v,temprature,h,q
real, dimension(1:mix,1:mjy,1:mgk) :: temp1
real, dimension(1:mix,1:mjy) :: temp,ulev1
real, dimension(1:mix,1:mjy,1:mgk,1:nvar) :: f1
real, dimension(1:mix,1:mjy,1:4) :: temp3
real, parameter ::undef= 9.999E+20
u=0.0;v=0.0;temprature=0.0;h=0.0;q=0.0;f1=0.0
open(103,convert='big_endian',file='./postvar2012082212',form='binary',status='old')
!------------------------read u--------------------------------------
DO it=1,25,1
READ(103) u
READ(103) v
READ(103) temprature
READ(103) h
READ(103) q
READ(103) temp1
READ(103) temp1
READ(103) temp1
READ(103) temp1
READ(103) temp1
READ(103) temp1
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp
READ(103) temp3
READ(103) temp3
print *, u(1,1:5,1)
print *, v(1,1:5,1)
if ( it==1 ) then !提取第一个时刻的值
do k=1,26
do j=1,mjy
do i=1,mix
f1(i,j,k,1)=u(i,j,k)
f1(i,j,k,2)=v(i,j,k)
f1(i,j,k,3)=temprature(i,j,k)
f1(i,j,k,4)=h(i,j,k)
f1(i,j,k,5)=q(i,j,k)
end do
end do
end do
write(*,*) "f1"
write(*,*) f1(1,1:5,1,1)
end if
end do ! do it=1,m
close(103)
write(*,*) "f1"
write(*,*) f1(1,1:5,1,1)
write(*,*) f1(1,1:5,1,2)
write(*,*) f1(1,1:5,1,3)
write(*,*) f1(1,1:5,1,4)
write(*,*) f1(1,1:5,1,5)
write(*,*) "read done"
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
open(18,file='u.dat',form='binary')
do k=1,26
do j=1,mjy
do i=1,mix
write(18) f1(i,j,k,1)
end do
end do
end do
close(18)
end
这是Fortran程序。
这是对应的ctl
dset postvar2012082212
options sequential big_endian
title post output from grapes
undef 9.999E+20
xdef 502 linear 70.0000 0.1500
ydef 330 linear 15.0000 0.1500
zdef 26 levels
1000.000000
975.0000000
950.0000000
925.0000000
900.0000000
850.0000000
800.0000000
750.0000000
700.0000000
650.0000000
600.0000000
550.0000000
500.0000000
450.0000000
400.0000000
350.0000000
300.0000000
250.0000000
200.0000000
150.0000000
100.0000000
70.00000000
50.00000000
30.00000000
20.00000000
10.00000000
tdef 25 linear 12z22AUG2012 180mn
vars 29
u 26 0 u_wind
v 26 0 v_wind
t 26 0 temperature
h 26 0 geopotential height
Qv 26 0 Q vapor
Qc 26 0 Q cloud
Qr 26 0 Q rain
Qi 26 0 Q ice
Qs 26 0 Q snow
Qg 26 0 Q grapaul
w 26 0 vertical wind
ps 0 0 surface pressure
psl 0 0 sea level pressure
rainc 0 0 precipitation
rainnc 0 0 precipitation
ts 0 0 surface temperature
glw 0 0 surface long wave radiation flux
gsw 0 0 surface short wave radiation flux
hfx 0 0 surface heat flux
qfx 0 0 surface vapour flux
q2m 0 0 vapour at 2m
t2m 0 0 t at 2m
u10m 0 0 u at 10m
v10m 0 0 v at 10m
lu 0 0 land use
zs 0 0 terrain
tmn 0 0 tmn
tslb 4 0 tslb
mslb 4 0 mslb
endvars
|
|