setting ndim to dim .. static arrays dimension known at compiler time