-- QUEUE_SYSTEM prevails, but becomes a class.
--
-- This is a singleton class. I.e., it can only have
-- one instance.
--
-- Example:
QUEUE_SYSTEM xHydro_LSF
{
  TYPE     = LSF;
  MAX_JOBS = 10;
};




-- SUBSTITUTION takes over for DATA_KW.
-- Adding support for arbitrary files
-- and keys. Adding support for sourced
-- file.
--
-- Example A: 
SUBSTITUTION my_own_hack
{
  FILENAME = "my_magic_file.txt";
  KEY      = "<BJARNES-STRENG>";
  VALUE    = "SVADAFRANZ_<IENS>";
};

-- Example B:
SUBSTITUTION your_hack
{
  FILENAME = <ECLIPSE_DATA_FILE>;
  KEY      = "__SVADAFRANZ__";
  VALUE    = <IENS>;
};

-- Example C:
SUBSTITUTION our_hack
{
  FILENAME    = "our_file.txt";
  KEY         = "__INSERT_HERE__";
  SOURCE_FILE = "the_data.txt";

};



-- JOB takes over for INSTALL_JOB.
--
-- Example:
JOB STEINFYSIKK
{
  PLATFORM_EXE i386
  {
    EXE = "/bin/old/bein.exe";
  };


  PLATFORM_EXE x86_64
  { 
    EXE       = "/bin/x86_64/bein.exe"; 
  };


  PLATFORM_EXE ia64   
  { 
    EXE = "/bin/ia64/bein.exe";

    -- Special arguments and env for this platform.
    ARGUMENTS = "-finn -olje -some funky special stuff";
    SETENV F_UMFTENDIAN { VALUE = "special"; };
  };


  ARGUMENTS   = "-finn -olje";

  STDIN  = "<RESTART_FILE1>";
  STDOUT = "steinfysikk.stdout";

  LSF_RESOURCES = "det skal gå snabbt!";

};



-- SIMULATION_WORKFLOW takes over for FORWARD_MODEL
--
-- "Simulation workflow" might be more instructive?
-- Not 100% sure though...
--
-- Example:
SIMULATION_WORKFLOW = "RELPERM ECLIPSE100 STEINFYSIKK";



-- SIMULATION_SCHEDULE takes over for ENKF_SCHED_FILE.
--
-- This is a singleton class. I.e., it can only have
-- one instance.
--
-- Example:
SIMULATION_SCHEDULE my_schedule
{
  SEGMENT A
  {
    START               = 0;
    END                 = 10;
    STRIDE              = 5;
    UPDATE              = ENKF;
    SIMULATION_WORKFLOW = "ECLIPSE100 ROCKPHYSICS SEISMIC";
  };


  SEGMENT B
  {
    START               = 10;
    END                 = 100;

    -- Use smoother for this interval
    UPDATE              = ENKS;
  };


  SEGMENT C
  {
    START            = 100;
    END              = 200;
    UPDATE           = NO;
  };
  
};




-- PARAMETER_COLLECTION takes over for GEN_KW.
--
-- Example:
PARAMETER_COLLECTION my_big_collection
{
  -- All the parameters in the collection
  -- subsitutes into the TEMPLATE_FILE.
  TEMPLATE_FILE = "templates/my_template.txt";


  -- File produced in the simulation folder.
  TARGET_FILE   = "my_output.txt";


  SCALAR foo
  {
    -- The key in my_template to subsitute.
    -- This shold probably default to
    -- __INSTANCE_NAME__ or <INSTANCE_NAME>.
    TEMPLATE_KEY       = "<foo>";


    -- Prior distribution can not be used
    -- with MAX, MIN, TRANSFER_FUNCTION
    -- and PRIOR_SAMPLES.
    PRIOR_DISTRIBUTION = "LOGUNIF 0 1";
  };


  -- This parameter behaves like the old GEN_KW,
  -- but reads input from a user provided file
  -- and subsitutes a key different from name.
  SCALAR bar
  {
    TEMPLATE_KEY      = "__MAGIC__";

    -- The file user_provided_realizations.txt shall
    -- contain ascii doubles, one per line.
    PRIOR_SAMPLES     = "user_provided_realizations.txt";
    TRANSFER_FUNCTION = LOG10;
    MAX               = 100;
    MIN               = 1;
  };

  -- User provided covariance matrix.
  --
  -- Note that we cannot use this if not all
  -- parameters are sampled internally!
  -- COVARIANCE_MATRIX = "my_covmat.txt";
};


-- PARAMETER takes over for GEN_PARAM and
-- FIELD * PARAMETER.
--
-- Example A, subsituting FIELD * PARAMETER.
PARAMETER poro
{
  -- Need to have either:
  -- 1. ECL_OUTPUT and KEYWORD (for FIELD * PARAMETER)
  -- or
  -- 2. TEMPLATE_FILE and KEY (for GEN_PARAM).
  ECL_OUTPUT    = GRDECL;
  KEYWORD       = "PORO";
  TARGET_FILE   = "PORO.GRDECL";
  PRIOR_SAMPLES = "poro-%d.grdecl";
};
-- Example B, subsituting FIELD * PARAMETER
PARAMETER permx
{
  ECL_OUTPUT    = "ECLBIN";
  KEYWORD       = "PERMX";
  TARGET_FILE   = "PERMX.BIN"; 
  PRIOR_SAMPLES = "permx-%d.roff";
};
-- Example C, subsituting GEN_PARAM.
PARAMETER surf
{
  TEMPLATE_FILE = "my_surf_template.txt";
  KEY           = "__REPLACE_THIS__";
  TARGET_FILE   = "surface.roff";
  PRIOR_SAMPLES = "surf-%d.txt";
};


-- STATE takes over for FIELD * DYNAMIC
-- and SUMMARY.
--
-- Example A, replacing FIELD * DYNAMIC.
STATE pres
{
  ECL_SOURCE   = RESTART;
  KEYWORD      = PRESSURE;
  MIN          = 100;
  -- Specify UPDATE_SPACE instead of
  -- input and output transform. 
  UPDATE_SPACE = LOG10;
};
-- Example B, replacing SUMMARY.
STATE region_pressure; 
{
  ECL_SOURCE   = SUMMARY;
  KEYWORD      = RPR:10;
  -- Need to think about how this affects observations..
  UPDATE_SPACE = LOG10;
};



SUMMARY_OBSERVATION foobar
{
  KEY      =   WOPR:P1;
  RESTARTS =  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
  VALUES   =  [0, 0, 0, 1, 1, 1, 1, 1, 1, 1];
  ERRORS   =  [1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
}
