This function selects a variable by its capability name and sets the requested values at the requested dates. The units must also be supplied as a single string (heterogeneous units are not supported). These are checked against the expected unit in the code, and an error is signaled if they don't match (i.e., there is no attempt to convert units).