<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span style="font-size: 14px;" class="">Hi,</span><div class=""><span style="font-size: 14px;" class="">I post the message</span></div><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><span style="font-size: 14px;" class="">the ncl script:</span></div><div class=""><br class=""></div><div class=""><span style="font-size: 14px;" class="">==========================================</span></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">x=PPnew</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">num</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">ismissing</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(x)))</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">y=TTnew</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">ip=</span><span style="font-variant-ligatures: no-common-ligatures" class="">dim_pqsort_n</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(x,-</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">2</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">,</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">3</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">printVarSummary</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(x)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">printVarSummary</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(ip)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(200, 20, 201);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">printMinMax</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(ip,</span><span style="font-variant-ligatures: no-common-ligatures; color: #b42419" class="">0</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">dimsizes</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(ip))</span></div></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(46, 174, 187);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(64, 11, 217);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">TTnew=y(ip,:,:,:)</span><span style="font-variant-ligatures: no-common-ligatures" class="">;</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(64, 11, 217);" class=""><span style="color: rgb(200, 20, 201); font-variant-ligatures: no-common-ligatures;" class="">printMinMax</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(TTnew,</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(180, 36, 25);" class="">0</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)</span></div></span></div><div class=""><span style="font-size: 14px;" class="">=========================================</span></div><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>missing number 0</span></div></div><div class=""><span style="font-size: 14px;" class=""><br class=""></span></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Variable: x</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Type: float</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Total Size: 31948800 bytes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> 7987200 values</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Number of Dimensions: 4</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>[time | 12] x [lat | 160] x [lon | 320] x [LEV | 13]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Coordinates: </span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> time: [20160116.875..20161216.875]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> lat: [89.14151942646112..-89.14151942646112]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> lon: [ 0..358.875]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> LEV: [107500..5000]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Number Of Attributes: 7</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> _FillValue :<span class="Apple-tab-span" style="white-space:pre"> </span>1e+20</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> institution :<span class="Apple-tab-span" style="white-space:pre"> </span>MPIMET</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> cell_methods :<span class="Apple-tab-span" style="white-space:pre"> </span>time: mean</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> table :<span class="Apple-tab-span" style="white-space:pre"> </span>128</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> code :<span class="Apple-tab-span" style="white-space:pre"> </span>130</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> units :<span class="Apple-tab-span" style="white-space:pre"> </span>K</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> long_name :<span class="Apple-tab-span" style="white-space:pre"> </span>pressure</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Variable: ip</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Type: integer</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Total Size: 31948800 bytes</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> 7987200 values</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Number of Dimensions: 4</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>[12] x [160] x [320] x [13]</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Coordinates: </span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>min=0 max=12</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>12</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(1)<span class="Apple-tab-span" style="white-space:pre"> </span>160</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(2)<span class="Apple-tab-span" style="white-space:pre"> </span>320</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(3)<span class="Apple-tab-span" style="white-space:pre"> </span>13</span></div><div style="margin: 0px; font-stretch: normal; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">fatal:Illegal subscript. Subscripts must be scalar or one dimensional vectors</span></div></div><div class=""><br class=""></div><div class="">====================</div><div class=""><br class=""></div><div class=""><span style="font-size: 14px;" class="">Y has the same dimensions as X (</span><span style="font-size: 14px;" class="">[time | 12] x [lat | 160] x [lon | 320] x [LEV | 13]</span><span style="font-size: 14px;" class="">). And there is no missing value in X, but Y has some.</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><font face="Menlo" class=""><span style="font-size: 14px;" class="">Thus, I think there are some bugs here. Could you please help me look into it?</span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 14px;" class="">Thanks,</span></font></div><div class=""><font face="Menlo" class=""><span style="font-size: 14px;" class="">Huiping</span></font></div><div class=""><br class=""></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 29, 2020, at 1:21 AM, Dennis Shea <<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Whenever you encounter an error, you should add print statements to help you debug the issue.</div><div class=""><br class=""></div><div class=""> printVarSummary(x) ; overview of source variable<br class=""></div><div class=""> print("-----") ; visual break</div><div class=""><br class=""></div><div class=""> ip = dim_pqsort(x,-2) ;; descending order</div><div class=""><div class=""> printVarSummary(ip)</div><div class=""> prinyMinMax(ip, 0)</div><div class=""> print("-----") <br class=""></div><div class=""><br class=""></div><div class=""> dim_ip = dimsizes(ip)</div><div class=""> print(dim_ip)<br class=""></div><div class=""> print("-----") <br class=""></div><div class=""><br class=""></div></div><div class="">
y=y(ip,:,:,:)</div><div class="">=============================</div><div class="">Are there grid locations that contain all missing values? <br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 26, 2020 at 6:36 PM YAN HUIPING via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br class="">
I am using the function dim_pqsort to reorder an array with dimensions of (time,nlat, nlon, nlev) following the instructions <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort.shtml" rel="noreferrer" target="_blank" class="">https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort.shtml</a><br class="">
<br class="">
ip=dim_pqsort(x,-2);; descending order<br class="">
y=y(ip,:,:,:)<br class="">
<br class="">
However, there are error messages: “fatal:Illegal subscript. Subscripts must be scalar or one dimensional vectors”.<br class="">
Ps: the version of NCL I used is 6.5.0<br class="">
<br class="">
Could please help me on this problem?<br class="">
<br class="">
Thanks,<br class="">
Huiping<br class="">
_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</div></blockquote></div><br class=""></div></body></html>