爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7868|回复: 3

[作图] NCL求时间平均

[复制链接]

新浪微博达人勋

发表于 2015-12-25 18:30:39 | 显示全部楼层 |阅读模式

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

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

x
Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.
warning:create: Bad HLU id passed to create, ignoring it
脚本:load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
begin

  a=addfile("./wrfout_d04_2008-04-20_12:00:00","r")
  do i=0,3
  lat2d=a->XLAT(6i+12,:,:)
  lon2d=a->XLONG(6i+12,:,:)
  u1=a->U10(6i+12,:,:)
  v1=a->V10(6i+12,:,:)
  x0=new((/12/),float)
  y0=new((/14/),float)
  y0(0)=31.625
  x0(0)=119.125
   do nn=0,13
    y0(nn)=nn*0.25+31.625
   end do
   do mm=0,11
    x0(mm)=mm*0.25+119.125
   end do
  end do
  ugrd=rcm2rgrid(lat2d,lon2d,u1,y0,x0,0)
  vgrd=rcm2rgrid(lat2d,lon2d,v1,y0,x0,0)
w=sqrt(ugrd*ugrd+vgrd*vgrd)
copy_VarCoords(u1,w)
printVarSummary(w)
aw=dim_avg_n(w,0)
copy_VarCoords(u1,aw)
wks = gsn_open_wks("png","1")
gsn_define_colormap(wks,"rainbow")
plot = gsn_csm_contour_map(wks,aw,res)
end
请各位大神赐教!

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-12-27 17:56:39 | 显示全部楼层
pangzi_xu 发表于 2015-12-27 17:38
你光把uv差值到自定义的网格中了,而没有把lat2d lon2d也差值过去,所以肯定不一样啦

谢谢,已解决
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-6-26 21:17:27 | 显示全部楼层

楼主能把对的脚本贴出来吗,感谢
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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