-# open the input file
-my $ifn = $ARGV[0] if $ARGV[0];
-$ifn = "$main::data/wpxloc.raw" if !$ifn;
-open (IN, $ifn) or die "can't open $ifn ($!)";
+my $prefix;
+
+if (@ARGV && $ARGV[0] =~ /^--system$/) {
+ $prefix = $main::data;
+ shift;
+} else {
+ $prefix = $main::local_data;
+}
+
+my $ifn;
+
+$ifn = "$prefix/wpxloc.raw";
+unless (open (IN, $ifn)) {
+ $ifn = "$main::data/wpxloc.raw";
+ open(IN, $ifn) or die "can't open $ifn ($!)";
+}