[ncl-talk] question about sorting

Marston Johnston shejo284 at gmail.com
Thu Sep 14 06:26:27 MDT 2017


Hi,

Have a look at https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort.shtml
I think it can do what you want. Give it a try with your test example. The examples are pretty good.

/M

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marston S. Ward, PhD
Department of Earth Sciences
University of Gothenburg, Sweden
Email: marston.johnston at gu.se
SkypeID: marston.johnston 
Phone: +46-31-7864901 
Only the fruitful thing is true!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

On 2017-09-14, 14:20, "ncl-talk on behalf of Damjan Jelić" <ncl-talk-bounces at ucar.edu on behalf of damjan.jelic at fmf.uni-lj.si> wrote:

    Dear NCL support,
    
    i have perhaps a bit silly question but i stuck up and have to ask:
    
    suppose i have 2D array like:
       2015     1     1
       2016     2     1
       1981     1     2
       1982     1     0
       1981     0     2
    how can i sort it out in a way that first column is from 1981-2016 but 
    rows stay attached to the year so on the end it looks like this:
    
       1981     1     2
       1981     0     2
       1982     1     0
       2015     1     1
       2016     2     1
    
    the order within same year (1981) is not relevant.
    Is there some NCL function for that and how to use it correctly?
    
    Kindly,
    Damjan
    _______________________________________________
    ncl-talk mailing list
    ncl-talk at ucar.edu
    List instructions, subscriber options, unsubscribe:
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    




More information about the ncl-talk mailing list