[ncl-talk] 回复: JRA 55 wind interpolation using ncl

刘振 286909655 at qq.com
Thu Jan 4 20:51:49 MST 2018


Hi Dennis,


  Thanks for your reply which exactly solved my problem.


Best regards,
zhen


------------------
刘振
 中山大学
环境科学与工程学院
大气科学系
Phone: +86-15013246049
 Liu  Zhen
 Department of Atmospheric Science
School of Environmental Science and Engineering
 Sun Yat-sen University
Email address: liuzhen9 at mail2.sysu.edu.cn 


 




------------------ 原始邮件 ------------------
发件人: "Dennis Shea";<shea at ucar.edu>;
发送时间: 2018年1月4日(星期四) 上午7:38
收件人: "刘振"<286909655 at qq.com>;
抄送: "ncl-talk"<ncl-talk at ucar.edu>; 
主题: Re: [ncl-talk] JRA 55 wind interpolation using ncl



The following is not the approach to use for reversing a grid's order.
The following only changes the (local) variable 'lat'.  

It has *no* effect on the variable data structure. 


fi=addfile("wind.nc","r")
lat=fi->lat
lon=fi->lon
lat=lat(::-1)                ; latitude only
printVarSummary(lat)


Assuming your input grids are ordered North->South, change to:

fi=addfile("wind.nc","r"))
uwnd=month_to_season(fi->uwnd(276:635,30,:,:),"DJF")
vwnd=month_to_season(fi->vwnd(276:635,30,:,:),"DJF")
uwnd=uwnd(:,::-1,:)
vwnd=vwnd(:,::-1,:)
printVarSummary(uwnd)  ; ordered South to North
printVarSummary(vwnd)


Same for rainfall.nc, if ordered North->South

====
uwnd_ave=dim_avg_n_Wrap(uwnd,0)
vwnd_ave=dim_avg_n_Wrap(vwnd,0)

printVarSummary(uwnd_ave)            ; look at coordinates



The *only* reason for the South->North ordering is that linint2_Wrap requires that order.


The following explicitly illustrates using the lat & lon associated with the variable's data structure.


uwnd_jra=linint2_Wrap (uwnd_ave&lon, uwnd_ave&lat, uwnd_ave, True, lon0,lat0, 0)
vwnd_jra=linint2_Wrap (vwnd_ave&lon, vwnd_ave&lat,  vwnd_ave, True, lon0,lat0, 0)
printVarSummary(uwnd_jra)            ; look at coordinates




On Wed, Jan 3, 2018 at 2:48 PM, 刘振 via ncl-talk <ncl-talk at ucar.edu> wrote:
Dear all,


  I am using ncl to plot 850hPa-wind. But after I interpolate the original wind to another resolution. It seems to me the latitude reversed (attached the 1st and 2nd plot[The wind from original file is right]). I try to use ::-1 for latitude to reverse the plot but failed (attached 3rd plot). Could you please help me to solve the problem? Thanks.


Best regards,
zhen 


------------------
刘振
 中山大学
环境科学与工程学院
大气科学系
Phone: +86-15013246049
 Liu  Zhen
 Department of Atmospheric Science
School of Environmental Science and Engineering
 Sun Yat-sen University
Email address: liuzhen9 at mail2.sysu.edu.cn 


 

_______________________________________________
 ncl-talk mailing list
 ncl-talk at ucar.edu
 List instructions, subscriber options, unsubscribe:
 http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180105/f4cf07d1/attachment.html>


More information about the ncl-talk mailing list