Change this to:
```C
if (input_mask)
     mask = bool_vector_alloc_copy( input_mask );
else
     mask = bool_vector_alloc( ens_size , true  );
```
And remove the ```state_map_select_matching( state_map , mask , STATE_HAS_DATA );```