-- We start with telling EnKF where it can find various files it will
-- need for the simulation. The files can either have absolute pathsm
-- or be relative to the location of this configuration file.


-- EnKF needs an existing GRID or EGRID file.
GRID              /private/masar/enkf/Testcases/Common/ECLIPSE/EXAMPLE_01_BASE.EGRID


-- We must have a valid SCHEDULE file.
SCHEDULE_FILE     /private/masar/enkf/Testcases/Common/ECLIPSE/target.SCH  


-- We must have a DATA file. This file has been updated for EnKF use.
DATA_FILE         /private/masar/enkf/Testcases/SimpleEnKF/Example_01_base.data



-- EnKF is based on restarting the ECLIPSE simulations. To get this to
-- work we have to separate out the EQUIL section of the data file into a
-- separate file. 
EQUIL_INIT_FILE   /private/masar/enkf/Testcases/Common/ECLIPSE/EQUIL.INC



-- This is where you want EnKF to run the ECLIPSE simulations. The
-- directory you give here MUST contain a '%d' format specifier; the %d
-- is replaced with the realization number when EnKF is running. If you
-- are using LSF or RSH to run the simulations RUNPATH must point to an
-- nfs mounted volume.
RUNPATH           Simulations/Real%d



-- The variable ENSPATH tells EnKF where the results should be
-- stored. Observe that EnKF loads the 'interesting' results from the
-- simulation directories, and then afterwards stores them in maaaaany
-- files located under the ENSPATH directory.
ENSPATH           Ensemble



-- As explained in the documentation of ENSPATH EnKF loads the results
-- it needs from the simulations, and then just forget them. The
-- default is to delete the simulation directories after the
-- simulation is complete. But if you want to look at the simulations
-- with for example S3Graph or something else, you can tell EnKF to
-- leave them hanging around. The KEEP_RUNPATH variable takes extra
-- integers to specifiy which realizations to keep. You can specify a
-- list of realizations separated with ',', a range separated with
-- '-', or a combination:
KEEP_RUNPATH     0,2,4-5,7-10



-- Some results from the EnKF simulation are stored in this
-- directory. Not very much results. Must contain a '%d' format
-- specifier, which is replaced with the report step at runtime.
RESULT_PATH       Results/%04d



-- What do you want to call your simulations? You can invent any name
-- you want, but the name should contain '%d' format specifier. The %d
-- is replaced with the realisation number at run time.
ECLBASE           EXAMPLE_01_BASE_%04d



-- With the keyword DATA_KW you can assign arbitrary (KEY , VALUE)
-- pairs where all occurences of <KEY> in the ECLIPSE DATA file are
-- replaced with VALUE. This can be used for anything.  
-- 
-- The ECLIPSE DATA files typically have many include statements where
-- they include relperm tables, pvt data, lift curves ++++. Since the
-- EnKF simulations are run from all-over-the-place filesystem-wise it
-- can be quite tricky to get relative paths correct, and it is HIGHLY
-- recommended to use absolute paths. One use of DATA_KW which we have
-- been quite happy with is to set:
-- INCLUDE
--    '<INCLUDE_PATH>/example_pvt.txt'
-- in the DATA file, and then use DATA_KW to give a value for
-- INCLDUE_PATH. This way it is quite easy to move the simulations
-- around. When used in this way the INCLUDE_PATH should be absolute.
--
--
-- Observe that you must update the value of INCLUDE_PATH to point to
-- where the ECLIPSE include files are. If for instance you have unpacked
-- the testcase as
--
--   /project/fieldA/ressim/EnKF/Testcases/SimpleEnKF
--   /project/fieldA/ressim/EnKF/Testcases/Commmon/ECLIPSE
--   ......
--
-- You must set INCLUDE_PATH to the value:    /project/fieldA/ressim/EnKF/Testcases/Commmon/ECLIPSE
DATA_KW          INCLUDE_PATH   /private/masar/enkf/Testcases/Common/ECLIPSE
--DATA_KW          INCLUDE_PATH       --- Here you must set the path to ECLIPSE include files - and that
                                    --- depends on where in the filesystem you have installed the testcase.

-- This is how the ensemble should be simulated forward. The standard
-- here is ECLIPSE100, but you can add whatever jobs you want both
-- before and after ECLIPSE. The jobs you use here must be 'installed'
-- in the EnKF system. That is typically done in the global (site)
-- configuration file - for slightly more advanced users ...
FORWARD_MODEL     ECLIPSE100



-- How do you want to run the simulations? There are three different
-- possibilities:
-- 
--   LOCAL: Will run on the machine you are currently logged on to.
--   LSF  : Will submit to LSF (if you are on xStatoil you must issue
--          the command 'source /prog/LSF/config/cshrc.lsf' from the 
--          shell before starting EnKF.
--   RSH  : Will run on a list of hosts with rsh/ssh commands. Requires 
--          that you have already set up passwordless login.
--
-- LSF will in most cases be the natural choice.
QUEUE_SYSTEM      LSF



-- What is the maximum number of parameters you will submit to the LSF
-- queue? EnKF implements it's own 'queue-system', only submitting 
-- max MAX_RUNNING_LSF jobs to the queue system.
MAX_RUNNING_LSF   10



-- From where do you want to get the observed data (for well
-- rates). The default is to get them from the SCHEDULE file. But it
-- is also possible to get the observed data from a reference case
-- (i.e. a truth case). If you get rates from the refcase you can
-- either get them from the historical rates (REFCASE_HISTORY) or from
-- the observed rates (REFCASE_SIMULATED). If you use a refcase for
-- observed data you also must supply the full path to a DATA file for
-- the refcase you consider. 
-- The default is to use the SCHEDULE file - if that is your choice
-- you do not have to enter anything (HISTORY_SOURCE SCHEDULE to get
-- the default).
HISTORY_SOURCE  REFCASE_SIMULATED
REFCASE         /private/masar/enkf/Testcases/Common/Refcase/EXAMPLE_01_BASE.DATA





-- How many realizations do you want to use?
NUM_REALIZATIONS  11


-- Here comes the parameters you want to to update. The general structure
-- for the parameters is as follows:
-- 
--  1. The type of parameter - here it is GEN_KW which can be usd for nearly anything.
-- 
--  2. A unique keyword for the parameter, this can be any string. This
--     keyword is used to identify the parameter when you want to
--     plot/look at results/... 
-- 
--  3. For the GEN_KW parameters you have to supply a template file. The
--     template file should contain <xxxx> keywords which are replaced
--     with values by EnKF. In the case of MULTFLT no template is
--     necessary - EnKF knows how to write a file with MULTFLT
--     multipliers.
-- 
--  4. Then comes the name of the file EnKF should generate. Here you can
--     use whatever filename you want, but it should be the same in
--     ECLIPSE data file.
-- 
--  5. The last column points to an input file, which defines the names
--     of the parameters you want to estimate, and their initial
--     distribution.
-- 
-- Requirements: EnKF is quite flexible when it comes to names of files,
-- where you store things and so on. But there are some things which you
-- must manuall ensure that are consistent:
-- 
--  1. The template file contains <xxxx> keywords, in the case of
--     GRID_PARAM_TEMPLATE the keywords are <MULTPV2> and
--     <MULTPV3>. These strings (without '<' and '>') must also be
--     present in the file defining initial distributions,
--     i.e. GRID_PARAMS.txt in this case. If you mess up on this you will
--     not get any error from EnKF, but your simulations will fail.
-- 
--  2. The name of the file generated by EnKF, i.e. MULTFLT.INC,
--     GRID_PARAMS.INC and FLUID_PARAMS.INC must be correctly included in
--     the ECLISPE DATA file. Again you will not get any message from
--     EnKF if you mess up - but the simulations will fail.
GEN_KW            MULTFLT         /private/masar/enkf/Testcases/SimpleEnKF/Templates/MULTFLT_TEMPLATE      MULTFLT.INC       /private/masar/enkf/Testcases/SimpleEnKF/Parameters/MULTFLT.txt
GEN_KW        	  GRID_PARAMS     /private/masar/enkf/Testcases/SimpleEnKF/Templates/GRID_PARAM_TEMPLATE   GRID_PARAMS.INC   /private/masar/enkf/Testcases/SimpleEnKF/Parameters/GRID_PARAMS.txt   
GEN_KW            FLUID_PARAMS    /private/masar/enkf/Testcases/SimpleEnKF/Templates/FLUID_PARAM_TEMPLATE  FLUID_PARAMS.INC  /private/masar/enkf/Testcases/SimpleEnKF/Parameters/FLUID_PARAMS.txt   




-- EnKF updates not only the parameters, but also the dynamic state
-- variables like pressure and saturations. The strings 'PRESSURE',
-- 'SWAT', 'SGAS', 'RS' and 'RV' correspond to the solution section
-- keywords in the ECLIPSE restart files and are 'magic'. The string
-- DYNAMIC is essential to signal that this is a dynamic field (i.e. a
-- field which changes with the forward model). If you want you can
-- specify minimum and maximum values with MIN:xxx and MAX:yyy - that is
-- not necessary.
FIELD    PRESSURE      DYNAMIC   
FIELD    SWAT          DYNAMIC   MIN:0   MAX:1  
FIELD    SGAS          DYNAMIC   MIN:0   MAX:1
FIELD    RS            DYNAMIC   MIN:0   
FIELD    RV            DYNAMIC   MIN:0



-- By default EnKF internalizes (i.e. loads into the EnKF 'database')
-- all summary variables which you are observing. However you can add
-- more summary variables with the keyword SUMMARY. The main reason
-- for doing this is to be able to plot the variables from the EnKF
-- plotting system.
-- The syntax here first the type of variable you are considering,
-- i.e. WWCT or RPR, and then after a ':' the extra information you
-- need make it unique - i.e. the well name for WWCT and the region
-- number for RPR.
SUMMARY  FOPT
SUMMARY  WOPT:OP_1
SUMMARY  WOPT:OP_2
SUMMARY  WOPT:OP_3
SUMMARY  WOPT:OP_4
SUMMARY  WOPT:OP_5



-- The observations are entered in a separate file ('observations' in
-- this case). It is documented there.
OBS_CONFIG         /private/masar/enkf/Testcases/SimpleEnKF/observations





