- 积分
- 3618
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-7
- 最后登录
- 1970-1-1
|
NCL
系统平台: |
|
问题截图: |
- |
问题概况: |
利用wmbarb画风向风速图,想用循环使不同级别的风羽用不同颜色显示,但脚本出错,只显示语法错误 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
2 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 指甲钳 于 2014-5-8 11:57 编辑
利用wmbarb画风向风速图,想用循环使不同级别的风羽用不同颜色显示,但脚本出错,只显示语法错误,循环如下:
uv=wind_component(s,d,0)
u = uv(0,:)*1.94386
v = uv(1,:)*1.94386
wmsetp("wbs",.03)
do i = 0, nrow-1
if (uv(i).le.6) then
wmsetp("col",1)
end if
if (uv(i) .ge. 7 .and. uv(i).le.10) then
wmsetp("col",2)
end if
if (uv(i) .ge. 11 .and. uv(i).le. 16) then
wmsetp("col",2)
end if
if (uv(i) .ge. 17 .and. uv(i).le.21) then
wmsetp("col",3)
end if
if (uv(i) .ge. 22 .and. uv(i).le.27) then
wmsetp("col",2)
end if
if (uv(i).ge.28 .and. uv(i) .le.33) then
wmsetp("col",4)
end if
if(uv(i).ge.34 .and. uv(i) .lt. 40) then
wmsetp("col",5)
end if
if (uv(i).ge.41 .and. uv(i) .lt. 47) then
wmsetp("col",6)
end if
if (uv(i).ge.48 .and. uv(i) .lt. 55) then
wmsetp("col",7)
end if
if (uv(i).ge.56 .and. uv(i) .lt. 63) then
wmsetp("col",8)
if (uv(i) .ge.64 .and. uv(i) .lt. 71) then
wmsetp("col",2)
if (uv(i).ge.72.0) then
wmsetp("col",9)
end if
wmbarb(wks, lon, lat,u, v)
end do
出现的问题是说我的end do 那一行语法有问题,然后最后的脚本的end也有问题,但我实在想不出哪里有问题了,是因为我的UV是尺量吗?不能分大小吗?错误如下:
fatal:syntax error: line 137 in file nh_wind.ncl before or near do
end do
-----^
fatal:error in statement
fatal:syntax error: line 141 in file nh_wind.ncl before or near \n
end
----^
fatal:error in statement
fatal:syntax error: line -1 before or near
^
fatal:error in statement
最后附上我完整的脚本和数据,求大神指教~~
|
|