7 # Don't edit the line below, it must look exactly like this.
8 # Everything above this line will be replaced #
14 use File::Copy qw/cp mv/;
18 my %optional_options = ( "output_model:s" => undef );
20 my $res = GetOptions( \%options,
21 @common_options::get_opt_strings,
22 keys(%optional_options) );
27 die "You must at least enter a model file name\n";
31 my $model = model -> new ( filename => $ARGV[0],
32 ignore_missing_output_files => 1 );
35 die "No such file: $ARGV[0]\n";
40 if( $options{'output_model'} ){
41 $model_copy = $model -> copy( filename => $options{'output_model'} );
48 $output = output -> new( filename => $ARGV[1] );
51 die "No such file: $ARGV[1]\n";
55 } elsif( defined $model -> outputs and -e $model -> outputs -> [0] -> filename ){
57 $output = $model -> outputs -> [0];
61 die "No outputfile to update from\n";
66 if( defined $model_copy ){
68 $model_copy -> update_inits( from_output => $output );
69 $model_copy -> _write;
73 cp( $ARGV[0], $ARGV[0].'.org' );
75 $model -> update_inits( from_output => $output );