Example #1
0
void enkf_tui_analysis_menu(void * arg) {
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );
  menu_type       * menu = menu_alloc( "Analysis menu" , "Back" , "bB");

  arg_pack_type * arg_pack = arg_pack_alloc();
  arg_pack_append_ptr( arg_pack , enkf_main );
  arg_pack_append_ptr( arg_pack , menu );

  {
    enkf_tui_analysis_update_title(enkf_main, menu);

    if (enkf_main_have_obs(enkf_main)) {
      menu_add_item(menu, "Global scaling of uncertainty", "gG", enkf_tui_analysis_scale_observation_std__, enkf_main, NULL);
      menu_add_separator(menu);
    }

    menu_add_item(menu, "Select analysis module", "sS", enkf_tui_analysis_select_module__, arg_pack, NULL);
    menu_add_item(menu, "List available modules", "lL", enkf_tui_analysis_list_modules__, enkf_main, NULL);
    menu_add_item(menu, "Modify analysis module parameters", "mM", enkf_tui_analysis_update_module__, enkf_main, NULL);
    menu_add_item(menu, "Reload current module (external only)", "rR", enkf_tui_analysis_reload_module__, enkf_main, NULL);
  }
  menu_run(menu);
  menu_free(menu);
  arg_pack_free(arg_pack);
}
Example #2
0
void * enkf_main_rank_on_data_JOB(void * self, const stringlist_type * args) {
  enkf_main_type * enkf_main = enkf_main_safe_cast( self );
  const char * ranking_name  = stringlist_iget(args, 0);
  const char * data_key      = stringlist_iget(args, 1);
  bool valid = true;
  bool sort_increasing       = stringlist_iget_as_bool(args, 2, &valid);

  if (!valid) {
    fprintf(stderr,"** Third argument \"sort increasing\" not recognized as bool value, job not started\n");
    return NULL;
  }

  int report_step = (stringlist_get_size(args) > 3) ? stringlist_iget_as_int(args, 3, &valid) : enkf_main_get_history_length(enkf_main) ;
  if (!valid) {
    fprintf(stderr,"** Fourth argument \"step\" not recognized as integer value, job not started\n");
    return NULL;
  }

  if (report_step < 0) {
    fprintf(stderr,"** Negative report step, job not started\n");
    return NULL;
  }

  enkf_main_rank_on_data(enkf_main, ranking_name, data_key, sort_increasing, report_step);
  return NULL;
}
Example #3
0
void enkf_tui_fs_initialize_case_from_copy(void * arg) 
{
  int prompt_len =50;
  char * source_case;
  int ens_size;
  int last_report;
  int src_step;
  state_enum src_state;
  enkf_main_type   * enkf_main = enkf_main_safe_cast( arg );

  ens_size = enkf_main_get_ensemble_size( enkf_main );

  
  last_report  = enkf_main_get_history_length( enkf_main );

  source_case = enkf_tui_fs_alloc_existing_case( enkf_main , "Initialize from case" , prompt_len);
  if (source_case != NULL) {                                              
    src_step                 = util_scanf_int_with_limits("Source report step",prompt_len , 0 , last_report);
    src_state                = enkf_tui_util_scanf_state("Source analyzed/forecast [A|F]" , prompt_len , false);
    enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , source_case , false );
    enkf_main_init_current_case_from_existing(enkf_main, source_fs , src_step , src_state);
    enkf_fs_decref(source_fs);
  }
  util_safe_free( source_case );
}
Example #4
0
void enkf_tui_ranking_menu(void * arg) {
    
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );  
  {
    menu_type * menu = menu_alloc("Ranking of results" , "Back" , "bB");
    menu_item_type * obs_item;
    {
      arg_pack_type * arg_pack = arg_pack_alloc();
      arg_pack_append_ptr( arg_pack , enkf_main );
      menu_add_item(menu , "Create/update misfit table" , "cC"  , enkf_tui_ranking_make_misfit_ensemble   , arg_pack , arg_pack_free__);
      menu_add_separator( menu );
      obs_item = menu_add_item(menu , "New observation based ranking" , "nN" , enkf_tui_ranking_create_obs  , enkf_main , NULL);
      arg_pack_append_ptr( arg_pack , obs_item );
    }
    menu_add_item(menu , "New data based ranking (Sort: increasing)" , "iI" , enkf_tui_ranking_create_data_increasing , enkf_main , NULL);
    menu_add_item(menu , "New data based ranking (Sort: decreasing)" , "dD" , enkf_tui_ranking_create_data_decreasing , enkf_main , NULL);
    menu_add_item(menu , "Show ranking" , "sS" , enkf_tui_ranking_display , enkf_main , NULL);
    {
      enkf_fs_type * fs = enkf_main_get_fs( enkf_main );
      misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs );
      if (!misfit_ensemble_initialized( misfit_ensemble ))
        menu_item_disable( obs_item );
    }
    menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_rank , enkf_main , NULL);
    menu_run(menu);
    menu_free(menu);
  }
  
}
Example #5
0
void * enkf_main_std_scale_correlated_obs_JOB(void * self, const stringlist_type * args)  {

  if (stringlist_get_size(args) > 0) {
    enkf_main_type * enkf_main              = enkf_main_safe_cast( self );
    int ensemble_size                       = enkf_main_get_ensemble_size(enkf_main);
    enkf_fs_type * fs                       = enkf_main_get_fs( enkf_main );
    enkf_obs_type * obs                     = enkf_main_get_obs( enkf_main );
    int_vector_type * realizations          = int_vector_alloc(1, 0);
    local_obsdata_type * obsdata = local_obsdata_alloc( "OBS-JOB" );

    int_vector_init_range(realizations, 0, ensemble_size, 1);

    for (int iarg = 0; iarg < stringlist_get_size(args); iarg++) {
      const char * arg_key = stringlist_iget( args , iarg );
      stringlist_type * key_list = enkf_obs_alloc_matching_keylist(obs, arg_key);
      for (int iobs=0; iobs < stringlist_get_size( key_list ); iobs++) {
        const char * obs_key = stringlist_iget( key_list , iobs);
        const obs_vector_type * obs_vector = enkf_obs_get_vector(obs, obs_key);
        local_obsdata_add_node( obsdata , obs_vector_alloc_local_node(obs_vector) );
      }
      stringlist_free( key_list );
    }

    if (local_obsdata_get_size(obsdata) > 0)
      enkf_obs_scale_correlated_std(obs, fs, realizations, obsdata );

    local_obsdata_free( obsdata );
  }

  return NULL;
}
Example #6
0
static void * enkf_main_smoother_JOB__( void * self , int iter , const stringlist_type * args ) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );
  int ens_size                 = enkf_main_get_ensemble_size( enkf_main );
  bool_vector_type * iactive   = bool_vector_alloc( ens_size , true );
  bool valid                   = true;
  const char * target_case;
  enkf_fs_type * target_fs     = enkf_main_get_fs( enkf_main );


  // Argument 0: Which case to write to. Default current case.
  if (stringlist_get_size(args)) {
    target_case = stringlist_iget( args , 0 );
    if (strcmp( target_case , CURRENT_CASE_STRING) == 0)
      target_case = enkf_fs_get_case_name(target_fs);
  } else
    target_case = enkf_fs_get_case_name(target_fs);

  //Argument 1: Rerun. Default false.
  bool rerun = (stringlist_get_size(args) >= 2) ? stringlist_iget_as_bool(args, 1, &valid) : false;

  if (!valid) {
      fprintf(stderr, "** Warning: Function %s : Second argument must be a bool value. Exiting job\n", __func__);
      return NULL;
  }
  enkf_main_run_smoother( enkf_main , target_case , iactive , iter , rerun);
  bool_vector_free( iactive );
  return NULL;
}
Example #7
0
void * enkf_main_create_case_JOB( void * self , const stringlist_type * args) {
  enkf_main_type * enkf_main = enkf_main_safe_cast( self );
  const char * new_case = stringlist_iget( args , 0 );
  enkf_fs_type * fs = enkf_main_mount_alt_fs( enkf_main , new_case , true );
  enkf_fs_decref( fs );
  return NULL;
}
Example #8
0
void * enkf_main_init_case_from_existing_JOB( void * self , const stringlist_type * args) {
  enkf_main_type * enkf_main = enkf_main_safe_cast( self );

  const char * source_case = stringlist_iget( args , 0 );
  enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , source_case , true );
  {
    enkf_fs_type * target_fs;

    if (stringlist_get_size(args) > 1) {
      const char * current_case = enkf_main_get_current_fs(enkf_main);
      const char * target_case = stringlist_iget( args , 1 );
      if (0 != strcmp(current_case, target_case)) {
        target_fs = enkf_main_mount_alt_fs( enkf_main , target_case , true );
      } else
        target_fs = enkf_fs_get_ref( enkf_main_get_fs(enkf_main) );  // Using get_ref so that we can unconditionally call decref() further down.
    } else
      target_fs = enkf_fs_get_ref( enkf_main_get_fs(enkf_main) );    // Using get_ref so that we can unconditionally call decref() further down.

    enkf_main_init_case_from_existing(enkf_main, source_fs, 0, ANALYZED, target_fs);
    enkf_fs_decref(target_fs);
  }
  enkf_fs_decref(source_fs);

  return NULL;
}
Example #9
0
void * enkf_main_create_reports_JOB(void * self , const stringlist_type * args ) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );
  ert_report_list_type * report_list = enkf_main_get_report_list( enkf_main );

  ert_report_list_create( report_list , enkf_main_get_current_fs( enkf_main ) , true );
  return NULL;
}
Example #10
0
void * enkf_main_analysis_enkf_update_JOB( void * self , const stringlist_type * args) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );
  enkf_fs_type * target_fs = enkf_main_get_fs( enkf_main );
  int target_step;
  int_vector_type * step_list;


  // Argument 0: The number of the step to write to
  if (stringlist_get_size(args) > 1)
    util_sscanf_int(stringlist_iget( args , 1) , &target_step);
  else
    target_step = 0;

  // Argument 1 - ??: The timesteps to use in the update
  if (stringlist_get_size( args ) > 2) {
    char * step_args = stringlist_alloc_joined_substring(args , 2 , stringlist_get_size(args) , " ");
    step_list = string_util_alloc_active_list( step_args );
    free( step_args );
  } else
    step_list = int_vector_alloc(1,target_step);

  enkf_main_UPDATE( enkf_main , step_list , target_fs , target_step , SMOOTHER_UPDATE);

  int_vector_free( step_list );
  return NULL;
}
Example #11
0
void enkf_tui_analysis_update_module__(void * arg) {
  enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
  int prompt_len = 50;
  {
    const analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main );
    analysis_module_type * analysis_module = analysis_config_get_active_module( analysis_config );
    char var_name[256];
    char value[256];
    
    util_printf_prompt("Variable to modify" , prompt_len , '=' , "=> "); 
    scanf("%s", var_name);
    {
      char * value_prompt = util_alloc_sprintf("New value for %s" , var_name);
      util_printf_prompt(value_prompt , prompt_len , '=' , "=> "); 
      free( value_prompt );
    }
    scanf("%s", value);

    if (analysis_module_set_var( analysis_module , var_name , value))
      printf("\'%s\' successfully set to \'%s\' \n",var_name , value);
    else
      printf("** Variable/type combination: %s/%s not recognized \n", var_name , value);
    
  }
}
Example #12
0
void enkf_tui_run_iterated_ES(void * arg) {
  enkf_main_type * enkf_main  = enkf_main_safe_cast( arg );
  const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main);
  analysis_iter_config_type * iter_config = analysis_config_get_iter_config(analysis_config);
  int num_iter = analysis_iter_config_get_num_iterations(iter_config);
  enkf_main_run_iterated_ES(enkf_main , 0 , num_iter );  
}
Example #13
0
void enkf_tui_run_smoother(void * arg) {
  enkf_main_type * enkf_main  = enkf_main_safe_cast( arg );
  int ens_size = enkf_main_get_ensemble_size( enkf_main );
  bool_vector_type * iactive = bool_vector_alloc( ens_size , true );
  enkf_main_run_smoother(enkf_main , "AUTO-SMOOTHER" , iactive , 0 , true );
  bool_vector_free( iactive );
}
Example #14
0
void enkf_tui_fs_initialize_case_for_predictions(void * arg)
{
  int prompt_len = 35;
  char source_case[256];
  int report_step_from;
  int report_step_to;
  state_enum state_from;
  state_enum state_to;

  enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
  
  state_from       = ANALYZED;
  state_to         = ANALYZED;
  report_step_from = enkf_main_get_history_length( enkf_main ); 
  report_step_to   = enkf_main_get_history_length( enkf_main );


  {
    char * target_case = util_alloc_string_copy( NULL );
    
    util_printf_prompt("Source case" , prompt_len , '=' , "=> ");
    fgets(source_case, prompt_len, stdin);
    char *newline = strchr(source_case,'\n');
    if(newline)
      *newline = 0;
    
    if(strlen(source_case) !=0)
      enkf_tui_fs_copy_ensemble__(enkf_main, source_case, target_case, report_step_from, state_from, report_step_to, state_to, false);

    free(target_case);
  }
}
Example #15
0
void enkf_tui_fs_initialize_case_from_copy(void * arg) 
{
  int prompt_len =50;
  char * source_case;
  int ens_size;
  int last_report;
  int src_step;
  state_enum src_state;
  enkf_main_type   * enkf_main = enkf_main_safe_cast( arg );

  ens_size = enkf_main_get_ensemble_size( enkf_main );

  
  last_report  = enkf_main_get_history_length( enkf_main );

  source_case = enkf_tui_fs_alloc_existing_case( enkf_main , "Initialize from case" , prompt_len);
  if (source_case != NULL) {                                              
    char * ranking_key  = NULL;
    bool_vector_type * iens_mask = bool_vector_alloc( 0 , true ); 
    src_step         = util_scanf_int_with_limits("Source report step",prompt_len , 0 , last_report);
    src_state        = enkf_tui_util_scanf_state("Source analyzed/forecast [A|F]" , prompt_len , false);
    enkf_main_initialize_from_existing( enkf_main , source_case , src_step , src_state , iens_mask , ranking_key );
    bool_vector_free( iens_mask );
  }
  util_safe_free( source_case );
}
Example #16
0
void * enkf_main_select_module_JOB( void * self , const stringlist_type * args ) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );
  analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main );

  analysis_config_select_module( analysis_config , stringlist_iget( args , 0 ));

  return NULL;
}
Example #17
0
void * enkf_main_export_ranking_JOB(void * self, const stringlist_type * args) {
  enkf_main_type * enkf_main = enkf_main_safe_cast( self );
  const char * ranking_name  = stringlist_iget(args, 0);
  const char * ranking_file  = stringlist_iget(args, 1);

  enkf_main_export_ranking(enkf_main, ranking_name, ranking_file);
  return NULL;
}
Example #18
0
void * enkf_main_rank_on_observations_JOB(void * self, const stringlist_type * args) {
  enkf_main_type * enkf_main  = enkf_main_safe_cast( self );
  const char * ranking_name   = stringlist_iget(args, 0);

  bool step_arguments = false;
  bool obs_arguments  = false;
  int  delimiter      = 0;
  {
    delimiter = stringlist_find_first(args, "|");
    if (delimiter > -1) {
      step_arguments = (delimiter > 1) ? true : false;
      obs_arguments  = (stringlist_get_size(args) > delimiter + 1) ? true : false;
    } else if (stringlist_get_size(args) > 1) {
        step_arguments = true;
        delimiter     = stringlist_get_size(args);
    }
  }

  int_vector_type * steps_vector = NULL;
  {
    char * report_steps = NULL;

    if (step_arguments)
      report_steps = stringlist_alloc_joined_substring(args, 1, delimiter, ",");
    else
      report_steps = util_alloc_sprintf("0-%d", enkf_main_get_history_length(enkf_main));

    steps_vector = string_util_alloc_value_list(report_steps);

    free(report_steps);
  }


  stringlist_type * obs_ranking_keys = NULL;
  {
    char * obs_key_char = NULL;
    if (obs_arguments)
      obs_key_char = stringlist_alloc_joined_substring( args , delimiter+1 , stringlist_get_size(args) , " ");

    enkf_obs_type * enkf_obs = enkf_main_get_obs(enkf_main);
    obs_ranking_keys = enkf_obs_alloc_matching_keylist( enkf_obs , obs_key_char );

    if ((obs_arguments) && (stringlist_get_size(obs_ranking_keys) == 0)) {
      fprintf(stderr,"The input string : \"%s\" did not resolve to any valid observation keys. Job not started\n", obs_key_char);
      return NULL;
    }

    if (obs_arguments)
      free(obs_key_char);
  }


  enkf_main_rank_on_observations(enkf_main, ranking_name, obs_ranking_keys, steps_vector);

  stringlist_free(obs_ranking_keys);
  int_vector_free(steps_vector);
  return NULL;
}
Example #19
0
void enkf_tui_help_menu_table(void * arg) {
  
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );  
  menu_type * menu = menu_alloc("Help: Table of results" , "Back" , "bB");
  menu_add_helptext(menu , "This option can generate a table of results after the case has been run.");
  menu_add_item(menu , "Open manual (firefox)"    , "mM"  , enkf_tui_help_manual_table , enkf_main , NULL);
  menu_run(menu);
  menu_free(menu);
}
Example #20
0
void enkf_tui_help_menu_run(void * arg) {
  
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );  
  menu_type * menu = menu_alloc("Help: Run menu" , "Back" , "bB");
  menu_add_helptext(menu , "This menu is used to do the main work in ERT. The first option, x: Ensemble run: history, will just run the case without any data conditioning. Options r and s will initiate classical enkf runs. The two options i and t invokes the ensemble kalman smoother.");
  menu_add_item(menu , "Open manual (firefox)"    , "mM"  , enkf_tui_help_manual_run , enkf_main , NULL);
  menu_run(menu);
  menu_free(menu);
}
Example #21
0
void enkf_tui_help_menu_simple(void * arg) {
  
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );  
  menu_type * menu = menu_alloc("Help: Simple menu" , "Back" , "bB");
  menu_add_helptext(menu , "The top four options in the simple menu will run eclipse simulations. Option s: Sensitivity run: No data conditioning, will initialize all parameters and run one eclipse simulation for each set of different parameters. e: Assimilation run: EnKF updates, will initialize all parameters and run one eclipse simulation for each set of different parameters. The eclipse simulations will run until the first data time step is encountered and condition on data before continuing. a: Assimilation run: Smoother update, will do one pass of the sensitivity run, then condition the parameters to all the data and rerun all experiments. i: Assimilation run: Iterated smoother [RML-EnKF] will iterate the smoother run several times.");
    menu_add_item(menu , "Open manual (firefox)"    , "mM"  , enkf_tui_help_manual_main , enkf_main , NULL);
    menu_run(menu);
    menu_free(menu);
}
Example #22
0
void enkf_tui_help_menu_cases(void * arg) {
  
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );  
  menu_type * menu = menu_alloc("Help: Manage cases" , "Back" , "bB");
  menu_add_helptext(menu , "Use this menu to navgate between cases and to initialize cases. A case has to be initialized before it can be used.");
  menu_add_item(menu , "Open manual (firefox)"    , "mM"  , enkf_tui_help_manual_cases , enkf_main , NULL);
  menu_run(menu);
  menu_free(menu);
}
Example #23
0
void enkf_tui_help_menu_export(void * arg) {
  
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );  
  menu_type * menu = menu_alloc("Help: Export results" , "Back" , "bB");
  menu_add_helptext(menu , "Use this option to export results after the case has been run.");
  menu_add_item(menu , "Open manual (firefox)"    , "mM"  , enkf_tui_help_manual_export , enkf_main , NULL);
  menu_run(menu);
  menu_free(menu);
}
Example #24
0
void enkf_tui_help_menu_misc(void * arg) {
  
  enkf_main_type  * enkf_main  = enkf_main_safe_cast( arg );  
  menu_type * menu = menu_alloc("Help: Miscellanous" , "Back" , "bB");
  menu_add_helptext(menu , "This option contains miscellaneous options.");
  menu_add_item(menu , "Open manual (firefox)"    , "mM"  , enkf_tui_help_manual_misc , enkf_main , NULL);
  menu_run(menu);
  menu_free(menu);
}
Example #25
0
void * enkf_main_iterated_smoother_JOB( void * self , const stringlist_type * args ) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );
  const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main);
  analysis_iter_config_type * iter_config = analysis_config_get_iter_config(analysis_config);
  int num_iter = analysis_iter_config_get_num_iterations(iter_config);

  enkf_main_run_iterated_ES( enkf_main , num_iter);
  return NULL;
}
Example #26
0
void * enkf_main_assimilation_JOB( void * self , const stringlist_type * args ) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );
  int ens_size                 = enkf_main_get_ensemble_size( enkf_main );
  bool_vector_type * iactive   = bool_vector_alloc( 0 , true );

  bool_vector_iset( iactive , ens_size - 1 , true );
  enkf_main_run_assimilation( enkf_main , iactive , 0 , 0 ,  ANALYZED );
  return NULL;
}
Example #27
0
void enkf_tui_export_fieldP(void * arg) {
  enkf_main_type * enkf_main                   = enkf_main_safe_cast( arg );
  const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main);
  const enkf_config_node_type * config_node    = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN ,  FIELD  , INVALID_VAR );
  int iens1                                    = 0;
  int iens2                                    = enkf_main_get_ensemble_size( enkf_main );
  const int last_report                        = enkf_main_get_history_length( enkf_main );
  int report_step                              = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report);
  double lower_limit                           = util_scanf_double("Lower limit", PROMPT_LEN);
  double upper_limit                           = util_scanf_double("Upper limit", PROMPT_LEN);
  char * export_file;
  util_printf_prompt("Filename to store file: " , PROMPT_LEN , '=' , "=> ");
  export_file = util_alloc_stdin_line();
  {
    enkf_fs_type   * fs        = enkf_main_tui_get_fs(enkf_main);
    enkf_node_type ** ensemble = enkf_node_load_alloc_ensemble( config_node , fs , report_step , iens1 , iens2 );
    enkf_node_type *  sum      = enkf_node_alloc( config_node );
    int active_ens_size        = 0;
    int iens;

    enkf_node_clear( sum );
    {
      /* OK going low level */
      field_type * sum_field = (field_type *) enkf_node_value_ptr( sum );

      for (iens = iens1; iens < iens2; iens++) {
        if (ensemble[iens - iens1] != NULL) {
          field_type * field     = (field_type *) enkf_node_value_ptr( ensemble[iens - iens1] );
          field_update_sum( sum_field , field , lower_limit , upper_limit);
          active_ens_size++;
        }
      }
      if (active_ens_size > 0) {
        field_scale( sum_field , 1.0 / active_ens_size );
        {
          char * path;
          util_alloc_file_components( export_file , &path , NULL , NULL);
          if (path != NULL) {
            util_make_path( path );
            free( path );
          }
        }
        field_export(sum_field , export_file , NULL , RMS_ROFF_FILE , false, NULL);
      } else fprintf(stderr,"Warning: no data found \n");
    }

    for (iens = iens1; iens < iens2; iens++) {
      if (ensemble[iens - iens1] != NULL)
        enkf_node_free( ensemble[iens - iens1] );
    }

    free( ensemble );
    enkf_node_free( sum );
  }
  free( export_file );
}
Example #28
0
void * enkf_main_ensemble_run_JOB( void * self , const stringlist_type * args ) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );
  int ens_size                 = enkf_main_get_ensemble_size( enkf_main );
  bool_vector_type * iactive = alloc_iactive_vector_from_range(args, 0, stringlist_get_size(args), ens_size);

  bool_vector_iset( iactive , ens_size - 1 , true );
  enkf_main_run_exp( enkf_main , iactive , true );
  bool_vector_free(iactive);
  return NULL;
}
Example #29
0
void * enkf_main_scale_obs_std_JOB(void * self, const stringlist_type * args ) {
  enkf_main_type   * enkf_main = enkf_main_safe_cast( self );

  double scale_factor;
  if (util_sscanf_double(stringlist_iget(args, 0), &scale_factor)) {
    analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main );
    analysis_config_set_global_std_scaling( analysis_config , scale_factor );
  }
  return NULL;
}
Example #30
0
void * enkf_main_load_results_JOB( void * self , const stringlist_type * args) {
  enkf_main_type * enkf_main = enkf_main_safe_cast( self );
  int iter = 0;
  {
    const model_config_type * model_config = enkf_main_get_model_config( enkf_main );
    if (model_config_runpath_requires_iter( model_config ))
      fprintf(stderr,"**Warning: the runpath format:%s requires an iteration number - using default:0. Use the job: LOAD_RESULT_ITER instead.\n" , model_config_get_runpath_as_char( model_config ));
  }
  return enkf_main_load_results_JOB__(enkf_main , iter , args );
}