Hi, In Ferret, anytime you find yourself using REPEAT loops, it's a good idea to think whether there's a way to define an _expression_ that will do the same thing. Here's an FAQ that does something similar to what you're trying: http://ferret.pmel.noaa.gov/FERRET_17sep07/FAQ/analysis/seasonal_masking.html The example in the FAQ has daily data, as yours is, so you will be able to use the example directly to define a mask for days between 1 and 30. It looks as if you have a 360-day year, is that correct? If so, and if the variable in your file were called precip, then yes? LET year_days = MOD(T[GT=precip], 360)This will give you a variable with 30 days of precip data, then 330 days of missing data, and so forth. Try these commands to see what you've done (choosing some location where your data exists to plot precip1) yes? PLOT daily_maskYou could use a COMPRESSL function to put all the January data together without the gaps if that would be useful for your analysis: yes? show function compressL COMPRESSL(DAT) Returns data, compressed along the L axis: Missing points moved to the end DAT: variable to compress in L yes? LET precip_jan = compressL(precip1) ... Peter Szabo wrote: Dear Ferreters, I am using ferret on XP. I have equally spaced daily data in time (30days* 12months* 30years). I would like to eliminate everything but data of january over the years i order that i could do other things with the january data. I tried looking it up in the archives and I tried with the following but have not succeeded yet: ----------------- repeat/l=1:10800:1 (let precip2=if ((`l` ge 1 and `l` le 30) or (`l` ge 361 and `l` ge 390) or (`l` ge 721 and `l` le 750) or (`l` ge 1081 and `l` le 1110) or....(and so on)....) then precip else precip*0.0) ----------------- Does anyone can help me? Peter Szabo elte |