ind of any or any of any?

From: Kristina Fröhlich <kristina_froehlich_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 17 2013 - 07:18:15 MDT

Dear all, I wonder if there is a functionality that allows me to use the functions ind or any by using a list of values. At the moment, its possible to select a specific value of or a well defined portion out of a field like in the example x = new(5,float,-999) x = (/1.,2.,-999,4.,5./) print(any( ; should be True print(any( ; should be False print(any( ; should be False but what happens if I want to select a (bigger) list of values which are not necessarily ordered monotonically increasing or decreasing? For instance, I have a time series of monthly means over several years and now want to get out specific months (e.g. monlist=(/5,6,7,8,9,10,11/) ) per year. At the moment I need to write SEASlist=ind( ( (omonth .ge. 5) .and. (omonth .le. 11)) ) or monlist=(/11,12,1,2,3,4,5/) SEASlist=ind( ( (omonth .le. 5) .or.( omonth .ge. 11)) ) but you see, that the procedure is crucially dependent on which months I do start with my timeseries and how  many months I want to have. Trying the function "all" like " mylist = ind(omonth .eq. all(monlist))" unfortunately does not help. I would be happy if something would work like monlist=(/11,12,1,2,3,4/) SEASlist=ind( ( omonth .eq. any/all(monlist) ) Is there an elegant way to do this? best regards, Kristina

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Tue Sep 17 07:18:28 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 18 2013 - 17:07:30 MDT