Re: How to print the value of a variable from lowest to highest or highest to lowest

From: Ketsiri Leelasakultum <ketsiri.leela_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 10 2010 - 20:05:57 MST

Dear All,
 I could print the value (x1d) from the higest to lowest but I would like to
check that the highest value are in which day? what function should I use?

my program is as below:

        do d =0,30 ;loop day
        do i =0, lat-1
        do j =0, lon-1
        if(.not. ismissing(ref(d,i,j))) then
        if (ref(d,i,j).gt. 3) then ;how many days higher than 3
        exceed(d,i,j)= ref(d,i,j)

        end if
        end if
        end do
        end do

        end do ;
print(exceed)
x1d=ndtooned(exceed)
qsort(x1d)
print(x1d)
Thank you for ncl-talk and all your replies in advance,
Ket
On Fri, Dec 10, 2010 at 9:47 AM, Dennis Shea <shea@ucar.edu> wrote:

> Also note:
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort_n.shtml
>
> On 12/10/2010 11:27 AM, Adam Phillips wrote:
>
>> Hi Ket,
>> Try using qsort to sort the data:
>> http://www.ncl.ucar.edu/Document/Functions/Built-in/qsort.shtml
>>
>> If you have a multi-dimensional array, then you will have to convert it
>> to a 1D array by using ndtooned before you use qsort..
>> http://www.ncl.ucar.edu/Document/Functions/Built-in/ndtooned.shtml
>> Adam
>>
>>
>> On 12/10/2010 11:21 AM, Ketsiri Leelasakultum wrote:
>>
>>>
>>>
>>> Hello !!
>>> I want to print my variable from the lowest to highest or highest to
>>> lowest.
>>> Does anyone has experience with this?
>>> Please suggest.
>>> Thanks,
>>> Ket
>>>
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>
> --
> ======================================================
> Dennis J. Shea tel: 303-497-1361 |
> P.O. Box 3000 fax: 303-497-1333 |
> Climate Analysis Section |
> Climate & Global Dynamics Div. |
> National Center for Atmospheric Research |
> Boulder, CO 80307 |
> USA email: shea 'at' ucar.edu |
> ======================================================
>

--

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Dec 10 20:06:04 2010

This archive was generated by hypermail 2.1.8 : Wed Dec 22 2010 - 16:10:23 MST