- 积分
- 117
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-1-11
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
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
结果出来
所有的站点都是一个值 求大神解答 |
|