Re: MJO - error in subscript

From: Guilherme Martins <jgmsantos_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 13 2013 - 18:35:30 MDT

Hi Rick,

I did the Maria's suggestion, but I get error. I downloaded the script from
ncl site. The problem I saw is the mon goes 1 to 11 and don't reach 12.

I'll continue testing the script.

Thanks,

Guilherme.

2013/8/13 <brownrig@ucar.edu>

> Maria's two suggestions sounded like good ones. Just to be clear, you
> would do one or the other, but not both (?)
>
> If that doesn't do it, you have a logic error you need to identify. Your
> index "nMon" is going beyond the dimension of "monInfo", and hence the
> error.
>
>
>
> On Tue, 13 Aug 2013 20:16:38 -0300
> Guilherme Martins <jgmsantos@gmail.com> wrote:
>
>> Don't work!
>>
>> If nMon=-1 ==> error here *monInfo(nMon,0) = namMonth(imon(0)-1) ==> line
>> 94*
>> *
>> *
>> I can't understand here:
>>
>> if (iday(nt).eq.1) then
>> * nMon = nMon+1 ==> I have change the position. You told me to
>> put just before the "end if"*
>>
>> monInfo(nMon,0) = namMonth(imon(nt)-1)
>> monInfo(nMon,1) = colMonth(imon(nt)-1)
>> end if
>>
>> Thanks,
>>
>> Guilherme
>>
>>
>> 2013/8/13 <mgehne@ucar.edu>
>>
>> Hi Guilherme,
>>>
>>> either put nMon = nMon+1 just before the "end if" command in your loop
>>> or
>>> initialize with nMon = -1.
>>> That should make nMon go from 0 to 11 instead of 1 to 12.
>>>
>>> Maria
>>>
>>>
>>> > Sorry Rick, but I can't understand. What do I need to do?
>>> >
>>> > if (iday(nt).eq.1) then
>>> > nMon = nMon+1
>>> > monInfo(nMon,0) = namMonth(imon(nt)-1)
>>> > monInfo(nMon,1) = colMonth(imon(nt)-1)
>>> > end if
>>> >
>>> > Where is the error, I can't see.
>>> >
>>> > Thanks,
>>> >
>>> > Guilherme.
>>> >
>>> >
>>> > 2013/8/13 Rick Brownrigg <brownrig@ucar.edu>
>>> >
>>> >> Line 125 is actually the line:
>>> >>
>>> >> monInfo(nMon,0) = namMonth(imon(nt)-1)
>>> >>
>>> >> and a few print statements to show nt, imon(nt) and nMon reveal that
>>> >> nMon
>>> >> ranges from 1-12, and at 12, it exceeds the bounds of monInfo (which
>>> is
>>> >> 12x2)
>>> >>
>>> >> HTH -- Rick
>>> >>
>>> >> On Aug 13, 2013, at 3:20 PM, Guilherme Martins <jgmsantos@gmail.com>
>>> >> wrote:
>>> >>
>>> >> Hi all,
>>> >>
>>> >> I'm run the script "mjoclivar_15.ncl". but I receive the error:
>>> >>
>>> >> fatal:Subscript out of range, error in subscript #0
>>> >> fatal:["Execute.c":8128]:**Execute: Error occurred at or near line
>>> 125 in
>>> >> file mjoclivar_15.ncl
>>> >>
>>> >> I saw the line 125, and the problem I saw is in "nMon = nMon+1"
>>> >>
>>> >> because finish in 11 and not 12.
>>> >>
>>> >> The files are in attach.
>>> >>
>>> >> Thanks,
>>> >>
>>> >> Guilherme.
>>> >>
>>> >> --
>>> >> *Guilherme Martins*
>>> >> https://sites.google.com/site/**jgmsantos/<https://sites.google.com/site/jgmsantos/>
>>> >>
>>> >> <mjoclivar_15.ncl><MJO_PC_**INDEX.novo.nc<http://MJO_PC_INDEX.novo.nc>
>>> >
>>> >> ______________________________**_________________
>>> >> ncl-talk mailing list
>>> >> List instructions, subscriber options, unsubscribe:
>>> >> http://mailman.ucar.edu/**mailman/listinfo/ncl-talk<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>> >>
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > *Guilherme Martins*
>>> > https://sites.google.com/site/**jgmsantos/<https://sites.google.com/site/jgmsantos/>
>>> > ______________________________**_________________
>>> > ncl-talk mailing list
>>> > List instructions, subscriber options, unsubscribe:
>>> > http://mailman.ucar.edu/**mailman/listinfo/ncl-talk<http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>>> >
>>>
>>>
>>>
>>>
>>
>> --
>> *Guilherme Martins*
>> https://sites.google.com/site/**jgmsantos/<https://sites.google.com/site/jgmsantos/>
>>
>
>

-- 
*Guilherme Martins*
https://sites.google.com/site/jgmsantos/

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 13 18:36:25 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 14 2013 - 18:35:09 MDT