<div dir="ltr"><div>Hi Huiping,</div><div>I think in this case the following should work, note that your ip variable has dimensions [2,3] as you can see from the print statements:</div><div><br></div><div>
y(0,:)=y(0,ip(0,:))<br>y(1,:)=y(1,ip(1,:))
</div><div><br></div><div></div><div>However, I guess this is not what you are trying to do for your original array of (time,nlat,nlon,nlev)?</div><div>If, for example "data" is a variable name with sizes (ntime,nlat,nlon,nlev) and you want to sort out according to time dimension, you can do something as:</div><div></div><div>
<pre>data_new = <strong>dim_pqsort_n</strong>(data,<span style="color:rgb(255,0,0)"><b>-2</b></span>,0) ; read documentation about the option -2<br></pre><pre>NOTE that this will sort out your "data" variable in decreasing order.<br></pre>
</div><div>See the documentation for different of sorting in descending/ascending order.<br></div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml</a></div><div><br></div><div>hope that helps,</div><div>Cheers,</div><div>Rashed<br></div><div><br></div><br><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 28, 2020 at 3:49 PM YAN HUIPING via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">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"><div>Thank you Laura, I tried, but it does not help.<div>and just now I created a simple script like the example of the function dim_pqsort ,and it came out the same errors. </div><div><br></div><div>“ <span style="font-family:Menlo;font-size:14px">fatal:Illegal subscript. Subscripts must be scalar or one dimensional vectors</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div><span style="font-family:Menlo;font-size:14px">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 12 in file test.ncl</span>"</div><div><br></div><div>=========================================</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(193,101,28)"><span style="font-variant-ligatures:no-common-ligatures">begin</span></div><p style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"> </span><br></p><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(193,101,28)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">x=</span><span style="font-variant-ligatures:no-common-ligatures">(/(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">2</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">3</span><span style="font-variant-ligatures:no-common-ligatures">/)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures">(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">4</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">6</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">5</span><span style="font-variant-ligatures:no-common-ligatures">/)/)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">printVarSummary</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(x)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(x)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">ip=</span><span style="font-variant-ligatures:no-common-ligatures">dim_pqsort</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(x,-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">2</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(x)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">printVarSummary</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(ip)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(193,101,28)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">y=</span><span style="font-variant-ligatures:no-common-ligatures">(/(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">2</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">1</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">3</span><span style="font-variant-ligatures:no-common-ligatures">/)</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures">(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">4</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">6</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">5</span><span style="font-variant-ligatures:no-common-ligatures">/)/)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">y=y(ip,:)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(y)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(193,101,28)"><span style="font-variant-ligatures:no-common-ligatures">end</span></div></div><div><br></div><div><br><div><br><blockquote type="cite"><div>On May 29, 2020, at 6:35 AM, Laura Fowler <<a href="mailto:laura@ucar.edu" target="_blank">laura@ucar.edu</a>> wrote:</div><br><div><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Huiping:</div><div class="gmail_default" style="font-size:small">may be you need to add delete(TTnew) before the line:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">delete(TTnew)</div><div class="gmail_default" style="font-size:small"><div style="font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures;margin:0px;font-stretch:normal;line-height:normal;color:rgb(64,11,217)"><span>TTnew=y(ip,:,:,:)</span>;</div><div style="font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures;margin:0px;font-stretch:normal;line-height:normal;color:rgb(64,11,217)"><span style="color:rgb(200,20,201)">printMinMax</span><span>(TTnew,</span><span style="color:rgb(180,36,25)">0</span><span>)</span></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">since TTnew is originally a 4-dimensional array.</div><div class="gmail_default" style="font-size:small">Laura</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 28, 2020 at 4:23 PM YAN HUIPING via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">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"><div><span style="font-size:14px">Hi,</span><div><span style="font-size:14px">I post the message</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">the ncl script:</span></div><div><br></div><div><span style="font-size:14px">==========================================</span></div><div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">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)"><span style="font-variant-ligatures:no-common-ligatures">print</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures">num</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures">ismissing</span><span style="font-variant-ligatures:no-common-ligatures">(x)))</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">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)"><span style="font-variant-ligatures:no-common-ligatures">ip=</span><span style="font-variant-ligatures:no-common-ligatures">dim_pqsort_n</span><span style="font-variant-ligatures:no-common-ligatures">(x,-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">2</span><span style="font-variant-ligatures:no-common-ligatures">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">3</span><span style="font-variant-ligatures:no-common-ligatures">)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">printVarSummary</span><span style="font-variant-ligatures:no-common-ligatures">(x)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">printVarSummary</span><span style="font-variant-ligatures:no-common-ligatures">(ip)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(200,20,201)"><span style="font-variant-ligatures:no-common-ligatures">printMinMax</span><span style="font-variant-ligatures:no-common-ligatures">(ip,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures">)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures">print</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures">dimsizes</span><span style="font-variant-ligatures:no-common-ligatures">(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)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(46,174,187)"><span style="font-variant-ligatures:no-common-ligatures"><div style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(64,11,217)"><span style="font-variant-ligatures:no-common-ligatures">TTnew=y(ip,:,:,:)</span><span style="font-variant-ligatures:no-common-ligatures">;</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(64,11,217)"><span style="color:rgb(200,20,201);font-variant-ligatures:no-common-ligatures">printMinMax</span><span style="font-variant-ligatures:no-common-ligatures">(TTnew,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures">)</span></div></span></div><div><span style="font-size:14px">=========================================</span></div><div><span style="font-size:14px"><br></span></div><div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">(0)<span style="white-space:pre-wrap"> </span>missing number 0</span></div></div><div><span style="font-size:14px"><br></span></div><div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Variable: x</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Type: float</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 31948800 bytes</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> 7987200 values</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 4</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span style="white-space:pre-wrap"> </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"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> time: [20160116.875..20161216.875]</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> lat: [89.14151942646112..-89.14151942646112]</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> lon: [ 0..358.875]</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> LEV: [107500..5000]</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 7</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> _FillValue :<span style="white-space:pre-wrap"> </span>1e+20</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> institution :<span style="white-space:pre-wrap"> </span>MPIMET</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> cell_methods :<span style="white-space:pre-wrap"> </span>time: mean</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> table :<span style="white-space:pre-wrap"> </span>128</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> code :<span style="white-space:pre-wrap"> </span>130</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> units :<span style="white-space:pre-wrap"> </span>K</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> long_name :<span style="white-space:pre-wrap"> </span>pressure</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Variable: ip</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Type: integer</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 31948800 bytes</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> 7987200 values</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 4</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span style="white-space:pre-wrap"> </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"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">(0)<span style="white-space:pre-wrap"> </span>min=0 max=12</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">(0)<span style="white-space:pre-wrap"> </span>12</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">(1)<span style="white-space:pre-wrap"> </span>160</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">(2)<span style="white-space:pre-wrap"> </span>320</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">(3)<span style="white-space:pre-wrap"> </span>13</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">fatal:Illegal subscript. Subscripts must be scalar or one dimensional vectors</span></div></div><div><br></div><div>====================</div><div><br></div><div><span style="font-size:14px">Y has the same dimensions as X (</span><span style="font-size:14px">[time | 12] x [lat | 160] x [lon | 320] x [LEV | 13]</span><span style="font-size:14px">). And there is no missing value in X, but Y has some.</span></div><div><br></div><div><br></div><div><font face="Menlo"><span style="font-size:14px">Thus, I think there are some bugs here. Could you please help me look into it?</span></font></div><div><font face="Menlo"><span style="font-size:14px"><br></span></font></div><div><font face="Menlo"><span style="font-size:14px">Thanks,</span></font></div><div><font face="Menlo"><span style="font-size:14px">Huiping</span></font></div><div><br></div><div><div><br><blockquote type="cite"><div>On May 29, 2020, at 1:21 AM, Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:</div><br><div><div dir="ltr"><div>Whenever you encounter an error, you should add print statements to help you debug the issue.</div><div><br></div><div> printVarSummary(x) ; overview of source variable<br></div><div> print("-----") ; visual break</div><div><br></div><div> ip = dim_pqsort(x,-2) ;; descending order</div><div><div> printVarSummary(ip)</div><div> prinyMinMax(ip, 0)</div><div> print("-----") <br></div><div><br></div><div> dim_ip = dimsizes(ip)</div><div> print(dim_ip)<br></div><div> print("-----") <br></div><div><br></div></div><div>
y=y(ip,:,:,:)</div><div>=============================</div><div>Are there grid locations that contain all missing values? <br></div><div><br></div><div><br></div></div><br><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" target="_blank">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">Hi,<br>
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">https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort.shtml</a><br>
<br>
ip=dim_pqsort(x,-2);; descending order<br>
y=y(ip,:,:,:)<br>
<br>
However, there are error messages: “fatal:Illegal subscript. Subscripts must be scalar or one dimensional vectors”.<br>
Ps: the version of NCL I used is 6.5.0<br>
<br>
Could please help me on this problem?<br>
<br>
Thanks,<br>
Huiping<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>
</div></blockquote></div><br></div></div>_______________________________________________<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><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">!-------------------------------------------------------------------------------------------------------------</font><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">Laura D. Fowler </font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">Mesoscale and Microscale Meteorology Division (MMM) </font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">National Center for Atmospheric Research<br></font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">P.O. Box 3000, Boulder CO 80307-3000</font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff"><br></font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">e-mail: <a href="mailto:laura@ucar.edu" target="_blank">laura@ucar.edu</a></font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">phone: 303-497-1628</font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff"><br></font></div><div><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff">!-------------------------------------------------------------------------------------------------------------</font><br></div></div></div>
</div></blockquote></div><br></div></div>_______________________________________________<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>