As a side note, your MVectors
are still mutable even if the State
as a whole is not mutable. Thus, if the scalars do not have to be mutable (or if only a a few of them have), you may better choose to use an immutable struct.
(mutating a scalar in an overall immutable struct requires some strategy of the ones described here)
Also, Parameters
offers the @unpack
macro, which can be used with, for example:
@unpack v_wind, area = s
where s
is of type State
, in a function that you might be using only these two variables among all those contained in the struct.