[ncl-talk] Error subscript when using indices output from dim_pqsort to reorder another array

YAN HUIPING yanhp2009 at gmail.com
Tue May 26 18:36:10 MDT 2020


Hi,
I am using the function dim_pqsort to reorder an array with dimensions of (time,nlat, nlon, nlev) following the instructions https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort.shtml

ip=dim_pqsort(x,-2);; descending order
y=y(ip,:,:,:)

However, there are error messages: “fatal:Illegal subscript. Subscripts must be scalar or one dimensional vectors”.
Ps: the version of NCL I used is 6.5.0

Could please help me on this problem?

Thanks,
Huiping


More information about the ncl-talk mailing list