爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 13504|回复: 14

[分享资料] 再问GrADS,关于生成映射文件

[复制链接]
发表于 2013-6-26 15:07:50 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 一闭一睁 于 2013-6-26 15:38 编辑

闲话少叙,上菜....
台站信息   7.txt
1 130.52416 42.63535
2 129.19614 42.27893
3 129.08132 42.98463
4 129.4146 42.76317
5 129.6718 43.33066
6 129.64566 43.31308
7 130.37929 42.85337
台站数据(标准化后)  left.txt
1.png
生成多时次(48个月)站点资料  sta.grd的fortan程序
!7个站,48个月
integer i,j
real tim
integer nlev,nflag
real a1(7,48),lat(7),lon(7),stid(7)
character*8 id(7)
real a
open(1,file='c:\test_stn\left.txt')!7个水文站资料
open(2,file='c:\test_stn\7.txt')!台站数据
open(3,file='c:\test_stn\sta.grd',status='replace', form='binary')
read(1,*)((a1(i,j),i=1,7),j=1,48)
!读台站坐标数据
do i=1,7
    read(2,*)stid(i),lat(i),lon(i)
enddo
!写数据
do i=1,48
    tim=0.0
    nlev=1
    nflag=1
    do j=1,7
        write(3)stid(j),lat(j),lon(j),tim,nlev,nflag,a1(j,i)
        !write(3,*)stid(j),lat(j),lon(j),tim,nlev,nflag,a1(j,i)
    enddo
    nlev=0
    write(3)stid(j-1),lat(j-1),lon(j-1),tim,nlev,nflag
    !write(3,*)stid(j-1),lat(j-1),lon(j-1),tim,nlev,nflag
enddo
close(3)
数据描述文件station.ctl
dset c:/test_stn/sta.grd
dtype station
stnmap c:/test_stn/station.map
undef -999.0
title jl
tdef 48 linear jan1951 1mo
vars 1
t 0 99 data
endvars
生成映射文件,报错了
ga-> ! stnmap -i c:/test_stn/station.ctl
  Name of binary data set: c:/test_stn/sta.grd
  Number of times in the data set: 48
  Number of surface variables: 1
  Number of level dependent variables: 0
Starting scan of station data binary file.
Binary data file open: c:/test_stn/sta.grd
Processing time step 1
  Invalid station hdr found in station binary file
  Possible causes:  Invalid level count in hdr
                    Descriptor file mismatch
                    File not station data
                    Invalid relative time
    levs = 1  flag = -1085527939  time = 1.4013e-45
,晕了,求助!


2.png
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-6-26 15:14:26 | 显示全部楼层
==,我改动了一下fortan程序,似乎能生成映射文件了,把stid的数据类型改成character就可以了
生成映射文件的截图
ga-> ! stnmap -i c:/test_stn/station.ctl
  Name of binary data set: c:/test_stn/sta.grd
  Number of times in the data set: 48
  Number of surface variables: 1
  Number of level dependent variables: 0

Starting scan of station data binary file.
Binary data file open: c:/test_stn/sta.grd

Processing time step 1
     Time = 1 has stn count = 7

Processing time step 2
     Time = 2 has stn count = 7

Processing time step 3
     Time = 3 has stn count = 7

Processing time step 4
     Time = 4 has stn count = 7

Processing time step 5
     Time = 5 has stn count = 7

Processing time step 6
     Time = 6 has stn count = 7

Processing time step 7
     Time = 7 has stn count = 7

Processing time step 8
     Time = 8 has stn count = 7

Processing time step 9
     Time = 9 has stn count = 7

Processing time step 10
     Time = 10 has stn count = 7

Processing time step 11
     Time = 11 has stn count = 7

Processing time step 12
     Time = 12 has stn count = 7

Processing time step 13
     Time = 13 has stn count = 7

Processing time step 14
     Time = 14 has stn count = 7

Processing time step 15
     Time = 15 has stn count = 7

Processing time step 16
     Time = 16 has stn count = 7

Processing time step 17
     Time = 17 has stn count = 7

Processing time step 18
     Time = 18 has stn count = 7

Processing time step 19
     Time = 19 has stn count = 7

Processing time step 20
     Time = 20 has stn count = 7

Processing time step 21
     Time = 21 has stn count = 7

Processing time step 22
     Time = 22 has stn count = 7

Processing time step 23
     Time = 23 has stn count = 7

Processing time step 24
     Time = 24 has stn count = 7

Processing time step 25
     Time = 25 has stn count = 7

Processing time step 26
     Time = 26 has stn count = 7

Processing time step 27
     Time = 27 has stn count = 7

Processing time step 28
     Time = 28 has stn count = 7

Processing time step 29
     Time = 29 has stn count = 7

Processing time step 30
     Time = 30 has stn count = 7

Processing time step 31
     Time = 31 has stn count = 7

Processing time step 32
     Time = 32 has stn count = 7

Processing time step 33
     Time = 33 has stn count = 7

Processing time step 34
     Time = 34 has stn count = 7

Processing time step 35
     Time = 35 has stn count = 7

Processing time step 36
     Time = 36 has stn count = 7

Processing time step 37
     Time = 37 has stn count = 7

Processing time step 38
     Time = 38 has stn count = 7

Processing time step 39
     Time = 39 has stn count = 7

Processing time step 40
     Time = 40 has stn count = 7

Processing time step 41
     Time = 41 has stn count = 7

Processing time step 42
     Time = 42 has stn count = 7

Processing time step 43
     Time = 43 has stn count = 7

Processing time step 44
     Time = 44 has stn count = 7

Processing time step 45
     Time = 45 has stn count = 7

Processing time step 46
     Time = 46 has stn count = 7

Processing time step 47
     Time = 47 has stn count = 7

Processing time step 48
     Time = 48 has stn count = 7
  Max reports per time:  7 reports at t = 1
  Max data elements in largest report: 1

Version 2 Station map file created: c:/test_stn/station.map

stnmap: WARNING!!  This stnmap file can only be accessed by GrADS Version 2.0.1.
oga.1
stnmap: WARNING!!  However, GrADS Version 2.0.1.oga.1 can read both versions

stnmap: COMMENT  -- use the -1 command line option to create a map for older GrA
DS versions
ga->
高手赐教!
密码修改失败请联系微信:mofangbao
发表于 2013-6-26 16:07:53 | 显示全部楼层

回帖奖励 +1 金钱


这个就说明成功了。警告只是说这个映射文件只适用于GrADS  2.0.1版本。另外还是强调一下,站号必须是8字节字符型的,这个是死的,不能变的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-6-27 15:17:32 | 显示全部楼层
学习了,character8*,谢谢!!!
密码修改失败请联系微信:mofangbao
发表于 2013-6-27 18:35:54 | 显示全部楼层
经纬度弄反了
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2013-6-27 21:11:53 | 显示全部楼层
5楼什么意思??
密码修改失败请联系微信:mofangbao
发表于 2015-4-24 12:07:52 | 显示全部楼层
我也遇到了同样的问题
密码修改失败请联系微信:mofangbao
发表于 2015-4-24 18:38:47 | 显示全部楼层
大神,我也把我的弄出来了,一遍又一遍看你的帖子我才恍然大悟,小女子在此谢过!
密码修改失败请联系微信:mofangbao
发表于 2015-11-16 14:05:46 | 显示全部楼层
谢谢 学习了
密码修改失败请联系微信:mofangbao
发表于 2017-11-21 16:48:51 | 显示全部楼层
感谢,今天设成整数了,一直没搞出了{:eb303:}
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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