<div dir="ltr"><div>You might do a printVarSummary after this line to make sure anom1_nomiss contains valid data:<br></div><div><br></div><div> anom1_nomiss=anom1_1d(ind(anom1_1d.ne.-9999))</div><div><br></div><div>Other than that, if you can provide your data, I can dig into it deeper. You can either email directly to me if not too large, or use our FTP site:</div><div><br></div><div><a href="http://ncl.ucar.edu/ftp_files.shtml">http://ncl.ucar.edu/ftp_files.shtml</a></div><div><br></div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 4, 2020 at 5:50 AM Sri nandini via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello ncl users,<br>
<br>
I have a segementation error when executing dim_pqsort which i use for <br>
plotting the percentiles in my PDF.<br>
<br>
The last print i get is "started percentiles" and then segmentation <br>
error on the line starting with anom1_permsort. I am using ncl version <br>
6.5.0.<br>
<br>
Below is my script: would appreciate any help in this?<br>
<br>
Sri<br>
<br>
<br>
begin<br>
<br>
f = addfile ("<a href="http://anom_hist_zo_slr.nc" rel="noreferrer" target="_blank">anom_hist_zo_slr.nc</a>", "r")<br>
hist_anom = f->hist_anom<br>
printVarSummary(hist_anom)<br>
dimx = dimsizes(hist_anom)<br>
ntim = dimx(0) ; 240<br>
nens = dimx(1) ; 100<br>
nlat = dimx(2) ; 45<br>
mlon = dimx(3) ; 90<br>
hist_anom@_FillValue = -9.96921e+36<br>
<br>
hist_anom1= dtrend_n(hist_anom,False,0)<br>
printVarSummary(hist_anom1)<br>
delete(hist_anom)<br>
<br>
f1 = addfile ("<a href="http://anom_rcp45_zo_slr.nc" rel="noreferrer" target="_blank">anom_rcp45_zo_slr.nc</a>", "r")<br>
rcp45_anom = f1->rcp45_anom<br>
printVarSummary(rcp45_anom)<br>
rcp45_anom1= dtrend_n(rcp45_anom, False,0)<br>
printVarSummary(rcp45_anom1)<br>
delete(rcp45_anom)<br>
<br>
f2 = addfile ("<a href="http://anom_rcp85_zo_slr.nc" rel="noreferrer" target="_blank">anom_rcp85_zo_slr.nc</a>", "r")<br>
rcp85_anom = f2->rcp85_anom<br>
printVarSummary(rcp85_anom)<br>
rcp85_anom1= dtrend_n(rcp85_anom, False,0)<br>
printVarSummary(rcp85_anom1)<br>
delete(rcp85_anom)<br>
<br>
;=================================================================<br>
<br>
anom1_1d = ndtooned(hist_anom1) ;to carry out the <br>
dim_stat4_n on one dimension.<br>
anom2_1d = ndtooned(rcp45_anom1)<br>
printVarSummary(anom2_1d)<br>
anom3_1d = ndtooned(rcp85_anom1)<br>
printVarSummary(anom3_1d)<br>
<br>
TTstat1 = dim_stat4(anom1_1d)<br>
printVarSummary(TTstat1) ; (4,?)<br>
<br>
TTstat2 = dim_stat4(anom2_1d)<br>
printVarSummary(TTstat2) ; (4,?)<br>
print("success")<br>
TTstat3 = dim_stat4(anom3_1d)<br>
printVarSummary(TTstat3) ; (4,?)<br>
print("success")<br>
<br>
xLow = min(anom1_1d)<br>
xHi = max(anom1_1d)<br>
print("success")<br>
xLow1 = min(anom2_1d)<br>
xHi1 = max(anom2_1d)<br>
print("success")<br>
xLow2 = min(anom3_1d)<br>
xHi2 = max(anom3_1d)<br>
<br>
;==================================================================<br>
; percentiles (requires sorting the array)<br>
<br>
anom1_nomiss=anom1_1d(ind(anom1_1d.ne.-9999))<br>
print("started percentiles")<br>
<br>
anom1_permsort = dim_pqsort(anom1_nomiss,2) ;; sorted array is <br>
anom1_nomiss!!<br>
delete(anom1_permsort)<br>
<br>
anom1_p05=anom1_nomiss(floattoint(0.05*dimsizes(anom1_nomiss))) <br>
;(rank_p5)<br>
anom1_p95=anom1_nomiss(floattoint(0.95*dimsizes(anom1_nomiss)))<br>
printVarSummary(anom1_p05)<br>
anom2_nomiss=anom2_1d(ind(anom2_1d.ne.-9999))<br>
anom2_permsort = dim_pqsort(anom2_nomiss,2)<br>
delete(anom2_permsort)<br>
<br>
anom2_p05=anom2_nomiss(floattoint(0.05*dimsizes(anom2_nomiss))) <br>
;(rank_p5)<br>
anom2_p95=anom2_nomiss(floattoint(0.95*dimsizes(anom2_nomiss)))<br>
print("started percentiles")<br>
delete(anom2_nomiss)<br>
<br>
anom3_nomiss=anom3_1d(ind(anom3_1d.ne.-9999))<br>
anom3_permsort = dim_pqsort(anom3_nomiss,2)<br>
delete(anom3_permsort)<br>
<br>
anom3_p05=anom3_nomiss(floattoint(0.05*dimsizes(anom3_nomiss))) <br>
;(rank_p5)<br>
anom3_p95=anom3_nomiss(floattoint(0.95*dimsizes(anom3_nomiss)))<br>
print("started percentiles")<br>
<br>
;================================================================================<br>
; calculate empirical PDF<br>
;================================================================================<br>
opt = True<br>
opt@bin_min = -50.<br>
opt@bin_max = 50.<br>
<br>
pdf1 = pdfx(hist_anom1, 100, opt)<br>
printVarSummary(pdf1)<br>
pdf2 = pdfx(rcp45_anom1, 100, opt)<br>
printVarSummary(pdf2)<br>
pdf3 = pdfx(rcp85_anom1, 100, opt)<br>
<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>