<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 style="color:rgb(0,0,0)">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 style="color:rgb(0,0,0)">(TTnew,</span><span style="color:rgb(180,36,25)">0</span><span style="color:rgb(0,0,0)">)</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">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 style="overflow-wrap: break-word;"><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;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">num</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">ismissing</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"><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;color:rgb(0,0,0)">ip=</span><span style="font-variant-ligatures:no-common-ligatures">dim_pqsort_n</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><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">3</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">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">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;color:rgb(200,20,201)"><span style="font-variant-ligatures:no-common-ligatures">printMinMax</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(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;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)">(</span><span style="font-variant-ligatures:no-common-ligatures">dimsizes</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(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;color:rgb(0,0,0)"><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;color:rgb(0,0,0)"><div style="margin:0px;font-stretch:normal;line-height:normal;color:rgb(64,11,217)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">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;color:rgb(0,0,0)">(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;color:rgb(0,0,0)">)</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" class="gmail_signature"><div dir="ltr"><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">!-------------------------------------------------------------------------------------------------------------</font><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">Laura D. Fowler                                                                                       </font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">Mesoscale and Microscale Meteorology Division (MMM)         </font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">National Center for Atmospheric Research<br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">P.O. Box 3000, Boulder CO 80307-3000</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">e-mail: <a href="mailto:laura@ucar.edu" target="_blank">laura@ucar.edu</a></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">phone: 303-497-1628</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">!-------------------------------------------------------------------------------------------------------------</font><br></div></div></div>