Hello,
I'm looking for a function or method to programm a this loop : if frost_risk = 1 so growth=0 then the growth vector shoud restart from beguinning (it should return the first value of growth vector keeping the main order).

I am not entirely sure if I understand what you need. This code loops trough the values of frost_risks and returns the values of growth in order. Everytime the loop encounters a 1 in frost_risk, it starts again with the first value of growth.