<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="">Hi Rashed,<div class=""><br class=""></div><div class="">I am very appreciated for your reply. </div><div class="">Yes, I am try to reorder the 4-D array and the 2-D array is a simple example to show the problem. </div><div class="">What I am done here is sorting the data in vertical, i.e. from the bottom surface to the top. Since the pressure in vertical is decreasing while the temperature may be not, I could not simply use the dim_pqsort_n to reorder the temperature (Y) as the pressure array (X). That’s why I have to use the indices from the pressure (X here) to reorder the temperature (Y). </div><div class=""><br class=""></div><div class="">Actually, I have used several loops to do such reordering and solved my own problems. But I think this function may need some improvements.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Huiping</div><div class=""><br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 29, 2020, at 5:42 PM, Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com" class="">rashidcomsis@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi Huiping,</div><div class="">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 class=""><br class=""></div><div class="">
y(0,:)=y(0,ip(0,:))<br class="">y(1,:)=y(1,ip(1,:))
</div><div class=""><br class=""></div><div class=""></div><div class="">However, I guess this is not what you are trying to do for your original array of (time,nlat,nlon,nlev)?</div><div class="">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 class=""></div><div class="">
<pre class="">data_new = <strong class="">dim_pqsort_n</strong>(data,<span style="color:rgb(255,0,0)" class=""><b class="">-2</b></span>,0) ; read documentation about the option -2<br class=""></pre><pre class="">NOTE that this will sort out your "data" variable in decreasing order.<br class=""></pre>
</div><div class="">See the documentation for different of sorting in descending/ascending order.<br class=""></div><div class=""><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml" class="">https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml</a></div><div class=""><br class=""></div><div class="">hope that helps,</div><div class="">Cheers,</div><div class="">Rashed<br class=""></div><div class=""><br class=""></div><br class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><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 Thu, May 28, 2020 at 3:49 PM YAN HUIPING via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank" 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"><div class="">Thank you Laura, I tried, but it does not help.<div class="">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 class=""><br class=""></div><div class="">“ <span style="font-family:Menlo;font-size:14px" class="">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" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""></span><br class=""></div><div class=""><span style="font-family:Menlo;font-size:14px" class="">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 12 in file test.ncl</span>"</div><div class=""><br class=""></div><div class="">=========================================</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(193,101,28)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">begin</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;color:rgb(193,101,28)" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">x=</span><span style="font-variant-ligatures:no-common-ligatures" class="">(/(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">2</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">1</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">3</span><span style="font-variant-ligatures:no-common-ligatures" class="">/)</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures" class="">(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">4</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">6</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">5</span><span style="font-variant-ligatures:no-common-ligatures" 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;" 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="">print</span><span style="font-variant-ligatures: no-common-ligatures;" 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="">ip=</span><span style="font-variant-ligatures:no-common-ligatures" class="">dim_pqsort</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x,-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">2</span><span style="font-variant-ligatures: no-common-ligatures;" 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;" class="">(x)</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;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;" class="">(ip)</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;color:rgb(193,101,28)" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">y=</span><span style="font-variant-ligatures:no-common-ligatures" class="">(/(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">2</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">1</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">3</span><span style="font-variant-ligatures:no-common-ligatures" class="">/)</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures" class="">(/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">4</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">6</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">5</span><span style="font-variant-ligatures:no-common-ligatures" class="">/)/)</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=y(ip,:)</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;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;" class="">(y)</span></div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(193,101,28)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">end</span></div></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On May 29, 2020, at 6:35 AM, Laura Fowler <<a href="mailto:laura@ucar.edu" target="_blank" class="">laura@ucar.edu</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><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 class=""></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)" class=""><span class="">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)" class=""><span style="color:rgb(200,20,201)" class="">printMinMax</span><span class="">(TTnew,</span><span style="color:rgb(180,36,25)" class="">0</span><span class="">)</span></div></div><div class="gmail_default" style="font-size:small"><br class=""></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 class=""></div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small"><br class=""></div></div><br class=""><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" 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"><div 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" class="">(</span><span style="font-variant-ligatures:no-common-ligatures" class="">num</span><span style="font-variant-ligatures:no-common-ligatures" class="">(</span><span style="font-variant-ligatures:no-common-ligatures" class="">ismissing</span><span style="font-variant-ligatures:no-common-ligatures" 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" class="">ip=</span><span style="font-variant-ligatures:no-common-ligatures" class="">dim_pqsort_n</span><span style="font-variant-ligatures:no-common-ligatures" class="">(x,-</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">2</span><span style="font-variant-ligatures:no-common-ligatures" class="">,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)" class="">3</span><span style="font-variant-ligatures:no-common-ligatures" 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" 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" 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" class="">(ip,</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" 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" class="">(</span><span style="font-variant-ligatures:no-common-ligatures" class="">dimsizes</span><span style="font-variant-ligatures:no-common-ligatures" 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" 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" 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" 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" 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" 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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 class=""><br class=""><blockquote type="cite" class=""><div class="">On May 29, 2020, at 1:21 AM, Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank" class="">shea@ucar.edu</a>> wrote:</div><br class=""><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" target="_blank" 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></div>_______________________________________________<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><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class=""><div dir="ltr" class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">!-------------------------------------------------------------------------------------------------------------</font><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">Laura D. Fowler </font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">Mesoscale and Microscale Meteorology Division (MMM) </font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">National Center for Atmospheric Research<br class=""></font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">P.O. Box 3000, Boulder CO 80307-3000</font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class=""><br class=""></font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">e-mail: <a href="mailto:laura@ucar.edu" target="_blank" class="">laura@ucar.edu</a></font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">phone: 303-497-1628</font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class=""><br class=""></font></div><div class=""><font style="background-color:rgb(255,255,255)" face="arial, helvetica, sans-serif" color="#0000ff" class="">!-------------------------------------------------------------------------------------------------------------</font><br class=""></div></div></div>
</div></blockquote></div><br class=""></div></div>_______________________________________________<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></div></body></html>