[ncl-talk] dim_minind

Dennis Shea shea at ucar.edu
Wed Feb 15 11:37:10 MST 2017


Several offline communications later ...

Ruben provided a nice (small) dataset to test for the 6.4.0 dim_minind
function.
FTR: the 6.4.0 dim_minind works fine.

==
The real problem was how to use the returned 2D index  index_min(lat,lon).
Ruben's ultimate objective was to use the returned index values to access a
different variable.

Array indexing using an array of indices works differently in different
languages. In this case, it is best to use an explicit 'do loop'.

[SNIP]
; get 'time index' where the min value occurs

  sst_minind = dim_minind(sst,0)               ; 6.4.0
  printVarSummary(sst_minind)
  printMinMax(sst_minind,0)

; use indices to extract values: *must* use explicit 'do'
; Let 'X' be the different variable

  do nl=0,nlat-1
    do ml=0,mlon-1
       XMIN(nl,ml) = (/ X(sst_minind(nl,ml),nl,ml) /)   ; (/ ... /) avoid
warning message
    end do
  end do



On Tue, Feb 14, 2017 at 11:16 AM, Mary Haley <haley at ucar.edu> wrote:

> I know this was provided offline, but I'll include it here in case anybody
> else needs it. --M
>
>
> On Tue, Feb 14, 2017 at 9:23 AM, Ruben van Hooidonk <rubski at gmail.com>
> wrote:
>
>> Hi,
>>
>> Does anyone have a workaround for the function "dim_minind" which will
>> become available in the version 6.4.0?
>>
>> Thanks,
>> Ruben
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170215/9380a567/attachment.html 


More information about the ncl-talk mailing list