From 0400ceb62c9f771d69db5e88e34e7ce35144cbb7 Mon Sep 17 00:00:00 2001 From: "Oddvar Lia (ST MSU GEO)" Date: Thu, 7 Dec 2023 18:44:07 +0100 Subject: [PATCH] Removed unnecessary files --- .../example_case/modify_variogram.yml | 5 - .../scripts/import_field_parameters.py | 22 ---- .../scripts/import_field_parameters_local.py | 29 ----- .../scripts/import_fields_to_rms.py | 121 ------------------ .../import_upscaled_field_parameters.py | 21 --- .../import_upscaled_field_parameters_local.py | 21 --- .../localisation/example_case/sim_field.ert | 58 --------- .../example_case/sim_field_local.ert | 56 -------- .../localisation/example_case/time_map.txt | 1 - 9 files changed, 334 deletions(-) delete mode 100644 tests/jobs/localisation/example_case/modify_variogram.yml delete mode 100644 tests/jobs/localisation/example_case/scripts/import_field_parameters.py delete mode 100644 tests/jobs/localisation/example_case/scripts/import_field_parameters_local.py delete mode 100644 tests/jobs/localisation/example_case/scripts/import_fields_to_rms.py delete mode 100644 tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters.py delete mode 100644 tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters_local.py delete mode 100644 tests/jobs/localisation/example_case/sim_field.ert delete mode 100644 tests/jobs/localisation/example_case/sim_field_local.ert delete mode 100644 tests/jobs/localisation/example_case/time_map.txt diff --git a/tests/jobs/localisation/example_case/modify_variogram.yml b/tests/jobs/localisation/example_case/modify_variogram.yml deleted file mode 100644 index 144f36523..000000000 --- a/tests/jobs/localisation/example_case/modify_variogram.yml +++ /dev/null @@ -1,5 +0,0 @@ -settings: - - field: - variogram: "spherical" - correlation_range: [4000.0, 4000.0, 2.0] diff --git a/tests/jobs/localisation/example_case/scripts/import_field_parameters.py b/tests/jobs/localisation/example_case/scripts/import_field_parameters.py deleted file mode 100644 index bc3d8a76d..000000000 --- a/tests/jobs/localisation/example_case/scripts/import_field_parameters.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -Import field parameters into RMS (Must be included as python job -in RMS workflow and edited to fit your scratch directory). -Variable project is defined when running within RMS, -but not outside since it refers to Roxar API -""" -# pylint: disable=import-error, undefined-variable -from import_fields_to_rms import import_from_scratch_directory - -SCRATCH = "/scratch/fmu/olia/sim_field/" -CASE_NAME = "original" -PRJ = project # noqa: 821 -GRID_MODEL_NAME = "GRID" -FIELD_NAMES = [ - "FieldParam", -] -FILE_FORMAT = "ROFF" -ITERATION = 3 - -import_from_scratch_directory( - PRJ, GRID_MODEL_NAME, FIELD_NAMES, CASE_NAME, SCRATCH, FILE_FORMAT, ITERATION -) diff --git a/tests/jobs/localisation/example_case/scripts/import_field_parameters_local.py b/tests/jobs/localisation/example_case/scripts/import_field_parameters_local.py deleted file mode 100644 index 8f84d78d6..000000000 --- a/tests/jobs/localisation/example_case/scripts/import_field_parameters_local.py +++ /dev/null @@ -1,29 +0,0 @@ -""" -Import field parameters into RMS (Must be included as python job -in RMS workflow and edited to fit your scratch directory) -Variable project is defined when running within RMS, -but not outside since it refers to Roxar API. -""" - -# pylint: disable=import-error, undefined-variable -from import_fields_to_rms import import_from_scratch_directory - -PRJ = project # noqa: 821 -GRID_MODEL_NAME = "GRID" -FIELD_NAMES = [ - "FieldParam", -] -FILE_FORMAT = "ROFF" -ITERATION = 3 - -# The different cases -CASE_NAME = "original" -SCRATCH = "/scratch/fmu/olia/sim_field/" -import_from_scratch_directory( - PRJ, GRID_MODEL_NAME, FIELD_NAMES, CASE_NAME, SCRATCH, FILE_FORMAT, ITERATION -) -CASE_NAME = "local" -SCRATCH = "/scratch/fmu/olia/sim_field_local/" -import_from_scratch_directory( - PRJ, GRID_MODEL_NAME, FIELD_NAMES, CASE_NAME, SCRATCH, FILE_FORMAT, ITERATION -) diff --git a/tests/jobs/localisation/example_case/scripts/import_fields_to_rms.py b/tests/jobs/localisation/example_case/scripts/import_fields_to_rms.py deleted file mode 100644 index 02a044330..000000000 --- a/tests/jobs/localisation/example_case/scripts/import_fields_to_rms.py +++ /dev/null @@ -1,121 +0,0 @@ -""" -Import field parameters into RMS (Must be included as python job -in RMS workflow and edited to fit your scratch directory) -Variable project is defined when running within RMS, -but not outside since it refers to Roxar API. -""" - -from pathlib import Path - -import xtgeo - - -# pylint: disable=bare-except, too-many-arguments, too-many-branches -# pylint: disable=too-many-locals, too-many-statements -def import_from_scratch_directory( - project, - grid_model_name, - field_names, - case_name, - scratch_dir, - file_format, - max_iteration, -): - """ - Import files with initial ensemble and updated fields into RMS project - """ - grid = xtgeo.grid_from_roxar(project, grid_model_name, project.current_realisation) - - path = Path(scratch_dir) - if not path.exists(): - raise IOError(f"File path: {scratch_dir} does not exist. ") - - real = project.current_realisation - print("\n") - print(f"Realization: {real} ") - for name in field_names: - for iteration in [0, max_iteration]: - print(f"Iteration: {iteration}") - if iteration == 0: - name_with_iter = name + "_" + case_name + "_" + str(iteration) - path = ( - scratch_dir - + "realization-" - + str(real) - + "/iter-" - + str(iteration) - + "/init_files/" - ) - if file_format == "ROFF": - file_name = path + name + ".roff" - elif file_format == "GRDECL": - file_name = path + name + ".GRDECL" - else: - raise IOError(f"Unknown file format: {file_format} ") - print(f"File name: {file_name} ") - - try: - if file_format == "ROFF": - # print(f"Import ROFF file: {file_name} ") - property0 = xtgeo.gridproperty_from_file( - file_name, fformat="roff" - ) - else: - # print(f"Import GRDECL file: {file_name} ") - property0 = xtgeo.gridproperty_from_file( - file_name, fformat="grdecl", name="FIELDPAR", grid=grid - ) - print( - f"Import property {property0.name} for iteration {iteration} " - f"into {name_with_iter} " - ) - property0.to_roxar( - project, grid_model_name, name_with_iter, realisation=real - ) - except: # noqa: E722 - print(f"Skip realization: {real} for iteration: {iteration} ") - elif iteration == max_iteration: - name_with_iter = name + "_" + case_name + "_" + str(iteration) - path = ( - scratch_dir - + "realization-" - + str(real) - + "/iter-" - + str(iteration) - + "/" - ) - if file_format == "ROFF": - file_name = path + name + ".roff" - elif file_format == "GRDECL": - file_name = path + name + ".GRDECL" - print(f"File name: {file_name} ") - - try: - if file_format == "ROFF": - property3 = xtgeo.gridproperty_from_file(file_name, "roff") - else: - property3 = xtgeo.gridproperty_from_file( - file_name, fformat="grdecl", name="FIELDPAR", grid=grid - ) - print( - f"Import property {property3.name} for iteration {iteration} " - f"into {name_with_iter} " - ) - property3.to_roxar( - project, grid_model_name, name_with_iter, realisation=real - ) - except: # noqa: E722 - print(f"Skip realization: {real} for iteration: {iteration} ") - try: - diff_property = property0 - diff_property.values = property3.values - property0.values - name_diff = name + "_" + case_name + "_diff" - print( - f"Calculate difference between iteration {max_iteration} " - f" and 0: {name_diff}" - ) - diff_property.to_roxar( - project, grid_model_name, name_diff, realisation=real - ) - except: # noqa: E722 - print(f"Skip difference for realisation: {real} ") diff --git a/tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters.py b/tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters.py deleted file mode 100644 index 433ef1802..000000000 --- a/tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -Import upscaled field parameters into RMS (Must be included as python job -in RMS workflow and edited to fit your scratch directory) -Variable project is defined when running within RMS, -but not outside since it refers to Roxar API -""" -# pylint: disable=import-error, undefined-variable -from import_fields_to_rms import import_from_scratch_directory - -SCRATCH = "/scratch/fmu/olia/sim_field/" -CASE_NAME = "original" - -PRJ = project # noqa: 821 -GRID_MODEL_NAME = "UpscaleGrid" -FIELD_NAMES = [ - "Upscaled", -] -ITERATION = 3 -import_from_scratch_directory( - PRJ, GRID_MODEL_NAME, FIELD_NAMES, CASE_NAME, SCRATCH, ITERATION -) diff --git a/tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters_local.py b/tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters_local.py deleted file mode 100644 index ce4f60724..000000000 --- a/tests/jobs/localisation/example_case/scripts/import_upscaled_field_parameters_local.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -Import field parameters into RMS (Must be included as python job -in RMS workflow and edited to fit your scratch directory) -Variable project is defined when running within RMS, -but not outside since it refers to Roxar API -""" -# pylint: disable=import-error, undefined-variable -from import_fields_to_rms import import_from_scratch_directory - -SCRATCH = "/scratch/fmu/olia/sim_field_local/" -CASE_NAME = "local" - -PRJ = project # noqa: 821 -GRID_MODEL_NAME = "UpscaleGrid" -FIELD_NAMES = [ - "Upscaled", -] -ITERATION = 3 -import_from_scratch_directory( - PRJ, GRID_MODEL_NAME, FIELD_NAMES, CASE_NAME, SCRATCH, ITERATION -) diff --git a/tests/jobs/localisation/example_case/sim_field.ert b/tests/jobs/localisation/example_case/sim_field.ert deleted file mode 100644 index 98648ab9d..000000000 --- a/tests/jobs/localisation/example_case/sim_field.ert +++ /dev/null @@ -1,58 +0,0 @@ -DEFINE $USER -DEFINE /scratch/fmu -DEFINE sim_field_A -DEFINE randomseeds.txt -DEFINE /example_test_config_A.yml -INSTALL_JOB SIM_FIELD scripts/FM_SIM_FIELD ------------------------------------------------------ --- Observations ------------------------------------------------------ - -DEFINE /observations/observations.obs -OBS_CONFIG -TIME_MAP time_map.txt - -JOBNAME sim_fields_ - - -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 - -RUNPATH ///realization-/iter- -RANDOM_SEED 123456 -- ERT seed value - -ENSPATH output//storage -- Storage of internal ert data -UPDATE_LOG_PATH output//update_log -- Info of active and inactive data points -RUNPATH_FILE output//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(=init_files) --- Is used to identify iteration number (only relevant for old komodo versions) -FORWARD_MODEL MAKE_DIRECTORY(=) --- The common seed file -FORWARD_MODEL COPY_FILE(=/, =/) --- For QC purpose only -FORWARD_MODEL COPY_FILE(=/init_files/ObsField.roff, =/init_files/ObsField.roff) -FORWARD_MODEL MAKE_SYMLINK(=/GRID.EGRID, =/GRID.EGRID) -FORWARD_MODEL MAKE_SYMLINK(=/UpscaleGrid.EGRID, =/UpscaleGrid.EGRID) - --- The main forward model simulating gaussian field with trend, and upscale -FORWARD_MODEL SIM_FIELD(=, =, =) - - -GRID /GRID.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 diff --git a/tests/jobs/localisation/example_case/sim_field_local.ert b/tests/jobs/localisation/example_case/sim_field_local.ert deleted file mode 100644 index 6acb507a0..000000000 --- a/tests/jobs/localisation/example_case/sim_field_local.ert +++ /dev/null @@ -1,56 +0,0 @@ -DEFINE $USER -DEFINE sim_field_local_A -DEFINE randomseeds.txt -DEFINE /example_test_config_A.yml -INSTALL_JOB SIM_FIELD scripts/FM_SIM_FIELD ------------------------------------------------------ --- Observations ------------------------------------------------------ - -DEFINE /observations/observations.obs -OBS_CONFIG - -JOBNAME sim_fields_ - - -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//realization-/iter- -ENSPATH output//storage -- Storage of internal ert data -UPDATE_LOG_PATH output//update_log -- Info of active and inactive data points -RUNPATH_FILE output//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(=init_files) --- Is used to identify iteration number (only relevant for old komodo versions) -FORWARD_MODEL MAKE_DIRECTORY(=) --- The common seed file -FORWARD_MODEL COPY_FILE(=/, =/) --- For QC purpose only -FORWARD_MODEL COPY_FILE(=/init_files/ObsField.roff, =/init_files/ObsField.roff) -FORWARD_MODEL MAKE_SYMLINK(=/GRID_STANDARD.EGRID, =/GRID_STANDARD.EGRID) -FORWARD_MODEL MAKE_SYMLINK(=/GRID_STANDARD_UPSCALED.EGRID, =/GRID_STANDARD_UPSCALED.EGRID) - --- The main forward model simulating gaussian field with trend, and upscale -FORWARD_MODEL SIM_FIELD(=, =, =, =) - -GRID /GRID_STANDARD.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 diff --git a/tests/jobs/localisation/example_case/time_map.txt b/tests/jobs/localisation/example_case/time_map.txt deleted file mode 100644 index 9c6b8b808..000000000 --- a/tests/jobs/localisation/example_case/time_map.txt +++ /dev/null @@ -1 +0,0 @@ -2000-01-01