爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3736|回复: 0

[求助] fortran 转txt为grd,转出来的数据不能用,这是怎么回事

[复制链接]

新浪微博达人勋

发表于 2022-3-17 16:47:26 | 显示全部楼层 |阅读模式

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

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

x
program micaps_diamond

implicit none

integer::time,nlev,nflag   ! nb is the number of stations of file, time, nlev,
                               ! and nflag are the ones that will be used while writing grd
integer::i


character*8,allocatable::id(:)
character*15,allocatable::sta(:)
real,allocatable::dir(:)
real,allocatable::speed(:)
real,allocatable::lat(:)
real,allocatable::lon(:)
real,allocatable::u(:)
real,allocatable::v(:)
real,allocatable::ncld(:)




open(11,file="L:/DJBY/feng/2017010308feng.txt",status="old",form="formatted")

   read(11,*)
   read(11,*)
   read(11,*)


   allocate(id(426))
   allocate(lat(426))
   allocate(lon(426))
   allocate(dir(426))
   allocate(speed(426))
   allocate(u(426))
   allocate(v(426))
   allocate(sta(426))
   allocate(ncld(426))



   do i=1,426
      read(11,*) lon(i),lat(i),id(i),sta(i),dir(i),speed(i),ncld(i)
          u(i)=(-1)*sin(dir(i)*3.14/180)*speed(i)
          v(i)=(-1)*cos(dir(i)*3.14/180)*speed(i)
   enddo


close(11)

open(21,file="L:\DJBY\feng\2017010308wind1.grd",status="replace",form="binary")


   time=1
   nlev=1
   nflag=1
   do i=1,426
      write(21) id(i),lon(i),lat(i),time,nlev,nflag,u(i),v(i)
   enddo
   nlev=0
   write(21) lon(i-1),lat(i-1),id(i-1),time,nlev,nflag

close(21)

end

搜狗截图20220317164536.jpg

2017010308feng.txt

36.42 KB, 下载次数: 0, 下载积分: 金钱 -5

密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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