fixed bug in writing initial file in ws3dinv.