Skip to content

Commit

Permalink
Add test using scaling from file using RMS grid index origo
Browse files Browse the repository at this point in the history
  • Loading branch information
oddvarlia committed Dec 7, 2023
1 parent 0400ceb commit 117ac48
Show file tree
Hide file tree
Showing 8 changed files with 332 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ROFF format standard Eclipse origo
settings:
case_name: "A"
case_name: "F"
model_size:
size: [ 1000.0, 2000.0, 50.0 ]
use_eclipse_grid_index_origo: True
Expand Down
51 changes: 51 additions & 0 deletions tests/jobs/localisation/example_case/example_test_config_G.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ROFF format standard Eclipse origo
settings:
case_name: "G"
model_size:
size: [ 1000.0, 2000.0, 50.0 ]
use_eclipse_grid_index_origo: False

field:
name: "FIELDPAR"
algorithm: "gstools"
file_format: "ROFF"
initial_file_name: "init_files/FieldParam"
updated_file_name: "FieldParam"
seed_file: "randomseeds.txt"
variogram: "gaussian"
correlation_range: [250, 500, 2.0]
correlation_azimuth: 0.0
correlation_dip: 0.0
correlation_exponent: 1.9
trend_use: False
trend_params: [ 1.0, -1.0 ]
trend_relstd: 0.15
grid_dimension: [10, 20, 1]
grid_file_name: "GRID_RMS_ORIGO.EGRID"

response:
name: "UPSCALED"
grid_dimension: [2,4,1]
upscaled_file_name: "Upscaled"
grid_file_name: "GRID_RMS_ORIGO_UPSCALED.EGRID"
file_format: "ROFF"
write_upscaled_field: True
response_function: "average"
gen_data_file_name: "UpscaledField_0.txt"

observation:
directory: "observations"
file_name: "observations.obs"
data_dir: "obs_data"
reference_param_file: "init_files/ObsField"
reference_field_name: "ObsField"
rel_error: 0.10
min_abs_error: 0.01
obs_positions: [ [650.0, 850.0, 25.0] ]

localisation:
method: "scaling_file"
scaling_file: "init_files/scaling_factor_rms_origo.grdecl"

optional:
write_obs_pred_diff_field_file: False
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FIELDPAR
0.662012 0.092502 -1.249170 -2.481425 -2.643038 -2.015550
-1.732791 -2.259825 -3.021738 -3.374325 2.535338 2.215707
0.622777 -1.049959 -1.704248 -1.537606 -1.549673 -2.107112
-2.676758 -2.857547 1.752741 1.156656 0.156627 -0.349148
-0.425633 -0.648444 -1.098076 -1.299050 -0.878778 -0.019675
0.545837 -0.318973 -0.824143 -0.816984 -0.678996 -0.777436
-0.967488 -0.856602 -0.316280 0.517896 -0.841584 -1.226023
-1.207091 -0.902073 -0.387598 0.025259 -0.029104 -0.373039
-0.433728 0.006049 -1.679243 -1.919407 -1.234238 0.040584
1.085511 1.344037 0.997618 0.657986 0.617346 0.557741
-0.995523 -1.374976 -0.900708 0.206069 1.040176 1.223922
1.279978 1.478402 1.243197 0.178017 0.235147 0.157758
0.172461 0.312229 0.509417 0.808807 1.215309 1.370256
0.795799 -0.342228 0.296088 0.753952 1.023120 0.847401
0.682307 1.046445 1.562969 1.421198 0.483566 -0.607791
-0.049208 0.944598 1.588994 1.513464 1.166571 1.047943
1.075387 0.881568 0.389300 -0.185701 -0.035406 1.009202
1.709299 1.983187 1.760534 0.946370 0.064703 -0.146747
0.213693 0.432429 0.899565 0.992203 0.749731 0.404224
-0.167782 -1.022487 -1.668451 -1.600215 -1.044804 -0.566005
1.324994 0.901444 0.074174 -0.849109 -1.649805 -1.964304
-1.696768 -1.163499 -0.598027 -0.028493 1.430932 1.254107
0.654710 -0.078125 -0.653691 -0.862671 -0.729918 -0.454728
-0.200309 -0.092174 1.202264 0.996304 0.536597 0.157487
0.151960 0.261694 0.257023 0.275927 0.215435 -0.279581
-0.057085 -0.287224 -0.724738 -0.876790 -0.636449 -0.371928
-0.186803 0.130124 0.381840 0.089729 0.439765 -0.143754
-1.070861 -1.915480 -2.726342 -3.124574 -2.504564 -1.177302
-0.224223 -0.178808 0.859417 0.607622 0.091949 -0.829884
-1.867067 -2.117355 -1.216993 -0.109772 0.090068 -0.479618
0.526481 0.509107 0.391517 -0.025932 -0.279426 -0.127581
0.017761 -0.193278 -0.633775 -1.029683 0.648341 0.376487
0.306689 0.234835 0.003016 -0.494571 -1.028435 -1.095739
-0.725329 -0.679467 /
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FIELDPAR
0.655640 0.057808 -1.260025 -2.426540 -2.540915 -1.905988
-1.622376 -2.130691 -2.866883 -3.212839 2.447703 2.021628
0.449580 -1.105881 -1.668227 -1.478590 -1.479489 -1.990148
-2.506255 -2.667040 1.639202 0.965610 0.033820 -0.378241
-0.398494 -0.584058 -1.007251 -1.202067 -0.800682 0.002492
0.478364 -0.390329 -0.818225 -0.749366 -0.595022 -0.706270
-0.914178 -0.819816 -0.313909 0.431625 -0.832105 -1.123364
-1.054472 -0.789282 -0.338498 0.032766 -0.034032 -0.381875
-0.458273 -0.084596 -1.642468 -1.770741 -1.099022 0.083340
1.075341 1.224725 0.751074 0.389769 0.445177 0.474418
-0.984397 -1.346187 -0.885415 0.207652 0.990806 0.872062
0.270160 0.074325 0.431142 0.027639 0.217965 0.119890
0.144786 0.266507 0.272608 -0.069734 -0.719513 -0.875290
-0.208943 -0.423925 0.283185 0.710210 0.964796 0.711048
0.278223 -0.015906 -0.270889 -0.166249 0.074077 -0.524802
-0.087109 0.849386 1.453566 1.347334 1.024914 0.842019
0.740843 0.667563 0.303510 -0.241788 -0.082711 0.882231
1.543495 1.769417 1.499963 0.847519 0.236675 -0.092023
0.064940 0.332343 0.869290 0.934190 0.685972 0.333878
-0.201477 -0.827354 -1.266019 -1.401792 -1.056710 -0.581285
1.299572 0.856299 0.038847 -0.813178 -1.368125 -1.447943
-1.280760 -0.998493 -0.564469 -0.015730 1.381997 1.181857
0.605823 -0.074484 -0.511862 -0.597728 -0.554966 -0.401634
-0.171522 -0.033980 1.158963 0.913349 0.442244 0.082556
0.146261 0.328810 0.315104 0.315820 0.254455 -0.217157
-0.055799 -0.292043 -0.727052 -0.863093 -0.599287 -0.323443
-0.146332 0.151186 0.377892 0.099067 0.415938 -0.149304
-1.036409 -1.856251 -2.652239 -3.042570 -2.427024 -1.126549
-0.197648 -0.149957 0.854959 0.587476 0.076209 -0.826763
-1.845099 -2.088035 -1.196661 -0.100295 0.101574 -0.460161
0.526481 0.509107 0.391373 -0.023863 -0.273252 -0.122432
0.016825 -0.198978 -0.636868 -1.026450 0.648341 0.376487
0.306689 0.234835 0.003016 -0.494571 -1.028435 -1.095739
-0.725329 -0.679467 /
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

SCALING
0.00877429079 0.0441762544 0.0665985122 0.0785425529 0.0850359648
0.0885261223 0.0905158073 0.0923460945 0.0924721509 0.0868233591

0.0413737856 0.0846893489 0.106586784 0.114918746 0.118551478
0.120768428 0.12276534 0.125401542 0.126825631 0.122835122

0.0620717965 0.114647269 0.134200275 0.135575622 0.131714463
0.128724501 0.129031375 0.13239418 0.137205586 0.140333056

0.0676470697 0.128882632 0.141776979 0.128613114 0.107911579
0.0893575996 0.0812080279 0.0852842182 0.10028512 0.122700267

0.0635695606 0.127395019 0.125238523 0.0950208232 0.0677052438
0.0437932834 0.0376545079 0.0385723859 0.0507421643 0.0839931592

0.0571080595 0.113578357 0.0907923728 0.0506353714 0.069845207
0.152088627 0.252010256 0.238708615 0.124544971 0.055357337

0.0523970835 0.0939117745 0.0628247038 0.0399134271 0.198853135
0.46667394 0.65412581 0.635288835 0.387747556 0.149869889

0.0492031202 0.0741543695 0.0527167879 0.0891754478 0.352179855
0.695928216 0.895608008 0.852726817 0.517417789 0.260448962

0.0451645106 0.063203834 0.066589959 0.159034893 0.425005674
0.744041264 0.956496 0.911683619 0.516521394 0.283591837

0.0437682532 0.0769556612 0.112662002 0.229829431 0.461149663
0.723126411 0.871051311 0.711820066 0.450462759 0.227276623

0.0416177697 0.0837309957 0.136203006 0.264866084 0.480560392
0.683874905 0.733731925 0.542562187 0.313413531 0.103217475

0.0362647735 0.0638489351 0.109380685 0.24080199 0.456255645
0.638256907 0.630086362 0.419066995 0.165060177 0.0379007943

0.0365328901 0.0551960096 0.0803627595 0.175753772 0.354921192
0.496848464 0.433681875 0.222422212 0.0679221153 0.036710728

0.0423487797 0.0586890392 0.0715542361 0.120984368 0.216681033
0.261977315 0.183652744 0.0777159408 0.0435763821 0.0589708723

0.0468719564 0.0599104799 0.0680627897 0.0913911909 0.117351525
0.108548783 0.0624484308 0.0494863279 0.0646237284 0.0794273764

0.0432741642 0.0517198518 0.0529378206 0.0574502349 0.0607241429
0.0538347289 0.0475190282 0.0564772375 0.0722196251 0.0810511559

0.0279479939 0.0363404155 0.03613998 0.0340526439 0.0340892971
0.0368285999 0.0430386923 0.0538446382 0.0647787303 0.0673846528

0.003006696 0.0156889092 0.0205063 0.0220940653 0.0239405781
0.0273311734 0.0326220095 0.0396278054 0.0452148803 0.0438990891

0 0 0.0024178524 0.00884367712 0.0132498778
0.0161081199 0.0182318985 0.0201500896 0.0203383286 0.0155032165

0 0 0 0 0
0 0 0 0 0

/
56 changes: 56 additions & 0 deletions tests/jobs/localisation/example_case/sim_field_case_G.ert
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
DEFINE <USER> $USER
DEFINE <CASE_DIR> sim_field_G
DEFINE <ENSEMBLE_SEED_FILE> randomseeds.txt
DEFINE <TEST_CONFIG> <CONFIG_PATH>/example_config.yml
-- DEFINE <TEST_CONFIG> <CONFIG_PATH>/example_test_config_G.yml
INSTALL_JOB SIM_FIELD scripts/FM_SIM_FIELD
-----------------------------------------------------
-- Observations
-----------------------------------------------------

DEFINE <OBS_FILE> <CONFIG_PATH>/observations/observations.obs
OBS_CONFIG <OBS_FILE>

JOBNAME sim_fields_<IENS>


NUM_REALIZATIONS 10 -- Set number of realizations to run
MAX_RUNTIME 18000 -- Set the maximum allowed run time (in seconds)
MIN_REALIZATIONS 1 -- Success criteria
MAX_SUBMIT 1 -- How many times should the queue system retry a simulation.
-- QUEUE_OPTION LSF MAX_RUNNING 100 -- Choke the number of simultaneous run
-- QUEUE_OPTION LSF LSF_QUEUE mr -- Assign LSF cluster queue to use
QUEUE_SYSTEM LOCAL
QUEUE_OPTION LOCAL MAX_RUNNING 10
RANDOM_SEED 123456 -- ERT seed value

RUNPATH simulations/<CASE_DIR>/realization-<IENS>/iter-<ITER>
ENSPATH output/<CASE_DIR>/storage -- Storage of internal ert data
UPDATE_LOG_PATH output/<CASE_DIR>/update_log -- Info of active and inactive data points
RUNPATH_FILE output/<CASE_DIR>/runpath_file -- List of runpaths

-- LOAD_WORKFLOW localisation.wf LOCALISATION_WORKFLOW
-- HOOK_WORKFLOW LOCALISATION_WORKFLOW PRE_FIRST_UPDATE

--Result data from forward model--
GEN_DATA RESULT_UPSCALED_FIELD RESULT_FILE:UpscaledField_%d.txt REPORT_STEPS:0 INPUT_FORMAT:ASCII OUTPUT_FORMAT:ASCII

-----------------------------------------------------
-- Forward models
-----------------------------------------------------
--Simulate Gaussian field with trend and calculate upscaled values. Observables are upscaled values of selected grid cells.
FORWARD_MODEL MAKE_DIRECTORY(<DIRECTORY>=init_files)
-- Is used to identify iteration number (only relevant for old komodo versions)
FORWARD_MODEL MAKE_DIRECTORY(<DIRECTORY>=<ITER>)
-- The common seed file
FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/<ENSEMBLE_SEED_FILE>, <TO>=<RUNPATH>/<ENSEMBLE_SEED_FILE>)

FORWARD_MODEL MAKE_SYMLINK(<TARGET>=<CONFIG_PATH>/GRID_RMS_ORIGO.EGRID, <LINKNAME>=<RUNPATH>/GRID_RMS_ORIGO.EGRID)
FORWARD_MODEL MAKE_SYMLINK(<TARGET>=<CONFIG_PATH>/GRID_RMS_ORIGO_UPSCALED.EGRID, <LINKNAME>=<RUNPATH>/GRID_RMS_ORIGO_UPSCALED.EGRID)

-- The main forward model simulating gaussian field with trend, and upscale
FORWARD_MODEL SIM_FIELD(<ITERATION>=<ITER>, <REALNUMBER>=<IENS>, <TEST_CONFIG>=<TEST_CONFIG>, <CONFIG_PATH>=<CONFIG_PATH>)

GRID <CONFIG_PATH>/GRID_RMS_ORIGO.EGRID -- Necessary for AHM using field parameters

FIELD FIELDPAR PARAMETER FieldParam.roff INIT_FILES:init_files/FieldParam.roff MIN:-5.0 MAX:5.0 FORWARD_INIT:True
56 changes: 56 additions & 0 deletions tests/jobs/localisation/example_case/sim_field_local_case_G.ert
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
DEFINE <USER> $USER
DEFINE <CASE_DIR> sim_field_local_G
DEFINE <ENSEMBLE_SEED_FILE> randomseeds.txt
DEFINE <TEST_CONFIG> <CONFIG_PATH>/example_config.yml
-- DEFINE <TEST_CONFIG> <CONFIG_PATH>/example_test_config_G.yml
INSTALL_JOB SIM_FIELD scripts/FM_SIM_FIELD
-----------------------------------------------------
-- Observations
-----------------------------------------------------

DEFINE <OBS_FILE> <CONFIG_PATH>/observations/observations.obs
OBS_CONFIG <OBS_FILE>

JOBNAME sim_fields_<IENS>


NUM_REALIZATIONS 10 -- Set number of realizations to run
MAX_RUNTIME 18000 -- Set the maximum allowed run time (in seconds)
MIN_REALIZATIONS 1 -- Success criteria
MAX_SUBMIT 1 -- How many times should the queue system retry a simulation.
-- QUEUE_OPTION LSF MAX_RUNNING 100 -- Choke the number of simultaneous run
-- QUEUE_OPTION LSF LSF_QUEUE mr -- Assign LSF cluster queue to use
QUEUE_SYSTEM LOCAL
QUEUE_OPTION LOCAL MAX_RUNNING 10
RANDOM_SEED 123456 -- ERT seed value

RUNPATH simulations/<CASE_DIR>/realization-<IENS>/iter-<ITER>
ENSPATH output/<CASE_DIR>/storage -- Storage of internal ert data
UPDATE_LOG_PATH output/<CASE_DIR>/update_log -- Info of active and inactive data points
RUNPATH_FILE output/<CASE_DIR>/runpath_file -- List of runpaths

LOAD_WORKFLOW localisation.wf LOCALISATION_WORKFLOW
HOOK_WORKFLOW LOCALISATION_WORKFLOW PRE_FIRST_UPDATE

--Result data from forward model--
GEN_DATA RESULT_UPSCALED_FIELD RESULT_FILE:UpscaledField_%d.txt REPORT_STEPS:0 INPUT_FORMAT:ASCII OUTPUT_FORMAT:ASCII

-----------------------------------------------------
-- Forward models
-----------------------------------------------------
--Simulate Gaussian field with trend and calculate upscaled values. Observables are upscaled values of selected grid cells.
FORWARD_MODEL MAKE_DIRECTORY(<DIRECTORY>=init_files)
-- Is used to identify iteration number (only relevant for old komodo versions)
FORWARD_MODEL MAKE_DIRECTORY(<DIRECTORY>=<ITER>)
-- The common seed file
FORWARD_MODEL COPY_FILE(<FROM>=<CONFIG_PATH>/<ENSEMBLE_SEED_FILE>, <TO>=<RUNPATH>/<ENSEMBLE_SEED_FILE>)

FORWARD_MODEL MAKE_SYMLINK(<TARGET>=<CONFIG_PATH>/GRID_RMS_ORIGO.EGRID, <LINKNAME>=<RUNPATH>/GRID_RMS_ORIGO.EGRID)
FORWARD_MODEL MAKE_SYMLINK(<TARGET>=<CONFIG_PATH>/GRID_RMS_ORIGO_UPSCALED.EGRID, <LINKNAME>=<RUNPATH>/GRID_RMS_ORIGO_UPSCALED.EGRID)

-- The main forward model simulating gaussian field with trend, and upscale
FORWARD_MODEL SIM_FIELD(<ITERATION>=<ITER>, <REALNUMBER>=<IENS>, <TEST_CONFIG>=<TEST_CONFIG>, <CONFIG_PATH>=<CONFIG_PATH>)

GRID <CONFIG_PATH>/GRID_RMS_ORIGO.EGRID -- Necessary for AHM using field parameters

FIELD FIELDPAR PARAMETER FieldParam.roff INIT_FILES:init_files/FieldParam.roff MIN:-5.0 MAX:5.0 FORWARD_INIT:True
Loading

0 comments on commit 117ac48

Please sign in to comment.