<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.gmail-p1, li.gmail-p1, div.gmail-p1
{mso-style-name:gmail-p1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.gmail-s1
{mso-style-name:gmail-s1;}
span.gmail-apple-converted-space
{mso-style-name:gmail-apple-converted-space;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1816532765;
mso-list-type:hybrid;
mso-list-template-ids:694345274 737207300 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style>
</head>
<body lang="EN-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Barry<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It’s a bit difficult to tell what you’re trying to do from that code snippet. I *<b>think</b>* you have 3 arrays : dcsi(Npod, Nsr), pod_7 (Npod * Nsr) and sr_7 (Npod*Nsr). You’re trying to replace values of pod_7 and sr_7 , where dcsi=700,
with monotically increasing numbers with a stride of 0.001. If so, then the following will do that eliminating the loop; I don’t think the where() function will help here though<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is assuming I’ve understood what you’re trying to do (and I’m not sure about that)….<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Will<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">;---------------------<o:p></o:p></p>
<p class="MsoNormal">dcsi1D = ndtooned(dcsi) ;1-d array, same shape as pod_7 and sr_7<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">ii = ind(dcsi1D.eq.700.)<o:p></o:p></p>
<p class="MsoNormal">N = dimsizes(ii)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">newval = fspan(0., (N-1)*0.001, N) ; new array of replacement values<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">pod_7(ii) = newval<o:p></o:p></p>
<p class="MsoNormal">sr_7(ii) = newval<o:p></o:p></p>
<p class="MsoNormal">;------------------ <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">ncl-talk <ncl-talk-bounces@ucar.edu> on behalf of Barry Lynn via ncl-talk <ncl-talk@ucar.edu><br>
<b>Reply-To: </b>Barry Lynn <barry.h.lynn@gmail.com><br>
<b>Date: </b>Friday, 6 September 2019 at 6:51 AM<br>
<b>To: </b>ncl-talk <ncl-talk@ucar.edu><br>
<b>Subject: </b>[ncl-talk] Is there a where statement for this?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hello: <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I am wondering if there is someway to speed up a loop like this.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black"> </span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">do i_pod = 1,n_pod-1</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">do i_sr</span></span><span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">= 1,n_sr-1</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">if (dcsi(i_pod,i_sr).eq.700)then</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">pod_7(i_val) = tofloat(i_pod)*.001</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">sr_7(i_val) = tofloat(i_sr)*.001</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">i_val = i_val + 1</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">end if</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">end do</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0cm;margin-bottom:.0001pt;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:16.5pt;font-family:"Courier New";color:black">
</span></span><span class="gmail-s1"><span style="font-size:16.5pt;font-family:"Courier New";color:black">end do</span></span><span style="font-size:16.5pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Barry H. Lynn, Ph.D <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">Senior Associate Scientist, Lecturer,<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#888888">The Institute of the Earth Science, <br>
The Hebrew University of Jerusalem, <br>
Givat Ram, Jerusalem 91904, Israel </span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="color:#888888">Tel: 972 547 231 170<br>
Fax: (972)-25662581</span><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p style="font-size:10pt; line-height:10pt; font-family: Calibri,sans-serif;"><br>
<br>
University of Tasmania Electronic Communications Policy (December, 2014). <br>
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained
in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
</p>
</body>
</html>