Closed
Description
(@jeanbraun's suggestion)
This could be useful, e.g., for vectorized computation of time-dependent values at the initialize
stage, e.g.,
@xs.process
class SineForcing:
amplitude = xs.variable()
period = xs.variable()
rate = xs.variable(dims='time')
@xs.runtime(args='master_clock_values')
def initialize(self, time):
self.rate = (1 + self.amplitude + self.amplitude * np.sin(1 * np.pi * time / self.period))**5
One big problem, however, is that the rate
variable in the example above should ideally have the same dimension label than the master clock dimension, but the latter is undefined (it is only known when running a model). We could define a specific placeholder, but it gets complicated...
Metadata
Metadata
Assignees
Labels
No labels