sub run ($) {
    print "    $_[0]\n";
    $!=0; system($_[0]); die "$! $?" if $! or $?;
}

sub make_initdata () {
    open I, "$initdata" or die "$initdata $!";
    open B, ">$output.new" or die "$output.new $!";

    $_= <I>;
    m/^(\d+) .*/ or die "$_ ?";

    $dim= $1;

    for ($i=0; $i<$dim; $i++) {
	for (;;) {
	    $!=0; defined($_= <I>) or die "$initdata $!";
	    last if m/\S/;
	}
	print B pack "d", $_ or die $!;
    }

    close B or die $!;
    rename "$output.new",$output or die $!;

    print "    wrote $output\n";
}

1;
