- 积分
- 154
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-9-28
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本人初学grads,菜鸟一枚,请各位大神帮忙指教,本人先用gs批处理命令批量提取了2003年总降雨等变量,然后又用fortran编程把每天的三小时降雨量整合到一个文件夹里,在这过程中grads和fortran都没有报错,但是我整合出来的文件夹却是空文件夹,这是为啥啊,是我提取数据的时候出错了吗file:///C:\Users\LIRONG~1\AppData\Local\Temp\E9BIPM$_`9}`VS07`VD9H1F.gif
批量提取数据gs
dy=20030101
while(dy<=20031231)
yy=000
while(yy<=2100)
if(yy<=900)
'reinit'
'sdfopen G:\GLDAS_NOAH_025_3H\2003\GLDAS_NOAH025_3H.A'dy'.0'yy'.021.nc4'
'set gxout fwrite'
'set fwrite G:\nc4dat\2003\GLDAS_NOAH025_3H.A'dy'.0'yy'.021.dat'
'set x 1044 1112'
'set y 348 368'
'set z 1 1'
'set t 1 1'
'd tveg_tavg'
'd wind_f_inst'
'd rainf_f_tavg'
'd tair_f_inst'
'd qair_f_inst'
'd Qs_acc'
'd potevap_tavg'
else
'reinit'
'sdfopen G:\GLDAS_NOAH_025_3H\2003\GLDAS_NOAH025_3H.A'dy'.'yy'.021.nc4'
'set gxout fwrite'
'set fwrite G:\nc4dat\2003\GLDAS_NOAH025_3H.A'dy'.'yy'.021.dat'
'set x 1044 1112'
'set y 348 368'
'set z 1 1'
'set t 1 1'
'd tveg_tavg'
'd wind_f_inst'
'd rainf_f_tavg'
'd tair_f_inst'
'd qair_f_inst'
'd Qs_acc'
'd potevap_tavg'
endif
yy=yy+300
endwhile
dy=dy+1
endwhile
'disable fwrite'
'disable fwrite'
下为fortran整合文件夹的命令(用论坛里阿木大神的帖子改的嘿嘿)
parameter(nx=69,ny=21,nz=1,nt=8)
dimension rain_f_tavg(nx,ny,nz,nt)
open(1,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.0000.021.dat',form='binary')
open(2,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.0300.021.dat',form='binary')
open(3,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.0600.021.dat',form='binary')
open(4,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.0900.021.dat',form='binary')
open(5,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.1200.021.dat',form='binary')
open(6,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.1500.021.dat',form='binary')
open(7,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.1800.021.dat',form='binary')
open(8,file='G:/nc4dat/2003/GLDAS_NOAH025_3H.A20030101.2100.021.dat',form='binary')
open(37,file='G:/nc4day/2003/rain_f_tavg/GLDAS_NOAH025_3H.A20030101.2100.021.dat')
do iz=1,nz
read(1) ((rain_f_tavg(i,j,iz,1),i=1,nx),j=1,ny)
read(2) ((rain_f_tavg(i,j,iz,2),i=1,nx),j=1,ny)
read(3) ((rain_f_tavg(i,j,iz,3),i=1,nx),j=1,ny)
read(4) ((rain_f_tavg(i,j,iz,4),i=1,nx),j=1,ny)
read(5) ((rain_f_tavg(i,j,iz,5),i=1,nx),j=1,ny)
read(6) ((rain_f_tavg(i,j,iz,6),i=1,nx),j=1,ny)
read(7) ((rain_f_tavg(i,j,iz,7),i=1,nx),j=1,ny)
read(8) ((rain_f_tavg(i,j,iz,8),i=1,nx),j=1,ny)
enddo
do it=1,nt
do iz=1,nz
write(37) ((rain_f_tavg(i,j,iz,it),i=1,nx),j=1,ny)
enddo
enddo
close(1)
close(2)
close(3)
close(4)
close(5)
close(6)
close(7)
close(8)
close(37)
end
在这个过程中grads和fortran都没有报错,可是整合出来的文件夹为什么时空的呢
|
|