[ncl-talk] plot Walker circulation

Marston Johnston shejo284 at gmail.com
Fri Sep 22 03:10:57 MDT 2017


I think you can do some more debugging yourself. 

That error message comes from some internal code. You have to isolate what part of your script is causing this problem.

Some good programming practice would help a lot here. Comment out parts of your code beginning from the end, while keeping the script functional, until you find out where the problem comes from.

You also mention that your script works for one hemisphere but not the other. Look at your input data to see what has changed or what is it you assumed when you wrote this script that does not apply when you change hemisphere.

This is not something for NCL users to do for you.

/M

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Marston S. Ward, PhD

Department of Earth Sciences

University of Gothenburg, Sweden

Email: marston.johnston at gu.se

SkypeID: marston.johnston 

Phone: +46-31-7864901 

Only the fruitful thing is true!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

 

From: ncl-talk <ncl-talk-bounces at ucar.edu> on behalf of Dinuka Silva <dinu.kera at gmail.com>
Date: Friday, 22 September 2017 at 10:51
To: <ncl-talk at ucar.edu>
Subject: [ncl-talk] plot Walker circulation

 

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

 

 

 

Virus-free. www.avast.com 
_______________________________________________ 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/20170922/f7c36dc2/attachment.html>


More information about the ncl-talk mailing list