set output directory by comandline args. stop optimization when decriment is NaN