Re: Script to tally days below a given temperature - DO LOOP issue

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 04 2012 - 13:27:27 MDT

Also, if you have 9 ensembles, then your do loops should span 0,8
NCL subscripts are 0-based like C, not 1-based like fortran, Matlab, ...

So using DaveA's suggested naming

Change
   do ensemble = 0,9,1 ; ENSEMBLE LOOP MODELS 0,1...7,8
To
   do ei = 0,8,1 ; ENSEMBLE LOOP MODELS 0,1...7,8

As in fortran and other languases the default stride is one (1) so
you do not need an explicit stride

   do ei = 0,8 ; ENSEMBLE LOOP MODELS 0,1...7,8

On 6/4/12 1:13 PM, Dave Allured wrote:
> Dominique,
>
> The variable "ensemble" is an array before you start using it as the
> index of a do loop. My guess is that you just need a new name for
> your loop index, perhaps "iensemble" or "ei".
>
> --Dave
>
> On Mon, Jun 4, 2012 at 12:56 PM, Cannavina, Dominique
> <d.cannavina11@imperial.ac.uk> wrote:
>>
>>
>>
>> Hi
>>
>>
>>
>> I am writing a script to count the number of occurances for given number of
>> consecutive days that a temperature falls below a given temperature. The
>> data I am am using is from the DEMETER project and each file contains 3
>> different models each running 9 ensembles to give daily minimum
>> temperatures. The domain covering Europe.
>>
>>
>>
>> WhenI run the attached script I get the following error in the DO LOOP
>>
>>
>>
>> fatal:Loop variable must be scalar, can't execute loop
>>
>>
>>
>> I am not sure how to work around this as I need to loop through the days and
>> ensemble runs for each model?
>>
>>
>>
>> Any help would be much appreciated.
>>
>>
>>
>> Kind regards
>>
>>
>>
>> Dominique
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 4 13:27:49 2012

This archive was generated by hypermail 2.1.8 : Wed Jun 06 2012 - 15:17:44 MDT