#!/usr/bin/perl

# ============================================================================
#
# Name    :  champ.pl   
#
# Purpose :  Start CHAMP BPE process for a particular session
#
# Author  :  F. Christiansen
# Created :  2007-11-29
#
# ============================================================================
use lib $ENV{BPE};
use startBPE;
use bpe_util;

# Check arguments
# ---------------
if (@ARGV != 2 or lc($ARGV[0]) eq "-h") {
  die "\n  Start CHAMP MOD BPE process for a particular session\n".
      "\n  Usage: champ.pl [-h] yyyy ssss\n".
      "\n  yyyy : 4-digit (or 2-digit) year".
      "\n  ssss : 4-character session".
      "\n  -h   : Display this help text\n\n" }

# Create startBPE object
# ----------------------
$bpe = new startBPE();

# Redefine mandatory variables
# ----------------------------
$$bpe{PCF_FILE}     = "SWARM";
$$bpe{CPU_FILE}     = "USER";
$$bpe{BPE_CAMPAIGN} = "SWARM";
$$bpe{YEAR}         = $ARGV[0];
$$bpe{SESSION}      = $ARGV[1];
$$bpe{SYSOUT}       = "CHAMP";
$$bpe{STATUS}       = "CHAMP.RUN";
$$bpe{TASKID}       = "CH";

# Reset CPU file
# --------------
$bpe->resetCPU();

# Start BPE process
# -----------------
print "\nCHAMP BPE process started on ".timstr(localtime(time))."\n";
$bpe->run();

# BPE process finished
# --------------------
print "CHAMP BPE process finished on ".timstr(localtime(time))."\n\n";

__END__ 

