Pack a series of variables into a vector under the control of a mask. x = statevector_pack(s,var1, var2, ...) Pack the different variables var1, var2, ... into the vector x. Only sea grid points are retained. Input: s: structure generated by statevector_init. var1, var2,...: variables to pack (with the same shape as the corresponding masks). Output: x: vector of the packed elements. The size of this vector is the number of elements of all masks equal to 1. Notes: If var1, var2, ... have an additional trailing dimension, then this dimension is assumed to represent the different ensemble members. In this case x is a matrix and its last dimension is the number of ensemble members.
Package: divand