move release Wiki to open-source repository authored by Johannes Keller's avatar Johannes Keller
# Deterministic Inversion Input
## Methodology
The SHEMAT-Suite provides an approach for deterministic Bayesian inversion. Its specialty is that derivates are calculated by Automatic Differentiation (AD) instead of divided differences. The approach and methodology is explained in [Rath et al. (2006)](https://academic.oup.com/gji/article/167/1/453/2085661).
## Compilation
Deterministic Inversion for parameters is available in SHEMAT-Suite when
compiling with the `ad`-mode flag instead of `fw` or `sm` (note that you might have to checkout the respective code-branch that contains the AD-code-files).
## Input file adaptions
**1. Set runmode 2 or 3.**
```
# runmode
2
```
**2. Give measurement data**
```
# data, records=1
20.3 0.5 50 1 20 2 1
!<value> <error> <i-index> <j-index> <k-index> <variable-flag> <flag>
```
The variable-flag defines for which variable the measured value is given: 1=head, 2=temperature.
**3. Specify inversion options**
**3.1 Options for parameter optimization**
```
# errors
0.0 0.0 0.0 6.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 6.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
```
`# errors` defines the uncertainty range of the 17 parameters. Each
entry stands for a property (one of 17) of a unit. Each row represents
the according unit. In the example above, log(permeability) would range
over 6 magnitudes.
```
# enable unit
0 1
```
| Property | Meaning |
| ------ | ------ |
| 0 | not activated for inversion |
| 1 | activated for inversion |
Analogue to `# enable unit` there is the command
```
# enable property
1 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0
```
| Property | Meaning |
| ------ | ------ |
| 0 | not activated for inversion|
| 1 | activated for inversion, linear |
| 2 | activated for inversion, logarithmic |
So in this example, porosity and permeability of unit 2 of 2 are enabled for
inversion, with porosity varying linearly and permeability logarithmically.
**3.2 Options for boundary condition optimization**
Another option is to invert for boundary conditions. We distinguish between stationary boundary conditions and time-dependent boundary conditions. The following keywords specify the according options:
```
# bcerrors, records=1
1 0.005 temp
!<bc-unit> <error> <pv-type>
```
| Property | Values/Meaning |
| ------ | ------ |
| bc-unit | Specifies the bcindex that is defined at the respective bc-input ([Boundary condition section](./input_file)) |
| pv-type | head / temp / conc |
a) for stationary boundary conditions
```
# optimize bc, records=1
1 1 temp
!<bc-unit> <1 (lin)/2 (log)> <pv-type>
```
b) for time-dependent boundary conditions
```
# optimize tp, records=1
!<tp entry index> <bc index number> <alphy-beta keyword>
```
Here the bc-index needs to be assoziated with a unit number and defines this the dependency to the tp period table
(where to find the tp-entry).
*Note: Information on "optimize tp" are from the read_inverse.f90 routine. Not sure about the meaning of the input options. An example on how to use this option in the input file is missing...*
4. Specify inversion control:
```
# inverse
1 !<1 (on)/0 (off)>
20 0.0001 1.0 !<max number of iterations> <break-off criterion> <time weighting>
0 0 !<covariance-matrix output: 0/1> <resolution-matrix output: 0/1>
1 !<output frequency: every nth iteration>
```
Time weighting can range between 0.0 (fully explicit) and 1.0 (fully implicit).
## Example model
An example model for deterministic inversion with SHEMAT-Suite is provided in SHEMAT-Suite_Models/ad_const_TemperatureInversion.