6 # Don't edit the line below, it must look exactly like this.
7 # Everything above this line will be replaced #
17 my $cmd_line = $0 . " " . join( " ", @ARGV );
19 ## Configure the command line parsing
20 Getopt::Long::config("auto_abbrev");
23 ## Declare the options
27 my %optional_options = ("lst:s"=>'',
31 my $res = GetOptions( \%options,
32 @common_options::get_opt_strings,
33 keys(%required_options),
34 keys(%optional_options) );
37 common_options::set_globals( \%options, 'pind' );
38 common_options::get_defaults( \%options, 'pind' );
39 common_options::sanity_checks( \%options, 'pind' );
43 $help_text{Pre_help_message} = <<'EOF';
46 Perl script for individual probabilities.
51 $help_text{Options
} = <<'EOF';
54 The options are given here in their long form. Any option may be
55 abbreviated to any nonconflicting prefix. The -threads option
56 may be abbreviated to -t(or even -thr) but -debug may not be
57 abbreviated to -d because it conflicts with -debug_packages and
60 The following options are valid:
63 $help_text{-h
} = <<'EOF';
66 With -h or -? pind will print a list of options and exit.
69 $help_text{-help
} = <<'EOF';
72 With -help pind will print this, longer, help message.
75 $help_text{-lst_file
} = <<'EOF';
78 Optional, the lst-file from where to read initial parameter estimates.
79 Default is the same name as the model file but with .mod replaced with .lst.
82 $help_text{-ind_param
} = <<'EOF';
85 Optional, default eta. The parameter to set in individual ofv model files.
86 Possibilities are eta or theta.
90 $help_text{Post_help_message
} = <<'EOF';
91 Also see 'execute -help' for a description of common options.
94 common_options
::online_help
( 'pind', \
%options, \
%help_text, \
%required_options, \
%optional_options);
96 ## Check that we do have a model file
97 if ( scalar(@ARGV) < 1 ) {
98 print "A simulation model file must be specified. Use 'pind -h' for help.\n";
102 if( scalar(@ARGV) > 1 ){
103 print "PIND can only handle one modelfile, you listed: ",join(',',@ARGV),". Use 'pind -h' for help.\n";
108 if (defined $options{'lst_file'}){
109 $lst_file=$options{'lst_file'};
111 #assume modelfile ends with .mod
112 $lst_file = (substr ($ARGV[0],0,-3)).'lst'; #keep from beginning, skip last four characters
113 unless ( -e
$lst_file ){
114 print "When option -lst_file is omitted, the name of the lst-file is assumed to be the same\n".
115 "as the modelfile except that the last three letters are lst. Cannot find file $lst_file.\n";
120 unless ( defined $options{'clean'} ){
121 # Clean may be changed by default
122 $options{'clean'} = 1;
125 my $eval_string = common_options
::model_parameters
(\
%options);
127 my $model = model
-> new
( eval( $eval_string ),
128 extra_output
=> ['fort.80'],
129 filename
=> $ARGV[0],
130 ignore_missing_output_files
=> 1 );
132 my $pind = tool
::pind
->
133 new
( eval( $common_options::parameters
),
135 lst_file
=> $lst_file,
136 ind_param
=> $options{'ind_param'}
140 open(CMD
, ">", $pind -> directory
. "/command.txt");
141 print CMD
$cmd_line, "\n";
146 open( TMP
, ">", 'ofv.done' );
151 #$pind -> prepare_results;
152 #$pind -> print_results;