[ncl-talk] Loop Breaking on 3rd pass

Zach Rieck zrr817 at gmail.com
Thu May 9 20:05:23 MDT 2019


That was my thought initially as well, but I actually have the code wired
to handle that. The loop only runs for the length of the years -1, so i+1
should pull in the last value.

I didn't include the error since it was vague and didn't seem to tell me
anything. All it said was fatal exec and pointed to the line where I pull
on the gridpoint value in the loop.

-Zach Rieck
zrr817 at gmail.com
(513)-502-5652

On Thu, May 9, 2019, 7:16 PM Rick Brownrigg <brownrig at ucar.edu> wrote:

> Hi Zach,
>
> Its always helpful to include error messages.  If I were to speculate, I'd
> say its probably this line:
>
>     e_date1 = years(i+1) + "033100"
>
> The "i+1" probably exceeds the dimensionality of the variable years
>
> Rick
>
>
> On Thu, May 9, 2019 at 6:11 PM Zach Rieck <zrr817 at gmail.com> wrote:
>
>> That just about did it! I made a few minor changes to the array lengths
>> and added the colon and it now runs until the final pass through before
>> breaking. I'm not sure why though, I can query all the values for that pass
>> without any issue.
>>
>> Attached the updated code with the changes. Thanks for the help and
>> patience!
>>
>> -Zach Rieck
>> zrr817 at gmail.com
>> (513)-502-5652
>>
>>
>> On Thu, May 9, 2019 at 7:51 AM Dennis Shea <shea at ucar.edu> wrote:
>>
>>> NCL is strongly typed. By default, NCL will not allow different size
>>> arrays to the left and right of the assignment operator [ *=* ].
>>>
>>> Use NCL's reassignment operator   *:=*
>>>
>>> WRF_gridpoints *:=* f_in[:]->PREC_ACC_NC(s_time3:e_time3,553,412)
>>> ===
>>> *https://www.ncl.ucar.edu/Document/Language/varb_assign.shtml*
>>> <https://www.ncl.ucar.edu/Document/Language/varb_assign.shtml>
>>>
>>> On Wed, May 8, 2019 at 7:02 PM Zach Rieck <zrr817 at gmail.com> wrote:
>>>
>>>> To Whom it May Concern-
>>>>
>>>> I have a loop where I am trying to pull precip for different time
>>>> periods for each winter. The loop is successfully pulling in the write
>>>> dates and totals, and runs EXACTLY how it is supposed to until the 3rd pass
>>>> through. I'm confused by this since if the loop wasn't repeatable it should
>>>> error out no later than the 2nd pass. The error I am getting is that on the
>>>> 3rd pass, the left and right side dimensions do not match when I try to
>>>> pull in the gridpoint data
>>>>
>>>> I have verified the lengths on my variable and all are long enough to
>>>> pass through the loop as they are meant to. The loop is at the end of the
>>>> code, from ~ line 73-78.
>>>>
>>>> Thanks for the help!
>>>>
>>>> -Zach Rieck
>>>> zrr817 at gmail.com
>>>> (513)-502-5652
>>>> _______________________________________________
>>>> 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/20190509/16a5e6f0/attachment.html>


More information about the ncl-talk mailing list