 
 
 
 
 
 
Controlling program flow across cells
- To: mathgroup at smc.vnet.net
- Subject: [mg54368] Controlling program flow across cells
- From: semiclassical at hotmail.com (semiclassical)
- Date: Sat, 19 Feb 2005 02:32:22 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Here is the problem:
I import a large data file - 20 years of hourly observations, which is
used to populate a raw data list of approximately 176,000 rows with
the following structure:
    
{year, day, hour, validity_Flag, data_Item1, ... ,data_Item5}
The list is then parsed, filtered and operated upon in several
different ways. In particular I calculate statistical properties of a
specified 5 year period. The process is encapsulated in a number of
cells-
Cell_1 : Parse[ Import and filter raw data ];
Cell_2a: Parse[ Chip out and sort period of interest ];
Cell_2b: Calculate[ statistical properties of validity_Flag ];
Cell_2c: Calculate[ statistical properties of data_Item ];
Cell_2d: Calculate[ distribution of data_Item ];
This is done for most data_Items, additionally calculations are made
for hourly statistics and quartely statistics. Now what I would like
to be able to do is loop over the four 5 year periods within the
complete 20 year span. Here are two questions:
1. I would like to set up a For[] loop across Cell_2a-Cell_2d to loop
through the four periods of interest. How can I do this, or should I
actually have built the program in a different way?
2. How can I get output from within a For[] loop as it is executing?
For example, I might like to watch some value of a given variable
within the loop as it is calculated (in C I would use a printf). 
Thanks,
Aaron
semiclassical at hotmail.com

