generalised to deal with cmip3&5 data