爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6395|回复: 3

[作图] 如何用ncL循环读取.txt文件里的经纬度,并提取出该点的模拟结果的降水值

[复制链接]
发表于 2018-3-22 09:40:30 | 显示全部楼层 |阅读模式

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

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

x
begin
a = addfile("/usr/test/QLwrfout/xiajiwrfout_d02_2017-08-23_08:00:00.nc","r")
diri="/home/syrus/桌面/"  
  fname = "shanxijiangshui.txt"
  lines = asciiread(diri+fname,-1,"string")
rain_exp1 = wrf_user_getvar(a,"RAINNC",-1)
rain_con1 = wrf_user_getvar(a,"RAINC",-1)
rain_tot1 = rain_exp1 + rain_con1
times = wrf_user_getvar(a,"times",-1)
xlat=wrf_user_getvar(a,"XLAT",0)
xlon=wrf_user_getvar(a,"XLONG",0)
lat= tofloat(str_get_field(lines(1:),1," "))
lon= tofloat(str_get_field(lines(1:),2," "))
locationij=wrf_user_ll_to_ij(a,lon,lat,True);
;print(locationij)
lonlat=wrf_user_ij_to_ll(a,locationij(0),locationij(1),True);
print(lonlat)
;xx=xlat(locationij(1)-1,locationij(0)-1)
;print(xx)
pre=rain_tot1(:,locationij(1)-1,locationij(0)-1)
print(pre)
asciiwrite("test.txt",pre)
end
为什么出来后全是
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36
9.96921e+36

密码修改失败请联系微信:mofangbao
发表于 2018-3-23 22:55:02 | 显示全部楼层
您好,我想问一下您的陕西降水资料应该是实测资料吧,您是在哪儿下的呢,我在中国气象服务网下载的全球地面气象站定时观测资料中没有经纬度。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2018-3-25 16:08:24 | 显示全部楼层
我的尾巴呢 发表于 2018-3-23 22:55
您好,我想问一下您的陕西降水资料应该是实测资料吧,您是在哪儿下的呢,我在中国气象服务网下载的全球地面 ...

有经纬度的,你仔细看一下,可能用写字板打开才能看到
密码修改失败请联系微信:mofangbao
发表于 2019-5-31 16:33:02 | 显示全部楼层
请问解决了吗?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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