<div dir="ltr"><div dir="ltr"><div>Hi Axel,</div><div><br></div><div><b><a href="http://www.ncl.ucar.edu/current_release.shtml">NCL 6.5.0</a></b> has a task parallelism feature created by Rick. <br></div><div><br></div><div>Task Parallelism Examples are at:</div><div><br></div><div><a href="http://www.ncl.ucar.edu/Applications/task_parallelism.shtml"><b>http://www.ncl.ucar.edu/Applications/task_parallelism.shtml</b></a><br></div><div><br></div><div>I wonder if this might be of use.</div><div><br></div><div>Cheers</div><div>D<br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 30, 2018 at 2:09 PM Seifert Axel <<a href="mailto:Axel.Seifert@dwd.de">Axel.Seifert@dwd.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
<p>Hi Dennis and Rick,<br>
</p>
<p><br>
</p>
<p>Thanks for your comments. Yes, the do-loop is kind of slow and would then be the most expensive part of that script. The length of an observation vector is of order 100000 for one hour of satellite data and I have several months of data, which have to be
 processed for multiple model simulations.<br>
</p>
<p><br>
</p>
<p>I can probably restructure my data to avoid double indices, or multiple overpasses, in one observation vector. Alternatively, I could simply ignore that slight loss of data. At least, it would always use the newer data and overwrite the older data. This
 is probably not a bad choice as well.<br>
</p>
<p><br>
</p>
<p>Axel<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div id="m_8366522404430603819divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>><br>
<b>Gesendet:</b> Freitag, 30. November 2018 20:21<br>
<b>An:</b> Rick Brownrigg<br>
<b>Cc:</b> <a href="mailto:Axel.Seifert@dwd.de" target="_blank">Axel.Seifert@dwd.de</a>; Ncl-talk<br>
<b>Betreff:</b> Re: [ncl-talk] index lists in assignment</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>My recollection is that the way fortran and NCL handled 'indirect subscripting' (my words) yielded different results.
<br>
</div>
<div>Hence, the 'expected results' are colored by past expeerience in fortran.</div>
<div><br>
</div>
<div>Unfortunately, I can not find my NCL/fortran   example. Sorry.</div>
<div><br>
</div>
<div>D<br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Fri, Nov 30, 2018 at 11:27 AM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>Hi Axel,</div>
<div><br>
</div>
<div>Apologies in delay in getting back to you on this.  As far as I can tell, the behavior ox "x(idx) = x(idx) + z" is the intended behavior (perhaps not the same as "desired" behavior in your case), in the sense that the right-hand side is completely evaluated
 before the (re)assignment to the variable "x": is performed.</div>
<div><br>
</div>
<div>The do-loop approach does work -- it it just unbearably slow?  Without knowing more about your data, I don't have a suggestion for how to avoid looping.</div>
<div><br>
</div>
<div>Rick</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Thu, Nov 29, 2018 at 10:37 AM Axel Seifert <<a href="mailto:Axel.Seifert@dwd.de" target="_blank">Axel.Seifert@dwd.de</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p><br>
</p>
<p>Maybe I should add that the output of my little script is</p>
<p><br>
</p>
<p>(0)      0 0<br>
(1)      3 4<br>
(2)      2 2<br>
</p>
<p><br>
</p>
<p>This is with NCAR Command Language Version 6.3.0<br>
</p>
<p><br>
</p>
<p>The variables x and y are<br>
</p>
<p><br>
</p>
<p>Variable: x<br>
Type: float<br>
Total Size: 12 bytes<br>
            3 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes:   [3]<br>
Coordinates: <br>
Number Of Attributes: 1<br>
  _FillValue :  9.96921e+36<br>
(0)      0<br>
(1)      3<br>
(2)      2<br>
<br>
Variable: y<br>
Type: float<br>
Total Size: 12 bytes<br>
            3 values<br>
Number of Dimensions: 1<br>
Dimensions and sizes:   [3]<br>
Coordinates: <br>
Number Of Attributes: 1<br>
  _FillValue :  9.96921e+36<br>
(0)      0<br>
(1)      4<br>
(2)      2<br>
<br>
</p>
<p><br>
</p>
<br>
<div class="m_8366522404430603819m_6048245336473263855gmail-m_-6216440519127204226moz-cite-prefix">Am 24.11.2018 um 15:16 schrieb Seifert Axel:<br>
</div>
<blockquote type="cite">
<p><br>
</p>
<p>Hi,<br>
</p>
<p><br>
</p>
<p>I have a somewhat unexpected behavior when using index lists. Here a simplified example:<br>
</p>
<div><br>
</div>
<div>  x = new( 3, float)</div>
<div>  x = 0.0</div>
<div>  y = x</div>
<div>  </div>
<div>  z = (/1.,2.,3./)<br>
</div>
<div>  idx = (/1,2,1/)</div>
<div>  </div>
<div>  x(idx) = x(idx) + z</div>
<div><br>
</div>
<div>  do i=0,dimsizes(idx)-1</div>
<div>    y(idx(i)) = y(idx(i)) + z(i)</div>
<div>  end do</div>
<div><br>
</div>
<div>  print(" "+x+" "+y)</div>
<div><br>
I would have expected that x and y end up being the same, but they are not. The double assignment to index 1 does not work for the vector assignment. Is this the intended behavior for arrays in ncl? <br>
</div>
<div><br>
</div>
<div>How can I get the 2nd behavior and still avoid the do-loop?<br>
</div>
<div><br>
</div>
<div>In my case I am assigning measured values from satellite overpasses to a global grid and it can of course happen that I have multiple overpasses for a grid point in an observation vector. Hence, in addition to the sum of the values I would count the number
 of overpasses<br>
</div>
<div><br>
</div>
<div>
<div>  cnt = (/0,0,0/)</div>
<div>  cnt(idx) = cnt(idx) + 1<br>
</div>
<div>  print(" "+cnt)<br>
</div>
<div><br>
</div>
<div>and then xavg = x/cnt should give me the proper average for, for example, one hour of data. What I need in the end is the correct average for xavg and the number of measurements used at each grid point.<br>
</div>
</div>
<div><br>
</div>
<div>Thanks in advance for any helpful comments and suggestions.<br>
</div>
<div><br>
</div>
<div>Axel<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<p><br>
</p>
<br>
<fieldset class="m_8366522404430603819m_6048245336473263855gmail-m_-6216440519127204226mimeAttachmentHeader">
</fieldset> <br>
<pre>_______________________________________________
ncl-talk mailing list
<a class="m_8366522404430603819m_6048245336473263855gmail-m_-6216440519127204226moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="m_8366522404430603819m_6048245336473263855gmail-m_-6216440519127204226moz-txt-link-freetext" href="https://ssi.dwd.de/mailman/listinfo/,DanaInfo=.ambkoqftG2lk2Lrr9+ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://ssi.dwd.de/mailman/listinfo/,DanaInfo=.ambkoqftG2lk2Lrr9+ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://ssi.dwd.de/mailman/listinfo/,DanaInfo=.ambkoqftG2lk2Lrr9+ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote>
</div>
</div>
</div>
</div>

</blockquote></div>