[Thread Prev][Thread Next][Index]

Re: [ferret_users] creating variables in a loop



Hi Lina,

Something like this will work:

use coads_climatology
repeat/range=1:12:1/name=imon ( def symbol imon2 = `imon` ; let var_($imon2) = sst[l=`imon`] )

…creates 12 variables, each with a single month’s data. Just change the 12 to a 40, and add in your calculation.

Paul












> On 24 Jan 2018, at 11:10, Lina Krisztian <linakrisztian5@xxxxxxxxx> wrote:
> 
> Hello ferreters,
> 
> I want to create different variables in a loop like: var_1, var_2, var_3,… 
> The number should be the index of the loop, so if I have a loop like repeat/l=1:40, I want 40 variables with the name var_1, var_2, …., var_40.
> 
> I didn’t find a way to do this. Can you please help me with this problem.
> 
> 
> 
> 




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement