[ncl-talk] plot Walker circulation
Dinuka Silva
dinu.kera at gmail.com
Fri Sep 22 02:51:15 MDT 2017
Hello All,
I'm trying to plot Walker circulation. I could plot it for the eastern
hemisphere but when I use the same code for western hemisphere I could not
plot.
the error is
fatal:["NclFile.c":2099]:Subscript out of range, error in subscript #3
fatal:Memory allocation failure:[errno=12]
I would appreciate any help.
Thank you.
Dinuka.
My ncl code is
begin
;----------------------------------------------------------------------
ECMWF = " /home/dinu/ecmwf/monthly/"
files = systemfunc("ls "+ECMWF+"uwnd/u.mon.*.nc")
fi = addfiles(files, "r")
T = fi[:]->time
YMD = cd_calendar(T,2)
iTim1 = ind (YMD.ge.19790101.and.YMD.lt.20130101)
u = fi[:]->u (iTim1,{1000:200},{5:-10},{-40:-110}) ;Zonal wind
printVarSummary(u)
;------------------------------------------------------------------------
ECMWF = " /home/dinu/ecmwf/monthly/"
fs = systemfunc("ls "+ECMWF+"wwnd/w.mon.*.nc")
fin1 = addfiles(fs, "r")
time = fin1[:]->time
ymd = cd_calendar(time,2)
iTim2 = ind (ymd.ge.19790101.and.ymd.lt.20130101)
w = fin1[:]->w (iTim2,{1000:200},{5:-10},{-40:-110}) ;Vertical
wind
printVarSummary(w)
;-----------------------------------------------------------------------
U = month_to_season(u,"JJA")
W = month_to_season(w,"JJA")
;------------------------------------------------------------------------
scale=abs(U)/abs(W)
;printVarSummary(scale)
W = scale*W
;printVarSummary(W)
;----------------------------------------------------------------------
Uavg = dim_avg_Wrap(dim_avg_Wrap(U(lev|:,lon|:,lat|:,time|:)))
Wavg = dim_avg_Wrap(dim_avg_Wrap(W(lev|:,lon|:,lat|:,time|:)))
;printVarSummary(Uavg)
;printVarSummary(Wavg)
wks=gsn_open_wks("x11","")
res=True
res at cnLinesOn=False
res at cnLineLabelsOn=False
res at cnInfoLabelOn=False
res at gsnLeftString = ""
res at gsnRightString = ""
res at vcRefMagnitudeF = 3.0 ; define vector ref mag
res at vcRefLengthF = 0.045 ; define length of vec ref
res at vcGlyphStyle = "CurlyVector" ; turn on curly vectors
res at vcMinDistanceF = 0.01 ; thin out vectors
res at vcMapDirection = False
res at tiMainString = "Walker circulation"
;-------------------------------------------------------------------
plot=gsn_csm_pres_hgt_vector(wks,Uavg,Uavg,Wavg,res)
end
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170922/382e8494/attachment.html>
More information about the ncl-talk
mailing list