Examples to learn from

Below is a presentation of Ogre config files

Ogre example config

Ogre has a large number of surfaces, and for convenience these lists are places into separate files. Note that these data are fake data.

The main global config file

---
# Master global config for Ogre
# Prototype by JRIV

# ------------------------------------------------------------------------------
# Global settings
# ------------------------------------------------------------------------------

global:

  DATES: &global_dates
    - 1991-07-01
    - 2001-07-01
    - 2003-07-01
    - 2005-07-01
    - 2010-07-01
    - 2013-06-01
    - 2016-07-01

  DIFFDATES: &global_diffdates
    - [2001-07-01, 1991-07-01]
    - [2003-07-01, 2001-07-01]
    - [2005-07-01, 2003-07-01]
    - [2007-07-01, 2005-07-01]
    - [2010-07-01, 2007-07-01]
    - [2013-06-01, 2010-07-01]
    - [2016-07-01, 2013-06-01]
    - [2003-07-01, 1991-07-01]
    - [2005-07-01, 1991-07-01]
    - [2007-07-01, 1991-07-01]
    - [2010-07-01, 1991-07-01]
    - [2013-06-01, 1991-07-01]
    - [2016-07-01, 1991-07-01]

  FWL: &global_fwl
    - 3953.0
    - 3960.0
    - 3957.0
    - 3957.5
    - 3957.5
    - 3957.5
    - 3957.5
    - 3957.5
    - 3957.5
    - 3955.5
    - 3953.0
    - 3952.5
    - 3957.5
    - 3957.5
    - 3957.5
    - 3957.5
    - 3957.5
    - 3968.0
    - 3967.5
    - 3968.5
    - 3967.5

  GOC: &global_goc
    - 3943.0
    - 3945.0
    - 3942.0
    - 3944.5
    - 3944.5
    - 3944.5
    - 3944.5
    - 3946.0
    - 3946.0
    - 3942.5
    - 3945.0
    - 3944.5
    - 3944.5
    - 3944.5
    - 3944.5
    - 3944.5
    - 3944.5
    - 3941.0
    - 3941.5
    - 3942.5
    - 3946.0


# ------------------------------------------------------------------------------
# RMS settings
# ------------------------------------------------------------------------------
rms:
  horizons: !include rms_horizons.yml
  zones: !include rms_zones.yml

  # the following entries are called freeform entries:

  WELLMODEL:
    dtype: bool
    value: true ~ <WELLMODEL>

  WELLMODEL2: yes ~ <WELLMODEL2>

  SOMEXMODEL: false

  SOMEBOOL1:
    - true ~ <>
    - false ~ <>
    - true

  SOMEBOOL2:
    dtype: bool
    values:
      - true
      - false
      - true

  FWL: *global_fwl

  GOC: *global_goc

  # here example with dtype and value (not required)
  KH_MULT_CSAND:
    dtype: float
    value: 1.0  ~<KH_MULT_CSAND>  # in <...>: template value from ERT

  KH_MULT_MTR: 1.0 ~ <KH_MULT_MTR>

  KH_MULT_MST: 1.0

  # for dates, spesifying dtype can be more safe, but not required. Ad always treat
  # dates as "values", not "value" (since dates are complex data types)
  # I.e. treat dates always as lists.
  TESTSOMEDATE:
    dtype: date
    values:
      - 2017-01-01

  # this should also work.
  TESTSOMEOTHERDATE:
      - 2017-01-02

  TESTSOMEDATEPAIR:
    dtype: datepair
    values: [[2017-01-01, 2018-01-01]]

  # Dates wihtout dtype/values
  EDATES: *global_dates

  4D_DATES:
    dtype: date
    values: *global_dates

  DIFF4D_DATES: *global_diffdates

  # -----------------------------------------------------------------------------
  # Relperm and PC related (shows use of anchors and aliases)
  # -----------------------------------------------------------------------------
  A_OIL_CSAND: &aoilcsa 11.978799 ~ <A_OIL_CSAND>

  A_OIL_MTR: &aoilmtr 2.7431~<A_OIL_MTR>

  A_OIL_MST: &aoilmst 1.4545

  BOIL: -20.99 ~ <BOIL>

  # A_OIL_MST: bull

  # refer to as aliases
  AVALUE: [*aoilcsa, *aoilmtr, *aoilmst, *aoilcsa, *aoilmtr, *aoilmst]

The include files

Note that the include files starts on indent level “zero”.

rms_horizons.yml

#
# All the static HORIZONS and ZONES definitions to be accessed via IPL or YAML/Python
#

DCONF_SURF:
  - SEABED
  - BaseQUAT
  - BasePLIO
  - TopSO62
  - TopSO62_flatspot
  - TopFENS63_flatspot
  - TopBRENT

TOP_EROSION: [BCU]
BCU: [BCU]

TOP_RES:
  - TopDRAUPNE
  - TopHEATHERC
  - TopSO62
  - TopSO61
  - TopSO53
  - TopSO52
  - TopSO51
  - TopSO45
  - TopSO44
  - TopSO43
  - TopSO42
  - TopSO41
  - TopSO36
  - TopSO34
  - TopSO33
  - TopSO32
  - TopSO31
  - TopSO22
  - TopSO21
  - TopFENS63
  - TopFENS62
  - TopFENS61
  - TopFENS52
  - TopFENS51
  - TopFENS4
  - TopFENS3
  - TopFENS2
  - TopFENS1
  - TopKROSS
  - TopHEATHERA
  - TopBRENT

TOP_MAINRES:
  - TopSO62
  - TopSO45
  - TopSO36
  - TopFENS63
  - TopBRENT

TOP_PARAS:
  - TopSO62
  - TopSO52
  - TopSO51
  - TopSO45
  - TopSO44
  - TopSO43
  - TopSO42
  - TopSO41
  - TopSO36
  - TopSO34
  - TopSO33
  - TopSO32
  - TopSO31
  - TopSO22
  - TopSO21
  - TopFENS63

rms_zones.yml

MAIN_ZONES:
  - TopSO62_TopSO45
  - TopSO45_TopSO36
  - TopSO36_TopFENS63
  - TopFENS63_TopBRENT

OVERBURDEN: [MSL_TopSO62]

ZONE_RES:
  - DRAUPNE
  - HEATHERC
  - SO62
  - SO61
  - SO53
  - SO52
  - SO51
  - SO45
  - SO44
  - SO43
  - SO42
  - SO41
  - SO36
  - SO34
  - SO33
  - SO32
  - SO31
  - SO22
  - SO21
  - FENS63
  - FENS62
  - FENS61
  - FENS52
  - FENS51
  - FENS4
  - FENS3
  - FENS2
  - FENS1
  - KROSS
  - HEATHERA

ZONE_PARAS:
  - SO62
  - SO52
  - SO51
  - SO45
  - SO44
  - SO43
  - SO42
  - SO41
  - SO36
  - SO34
  - SO33
  - SO32
  - SO31
  - SO22
  - SO21

Vinstre example config

Note that these data are fake data. In this example, a simplified version of the FREE IPL variables is used, which perhaps should be the preferred form.

# Master FMU global config inspired by J Sverdrup setup, but fake numbers

version: 1.0
authors: [jriv, peesv, xman]

#-------------------------------------------------------------------------
# GLOBAL
#-------------------------------------------------------------------------
global:
  name: Vinstre
  coordsys: ST_SOMEWHAT_COORDSYS

  DATES: &global_dates
    - 2030-01-01
    - 2031-06-01
    - 2033-01-01

  DIFFDATES: &global_diff_dates
    - [2031-06-01, 2030-01-01]
    - [2033-01-01, 2031-06-01]
    - [2033-01-01, 2030-01-01]

  # an example of a table input, which may be output as a table file (a text file)
  FWL:
    - [Zone, Region1, Region2, Region3, Region4]
    - [1, 1001.0~<FWL_TONJ_DRAUP>, 1001.0~<FWL_GEIT_DRAUP>, 1001.0~<FWL_ESPN_DRAUP>, 1001.0~<FWL_ESPS_DRAUP>]
    - [2, 1001.0~<FWL_TONJ_DRAUP>, 1001.0, 1001.0~<FWL_ESPN_DRAUP>, 1001.0~<FWL_ESPS_DRAUP>]
    - [3, 1001.0~<FWL_TONJ_DRAUP>, 1001.0~<FWL_GEIT_DRAUP>, 1001.0~<FWL_ESPN_DRAUP>, 2021.0~<FWL_ESPS_CAVE>]
    - [4, 1001.0~<FWL_TONJ_DRAUP>, 1010.0~<FWL_GEIT_XRAPU>, 1001.0~<FWL_ESPN_DRAUP>, 2021.0~<FWL_ESPS_CAVE>]
    - [5, 1001.0~<FWL_TONJ_DRAUP>, 1010.0~<FWL_GEIT_XRAPU>, 1001.0~<FWL_ESPN_DRAUP>, 2021.0~<FWL_ESPS_CAVE>]

  # also possible to just include the table as a file
  FWL2: !include fwl2.yml

#-------------------------------------------------------------------------
# RMS
#-------------------------------------------------------------------------
rms:
  horizons:
    TOPNAME:
      - TopSverdrup
      - TopZverdrup
      - BaseZverdrup

  zones:
    ISONAME:
      - Sverdrup
      - Zverdrup

  # include kwlists which is a special format for keyname, code, fullname:
  kwlists: !include kwlists.yml


  COHIBA_MODE:
    dtype: str
    value: PREDICTION~<COHIBA_MODE>


  RUN_HAVANA:
    dtype: int
    value: 0 <CC>

  # the _IPL_DECLARE is for declaring additional data types (without values)
  # NB No IPL syntax check is done here!
  _IPL_DECLARE_STUB1: |
    GridModel GM
    Surface MAIN1, MAIN2

  _IPL_DECLARE_STUB2: |
    Function MYFUNCTION

  # the IPL code stub is just for IPL
  # NB No IPL syntax check is done here!
  _IPL_CODE_STUB1: |
    // code for something
    FOR i FROM 1 TO 100 DO
       Print("Hello")
    DONE

  # guessing the dtype with one value
  COHIBA_MODE2: PREDICTION~<COHIBA_MODE2>
  COHIBA_MODE3: SIMULATION
  RUN_MANILA1: 1
  RUN_MANILA2: 0
  FWL_UBER_ALLES: 1344.0 ~ <>
  FWL_UBER_ALLES_FINAL: 1344.0 ~ <UBER_FINAL>

  # include some freeform variables using anonymous entry __xxx
  __xxx: !include doe_params.yml

  # guessing the dtype with values
  FWL3:
    - 1234.0 ~ <FWL3_FIRST>
    - 1236.0 ~ <>  # will be FWL3_1
    - 1134.5 ~ <>  # will be FWL3_2

  SMALLFLOAT1: 1.0E-6
  SMALLFLOAT2: 1.0E-6 ~ <>
  SMALLFLOAT3: 1.0E-06
  SMALLFLOAT4: 1.0e-06
  SMALLFLOAT5: 0.000001
  SMALLFLOAT5A: 0.000001 ~ <>
  SMALLFLOAT6: -0.000001 ~ <>
  SMALLFLOAT7: -0.000001
  SMALLFLOAT8: -1.0e-6 ~ <>
  SMALLFLOAT9: -1.0e-6


eclipse:
  MULTFLT: |
      MULTFLT
      'F1'   0.12~<MULTFLT_F1> /
      'F2'   0.01~<MULTFLT_F2> /
      'F3'   0.04~<MULTFLT_F3> /
      'F4'   0.12~<MULTFLT_F4> /
      'F5'   0.06~<MULTFLT_F5> /
      /

_special_chars: !include special_chars.yml

The included file:

# FWL2:
  - [Zone, Region1, Region2, Region3, Region4]
  - [1, 1001.0~<FWL_TONJ_DRAUP>, 1001.0~<FWL_GEIT_DRAUP>, 1001.0~<FWL_ESPN_DRAUP>, 1001.0~<FWL_ESPS_DRAUP>]
  - [2, 1001.0~<FWL_TONJ_DRAUP>, 1001.0~<FWL_GEIT_DRAUP>, 1001.0~<FWL_ESPN_DRAUP>, 1001.0~<FWL_ESPS_DRAUP>]
  - [3, 1001.0~<FWL_TONJ_DRAUP>, 1001.0~<FWL_GEIT_DRAUP>, 1001.0~<FWL_ESPN_DRAUP>, 2021.0~<FWL_ESPS_CAVE>]
  - [4, 1001.0~<FWL_TONJ_DRAUP>, 1010.0~<FWL_GEIT_XRAPU>, 1001.0~<FWL_ESPN_DRAUP>, 2021.0~<FWL_ESPS_CAVE>]
  - [5, 1001.0~<FWL_TONJ_DRAUP>, 1010.0~<FWL_GEIT_XRAPU>, 1001.0~<FWL_ESPN_DRAUP>, 2021.0~<FWL_ESPS_CAVE>]

Using the config in RMS, IPL and Python

IPL example

Include("../input/global_variables/global_variables.ipl")

FOR i FROM 1 TO TOP_LOBE.length DO
    Print("Reading ", TOP_LOBE[i])

Python example

import fmu.config.utilities as utils

cfg = utils.yaml_load('../input/global_variables/global_variables_rms.yml')

for toplobe in cfg['horizons']['TOP_LOBE']:
    print('Working with {}'.format(toplobe))