Skip to content

Commit

Permalink
Merge pull request #117 from Statoil/mda-bug
Browse files Browse the repository at this point in the history
Mda bug
  • Loading branch information
joakim-hove authored Aug 9, 2018
2 parents 1c724ef + 7a05364 commit efcce5b
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ def update(self, run_context, weight):
phase_string = "Analyzing iteration: %d with weight %f" % (next_iteration, weight)
self.setPhase(self.currentPhase() + 1, phase_string, indeterminate=True)

es_update = self.ert().getESUpdate( )
es_update = self.ert().getESUpdate( )
es_update.setGlobalStdScaling(weight)
success = es_update.smootherUpdate( run_context )

if not success:
raise UserWarning("Analysis of simulation failed for iteration: %d!" % next_iteration)


def _simulateAndPostProcess(self, run_context):
self._job_queue = self._queue_config.create_job_queue( )
iteration = run_context.get_iter( )

phase_string = "Running simulation for iteration: %d" % iteration
self.setPhaseName(phase_string, indeterminate=True)
self.ert().getEnkfSimulationRunner().createRunPath(run_context)
Expand All @@ -115,7 +115,7 @@ def _simulateAndPostProcess(self, run_context):
num_successful_realizations = self.ert().getEnkfSimulationRunner().runSimpleStep(self._job_queue, run_context)

self.checkHaveSufficientRealizations(num_successful_realizations)

phase_string = "Post processing for iteration: %d" % iteration
self.setPhaseName(phase_string, indeterminate=True)
self.ert().getEnkfSimulationRunner().runWorkflows(HookRuntime.POST_SIMULATION)
Expand Down Expand Up @@ -155,11 +155,12 @@ def parseWeights(weights):

return result


def create_context(self, arguments, itr, prior_context = None, update = True):
target_case_format = arguments["target_case"]
model_config = self.ert().getModelConfig( )
runpath_fmt = model_config.getRunpathFormat( )
jobname_fmt = model_conifg.getJobnameFormat( )
subst_list = self.ert().getDataKW( )
fs_manager = self.ert().getEnkfFsManager()

Expand All @@ -168,11 +169,11 @@ def create_context(self, arguments, itr, prior_context = None, update = True):
target_fs = fs_manager.getFileSystem(target_case_format % (itr + 1))
else:
target_fs = None

if prior_context is None:
mask = arguments["active_realizations"]
else:
mask = prior_context.get_mask( )
run_context = ErtRunContext.ensemble_smoother( sim_fs, target_fs, mask, runpath_fmt, subst_list, itr)

run_context = ErtRunContext.ensemble_smoother( sim_fs, target_fs, mask, runpath_fmt, jobname_fmt, subst_list, itr)
return run_context

0 comments on commit efcce5b

Please sign in to comment.