爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5627|回复: 0

[脚本编辑] Fortran转化dat文件,grads生成映射文件报错

[复制链接]
发表于 2019-3-24 12:25:09 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
用Fortran处理十进制文件转换成二进制文件
程序如下:
program dat
parameter(ms=62,mt=39)
integer is,it
integer nlev,nflag
parameter(nlev=1,nflag=1)
integer t(mt)
character*8 endstn
character*8 stid(ms)
real lat(ms),lon(ms),rain(mt,ms)
data endstn/'end_time'/

open(10,file='C:\Users\ACER-1\Desktop\graduation\data\rainfull\southernrainfull3.txt')
200 format (i4,a5,f5.2,f6.2,f6.2)
do it=1,mt
   do is=1,ms
   read(10,200) t(it),stid(is),lat(is),lon(is),rain(it,is)
   end do
end do
close(10)

open(20,file='C:\Users\ACER-1\Desktop\graduation\data\rainfull\rainfull3.dat',form='binary',status='replace')
do it=1,mt
   do is=1,ms
   write(20) stid(is),lat(is),lon(is),0.0,nelv,nflag
   write(20) rain(it,is)
   end do
   write(20) endstn,0.0,0.0,0.0,0,0
end do

close(20)

write(*,*) t(1),stid(1),lat(1),lon(1),rain(1,1)
end


相应ctl文件:
dset C:\Users\ACER-1\Desktop\graduation\data\rainfull\rainfull3.dat
dtype station
stnmap C:\Users\ACER-1\Desktop\graduation\data\rainfull\rainfull3.map
title station data
undef -999.0
tdef 39 linear mar1979 1yr
vars 1
rainfull 0 99 march rainfull data
endvars


用grads生成map映射文件报错:
invalid station hdr found in station binary file

想问问各位是哪里出错了呀?
谢谢!
pic.PNG
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表