Stochastic Mode Input
The keywords shown here control the behavior of the stochastic mode including the EnKF. They are specialized input. Nevertheless, they should be written in the standard Input File.
Table of Contents
- Stochastic Mode Input
- Ensemble Size
- Subsample (not clear)
- Parameters
- Boundary conditions
- Postcomputation
- Global EnKF Iterations
- Output Directories
Ensemble Size
There are two ways to specify a number of ensemble members (used for example in MC or EnKF).
# samples
6
# simulate
6
The internal number of ensemble members is set as follows:
Condition 1 | Condition 2 | Outcome | Default |
---|---|---|---|
runmode >= 2 | "# simulate" exists in the Input File | sm_max read in under "# simulate" and nsmpl = sm_max + 1 | sm_max = 1 nsmpl = 2 |
"# simulate" does not exist | nsmpl read in under "# samples" and sm_max = nsmpl - 1 | sm_max = 1 nsmpl = 2 | |
runmode < 2 | "# simulate" exists | sm_max read in under "# simulate" and nsmpl = sm_max | sm_max = 1 nsmpl = 1 |
"# simulate" does not exist | nsmpl read in under "# samples" and sm_max = nsmpl | sm_max = 1 nsmpl = 1 |
The number of samples is forced to be the number of simulation-samples
plus one. Exception: For the pure forward run (runmode = 1
), the
numbers are equal.
TIP: Just use # simulate
, then the number of samples will
automatically be adjusted to be the simulate value plus one. The first n
samples will be filled with realizations and the last sample with the
mean value of the realizations.
TIP: For a forward run, always set # simulate
to 1
.
Subsample (not clear)
Sample Average Approximation
# subsample
2
Reads in
Variable | Value in Example | Default | Note |
---|---|---|---|
saa_sample | 2 | 1 | MEANING NOT CLEAR, not found anywhere else in the code... |
Does not appear to be used in the code.
Parameters
Preparation for reading the parameters:
# parameter group, records=2
4 parfile=sgsim1.par
2 1 lin
3 1 lin
4 1 lin
5 1 lin
1 parfile=sgsim2.par
1 4 log
The first three lines of the keyword input are now explained in a little more detail:
# parameter group, records=2
The # parameter group
is the standard catch phrase of this input.
records=2
states that parameters from two files will be read.
4 parfile=sgsim1.par
4
sets the number of different parameters (either different unit or
different physical parameter) read in from the parfile
. Under the
keyword parfile
SHEMAT-Suite reads the name of the SGSIM Input
File.
2 1 lin
2
refers to the second unit defined in the input file. 1
refers to
parameter number one (porosity, see table in Rock Matrix Chapter of
the Input File documentation for a list of
all 17 parameters). The addition lin
specifies to use the
distribution from the SGSIM Input File as
probability distribution of the parameter.
1 4 log
Here, the addition log
specifies to use the probability distribution
from the SGSIM Input File as
distribution of the logarithm of the parameter (for example if the
permeability distribution is log-normal, the distribution in the
SGSIM Input File would be normal).
Logarithm conversion
# standard deviation
0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 ! unit 1
0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 ! unit 2
0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 0.5d0 ! unit 3
...
17 deviations are given in different lines (one for each unit in the
unit parameter field of the SHEMAT Input File). Shown in the example
above: The default of the program invoked if the keyword
# standard deviation
is not found. The naming of this input is
confusing, because the values are not used as standard deviations inside
the code. The input is important if there is a logarithmic variable
(such as permeability), which is transformed from a natural logarithm to
a logarithm of base 10. It is recommended to use
log(10) ≈ 2.30258509299d0
instead of 0.5d0
for the fields which will
be randomized by SGSIM and 0.0d0
for every other field.
The following example consisting of four units randomizes the porosity field in unit one, the permeability field in unit two, leaves unit three untouched and randomizes both the porosity and permeability fields in unit four:
# standard deviation
2.30258509299d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0
0.0d0 0.0d0 0.0d0 2.30258509299d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0
0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0
2.30258509299d0 0.0d0 0.0d0 2.30258509299d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0 0.0d0
Standard deviations/variances are read in through the EnKF Input File.
Split units
There is another input-command controlling units:
# split units, records=2
1
2
This command delivers the information, which units to split up, so that each cell formerly belonging to this unit is set to be a unit itself (so a unit consisting of 100 cells will then be turned into 100 units, each consisting of one cell). This command is most important, when using SGSim to simulate different parameter values at each cell inside a certain unit.
Explanation: Parameters
In the stochastic mode, parameters are now specified by their mean and a variation. The mean is saved in the array
propunit ( maxunits , npropload, nsample )
and the variation is calculated according to
lin: < Standard deviation > * < random number (normed Gaussian) > \
log: exp[ < Standard deviation > * < random number (normed Gaussian) > ].
The standard deviations are saved in the array
d_propunit ( maxunits , npropload ).
NOTE: In the end of simul_wrapper
, the numbers in d_propunit
are
used as factors for the simulated values taken from SGSIM simulations,
NOT AS STANDARD DEVIATIONS. They are instead used to handle
conversion between natural and base-10 logarithms or to change a whole
field by a common factor.
Boundary conditions
Boundary condition data and structure:
# bc group, records=1
1 parfile=sgsim1.par
1 lin temp split
In more detail:
# bc group, records=1
# bc group
is the keyphrase. records=1
means that there is only one
parameter file read in.
1 parfile=sgsim1.par
1
means that there is one line of information following
parfile=sgsim1.par
defines the name of the parameter file.
1 lin temp split
1
is the unit-index of the boundary condition lin
is the
specification how the value is given (other possibility: log
) temp
defines the physical property (other possibilites: head
, conc
, etc.)
split
is the keyword to look into ibc_data
and propunit
(see
array.f90
, where a lot of the variables concerning boundary conditions
are declared)
Standard deviation for the boundary conditions
# bc standard deviation, records=1
1 0.01d0 temp
In the second line: 1
is the unit-index. 0.01d0
is the value for the
standard deviation. temp
is the physical property. Default: 1.0d0
for all boundary conditions, no matter, which unit of property.
Postcomputation
A postcomputation switch can be activated.
# enkf postcompute
mean
The variable enkf_post is set to a value depending on input:
Value | Input | Effect | Example above | Default |
---|---|---|---|---|
0 | none | no postcomputation | X | |
1 | samples | postcomputing ensembles | ||
2 | mean | postcomputing mean | X |
Global EnKF Iterations
Number of iterations in the EnKF. This should be set to one, otherwise more than one full EnKF simulation is calculated one after the other, which is usually not what you would want.
# enkf iter
1
Variable maxiter_enkf
is set to the number of global assimilation
iterations given as input. Experience showed that a number less or equal
three should be chosen.
Output Directories
In the end the directories
enkf_output/
05_output/
whose names are specified in mod_simul.f90
, are created (if
runmode
(see Runmode Documentation on Input
File) is greater or equal to two).