爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5353|回复: 0

[作图] MPAS 从模式数据挑选观测站点数据有问题 求解!!!!

[复制链接]

新浪微博达人勋

发表于 2017-10-8 19:29:32 | 显示全部楼层 |阅读模式

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

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

x
我从模式数据中挑选520个站点数据 代码如下
f=addfile(mpas_diag.2012-06-29_21.00.00.nc","r")
f1=addfile("mpas_out.2012-06-23_00.00.00.nc","r")
f2=asciiread("china station.txt",(/520,4/),"double")
lonstation=f2(:,2)
lonstation!0="lon"
lonstation@units="degrees_east"
lonstation&lon=lonstation
latstation=f2(:,1)
latstation!0="lat"
latstation@units="degrees_north"
latstation&lat=latstation
station=f2(:,0)
rainc=f->rainc
lonCell=f1->lonCell
latCell=f1->latCell
RAD=get_r2d("double")
lonCell=lonCell*RAD
latCell=latCell*RAD

fuhe=new(dimsizes(lonCell),integer)
j=0
do i=0,dimsizes(lonCell)-1
if(lonCell(i).ge.70.and.lonCell(i).le.140.and.latCell(i).ge.0.and.latCell(i).le.60)then
  fuhe(j)=i
  j=j+1
end if
end do
fuhe_1=new(j,integer)
fuhe_1(0:j-1)=fuhe(0:j-1)

rainstation=new(dimsizes(station),"double")
do i=0,dimsizes(station)-1
  do j=0,dimsizes(fuhe_1)-1
   d=new(dimsizes(fuhe_1),double)
   d(j)=gc_latlon(latstation(i),lonstation(i),latCell(fuhe_1(j)),lonCell(fuhe_1(j)),100,2)
end do
  r=min(d)
do j=0,dimsizes(fuhe_1)-1
   if(gc_latlon(latstation(i),lonstation(i),latCell(fuhe_1(j)),lonCell(fuhe_1(j)),1000,2).eq.r) then
     m=fuhe_1(j)
   end if
  end do
  rainstation(i)=rainc(0,m)
  delete(d)
  delete(r)
  delete(m)
end do

print(rainstation)
end
结果出来
所有的站点都是一个值 求大神解答
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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