Template:CMI Example set grid values CXX
From CSDMS
this->log.info ("Setting values.");
{ // Set values through the c-array
const int n_dim = 1;
int shape[1];
int len;
double * x = this->state.get_grid_x (long_var_name, len);
double * vals_ptr = vals.first ();
shape[0] = len;
this->state.set_double (long_var_name, vals_ptr, n_dim, shape);
delete [] x;
}
this->log.info ("Set values.");
return;