time_periodic #1475
-
Hi, I'm running parcels looping over a period of time so I use the option time_periodic. I understand the philosophy, but I'm not really sure what it does, since by mistake, I added a period of time longer than the velocity field (I was confused by the time period I want for my run). The code didn't give any problem, as "time_periodic has to be equal to or longer than the time in the fieldset", so when it is longer, what's going on? When the program loops, do the particles jump from the last time step to the first anyway? (Btw, if I'm not wrong, I've seen that the option time_periodic=True does not work anymore, but it still appears in the tutorial documentation: https://docs.oceanparcels.org/en/latest/examples/tutorial_timestamps.html) thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hi @ignasivalles, thanks for asking this question. I must say that we don't often (never?) use As for the expected length, I must admit that this is very confusing, but I think the point is that the last time can be duplicated, see the FYI, the code that then converts the periodic time is below: So in summary, I think that the expectation is that the value of Oh and good catch about the old statement in the tutorial, I'll fix that immediately |
Beta Was this translation helpful? Give feedback.
-
Hi again. Regarding that question, I would like to point out that when you define |
Beta Was this translation helpful? Give feedback.
-
Hi, following this discussion, I'm still confused about how the In any case, what I'm doing now is setting Maybe this is related with #1563 ? |
Beta Was this translation helpful? Give feedback.
Hi @ignasivalles, thanks for asking this question. I must say that we don't often (never?) use
time_periodic
in my group, so I'm not entirely sure whether it still works as originally intended.As for the expected length, I must admit that this is very confusing, but I think the point is that the last time can be duplicated, see the
self.grid._add_last_periodic_data_timestep
variable on line 203 in the code below:https://github.com/OceanParcels/parcels/blob/7e47aa3c26fc25072921c6d9050cd0d58edc0c47/parcels/field.py#L197-L205
FYI, the code that then converts the periodic time is below:
https://github.com/OceanParcels/parcels/blob/7e47aa3c26fc25072921c6d9050cd0d58edc0c47/parcels/field.py#L1…