<div dir="ltr"><div><div><div><div>Hi Kelly,<br><br></div>I *think* there may be a misplaced parenthsis; you have:<br><br> MaxMonthT(0,i-1) = avg(MaxF(ind(datestrsplit(:,1)).eq.i))<br><br>but perhaps want:<br><br> MaxMonthT(0,i-1) = avg(MaxF(ind(datestrsplit(:,1).eq.i)))<br><br></div>as currently written, I think the sub-expression ind(datestrsplit(:,1).eq.i) is returning an array of type logical, and hence the error message<br><br></div>Hope that helps...<br></div>Rick<br><br><div><div><div><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 2, 2015 at 10:39 AM, Kelly Neugent <span dir="ltr"><<a href="mailto:kjneugent@mail.plymouth.edu" target="_blank">kjneugent@mail.plymouth.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">Hello,</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">I am attempting to run a do loop where I can get it to run monthly, but I keep getting an error message: "fatal:Illegal subscript. Vector subscripts must be integer"</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">MaxMonthT = new((/3,12/),"double")</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">x = new((/3,12/),"float")x = new((/3,12/),"float")</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">do i=1,12,1</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">MaxMonthT(0,i-1) = avg(MaxF(ind(datestrsplit(:,1)).eq.i))</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">MaxMonthT(1,i-1) = max(MaxF(ind(datestrsplit(:,1)).eq.i))</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">MaxMonthT(2,i-1) = min(MaxF(ind(datestrsplit(:,1)).eq.i))</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">x(0,(i-1)) = i</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">x(1,(i-1)) = i</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">x(2,(i-1)) = i</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">end do</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"> I have checked both MaxF and datestrplit by using VarSummary and I have adjusted both of these so that they are integers.</div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">The error occurs on the 4th line shown here---<span style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important;background-color:#ffffff">MaxMonthT(0,i-1) = avg(MaxF(ind(datestrsplit(:,1)).eq.i))</span></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff"><br></div><div style="color:#000000;font-family:arial,helvetica,sans-serif;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:#ffffff">Could you provide any assistance on this matter? Thank you. </div></div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>