用grads将nc格式转化为了dat格式,以下为dat和nc信息nc
dset C:\Users\ayqz\Desktop\energycalculate.nc
title
undef -9.99e+33
dtype netcdf
xdef 241 linear 90 0.25
ydef 161 linear 20 0.25
zdef 21 levels 1000 975 950 925 900 850 800 750
700 650 600 550 500 450 400 350 300 250
200 150 100
tdef 32 linear 00Z28DEC2020 180mn
vars 6
z=>z 21 t,z,y,x Geopotential
r=>r 21 t,z,y,x Relative humidity
t=>t 21 t,z,y,x Temperature
u=>u 21 t,z,y,x U component of wind
v=>v 21 t,z,y,x V component of wind
w=>w 21 t,z,y,x Vertical velocity
endvars
dat
dset C:\Users\ayqz\Desktop\energy.dat
title ERA5 uvrhtw data
undef -9.99e+33
xdef 241 linear 90 0.25
ydef 161 linear 20 0.25
zdef 21 levels 1000 975 950 925 900 850 800 750
700 650 600 550 500 450 400 350 300 250
200 150 100
tdef 32 linear 00Z28DEC2020 180mn
vars 6
z 21 t,z,y,x geopotential
u 21 t,z,y,x u wind
v 21 t,z,y,x v wind
r 21 t,z,y,x relative humidity
t 21 t,z,y,x tempetature
w 21 t,z,y,x vertical velocity
endvars
现用fortran提取dat,一直报错,代码以及报错如下,求问为何
Program main
integer i,j,k,m,n
parameter(lon0=90,lon1=150,lat0=20,lat1=60)
parameter(kk=21,idy=32)
parameter(ii=4*(lon1-lon0)+1,jj=4*(lat1-lat0)+1)
parameter(dax=0.25,day=0.25)
real u(idy,kk,jj,ii)
open(10,file="C:\Users\ayqz\Desktop\energy.dat",form='UNFORMATTED',status='old')
do m=1,idy
do k=1,kk
read(10)((u(m,k,j,i),i=1,ii),j=1,jj)
end do
end do
close(10)
end
报错:
At line 11 of file C:\Users\ayqz\Desktop\by3.f90 (unit = 10, file = 'C:\Users\ayqz\Desktop\energy.dat')
Fortran runtime error: End of file