Exemplo n.º 1
0
void config_init(config_type * config ) {
  config_item_type * item;

  config_add_key_value(config , "NUM_REALIZATIONS" , true , CONFIG_INT );
  config_add_key_value(config , "SCHEDULE_FILE"    , true , CONFIG_EXISTING_FILE);
  config_add_key_value(config , "DATA_FILE"        , true , CONFIG_EXISTING_FILE);
  config_add_key_value(config , "TARGET"           , true , CONFIG_STRING );
  


  item = config_add_item( config , "GROUP_RATE" , false , true );  /* Group name as part of parsing */
  config_item_set_argc_minmax(item , 4 , 4 , 4 , (const config_item_types[4]) {   CONFIG_STRING,           /* Group name */
                                                                              CONFIG_STRING ,          /* Phase */
                                                                              CONFIG_STRING ,          /* PRODUCER / INJECTOR */
                                                                              CONFIG_EXISTING_FILE});  /* File with min / max shift */
Exemplo n.º 2
0
void ecl_config_add_config_items(config_type * config)
{
  config_schema_item_type * item;

  item = config_add_schema_item(config, SCHEDULE_FILE_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 2);
  config_schema_item_iset_type(item, 0, CONFIG_EXISTING_PATH);
  /*
   Observe that SCHEDULE_PREDICTION_FILE - which is implemented as a
   GEN_KW is added in ensemble_config.c
   */

  item = config_add_schema_item(config, IGNORE_SCHEDULE_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 1);
  config_schema_item_iset_type(item, 0, CONFIG_BOOL);

  item = config_add_schema_item(config, ECLBASE_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 1);

  item = config_add_schema_item(config, DATA_FILE_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 1);
  config_schema_item_iset_type(item, 0, CONFIG_EXISTING_PATH);

  item = config_add_schema_item(config, STATIC_KW_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, CONFIG_DEFAULT_ARG_MAX);

  item = config_add_schema_item(config, ADD_FIXED_LENGTH_SCHEDULE_KW_KEY, false);
  config_schema_item_set_argc_minmax(item, 2, 2);
  config_schema_item_iset_type(item, 1, CONFIG_INT);

  item = config_add_schema_item(config, REFCASE_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 1);
  config_schema_item_iset_type(item, 0, CONFIG_PATH);

  item = config_add_schema_item(config, REFCASE_LIST_KEY, false);
  config_schema_item_set_default_type(item, CONFIG_PATH);

  item = config_add_key_value(config, PLOT_REFCASE_LIST_KEY, false, CONFIG_STRING);
  {
    char * message = util_alloc_sprintf("Warning: the key:%s is depreceated - use %s instead", PLOT_REFCASE_LIST_KEY,
        REFCASE_LIST_KEY);
    config_install_message(config, PLOT_REFCASE_LIST_KEY, message);
    free(message);
  }

  item = config_add_schema_item(config, GRID_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 1);
  config_schema_item_iset_type(item, 0, CONFIG_EXISTING_PATH);

  item = config_add_schema_item(config, INIT_SECTION_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 1);
  config_schema_item_iset_type(item, 0, CONFIG_PATH);
  config_add_alias(config, INIT_SECTION_KEY, "EQUIL_INIT_FILE");

  item = config_add_schema_item(config, END_DATE_KEY, false);
  config_schema_item_set_argc_minmax(item, 1, 1);
}
Exemplo n.º 3
0
void ensemble_config_add_config_items(config_parser_type * config) {
  config_schema_item_type * item;

  /**
      the two fault types are just added to the config object only to
      be able to print suitable messages before exiting.
  */

  item = config_add_schema_item(config , "HAVANA_FAULT" , false  );
  config_schema_item_set_argc_minmax(item , 2 , 2);

  item = config_add_schema_item(config , "MULTFLT" , false  );
  config_schema_item_set_argc_minmax(item , 3 , 3 );
  config_schema_item_iset_type( item , 2 , CONFIG_EXISTING_PATH );


  /*****************************************************************/


  item = config_add_schema_item(config , GEN_KW_KEY , false  );
  config_schema_item_set_argc_minmax(item , 4 , 6);
  config_schema_item_iset_type( item , 1 , CONFIG_EXISTING_PATH );
  config_schema_item_iset_type( item , 3 , CONFIG_EXISTING_PATH );



  item = config_add_key_value( config , GEN_KW_TAG_FORMAT_KEY , false , CONFIG_STRING);
  item = config_add_schema_item(config , SCHEDULE_PREDICTION_FILE_KEY , false  );
  /* scedhule_prediction_file   filename  <parameters:> <init_files:> */
  config_schema_item_set_argc_minmax(item , 1 , 3 );
  config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH );



  enkf_config_node_add_GEN_PARAM_config_schema( config );
  enkf_config_node_add_GEN_DATA_config_schema( config );
  enkf_config_node_add_CUSTOM_KW_config_schema( config );

  item = config_add_schema_item(config , SUMMARY_KEY , false  );   /* can have several summary keys on each line. */
  config_schema_item_set_argc_minmax(item , 1 , CONFIG_DEFAULT_ARG_MAX);

  item = config_add_schema_item(config , CONTAINER_KEY , false  );   /* can have several summary keys on each line. */
  config_schema_item_set_argc_minmax(item , 2 , CONFIG_DEFAULT_ARG_MAX);
  
  item = config_add_schema_item( config , SURFACE_KEY , false  );
  config_schema_item_set_argc_minmax(item , 4 , 5 );
  
  /*
     the way config info is entered for fields is unfortunate because
     it is difficult/impossible to let the config system handle run
     time validation of the input.
  */

  item = config_add_schema_item(config , FIELD_KEY , false  );
  config_schema_item_set_argc_minmax(item , 2 , CONFIG_DEFAULT_ARG_MAX);
  config_schema_item_add_required_children(item , GRID_KEY);   /* if you are using a field - you must have a grid. */
}
Exemplo n.º 4
0
void config_init( config_parser_type * config ) {


  config_add_schema_item( config , "CASE_LIST"      , true );
  config_add_key_value( config , "NUM_INTERP" , false , CONFIG_INT);

  {
    config_schema_item_type * item;
    item = config_add_schema_item( config , "OUTPUT" , true );
    config_schema_item_set_argc_minmax( item , 2 , CONFIG_DEFAULT_ARG_MAX );
    config_schema_item_set_indexed_selection_set( item , 1 , 3 , (const char *[3]) { S3GRAPH_STRING , HEADER_STRING , PLAIN_STRING });
  }
Exemplo n.º 5
0
void plot_config_add_config_items( config_type * config ) {
  config_add_key_value(config , PLOT_HEIGHT_KEY       , false , CONFIG_INT);
  config_add_key_value(config , PLOT_WIDTH_KEY        , false , CONFIG_INT);
  config_add_key_value(config , PLOT_PATH_KEY         , false , CONFIG_STRING);
  config_add_key_value(config , IMAGE_VIEWER_KEY      , false , CONFIG_PATH);
  config_add_key_value(config , PLOT_ERRORBAR_KEY     , false , CONFIG_BOOL);
  config_add_key_value(config , PLOT_ERRORBAR_MAX_KEY , false , CONFIG_INT);

  {
    config_schema_item_type * item;
    
    item = config_add_key_value(config , IMAGE_TYPE_KEY , false , CONFIG_STRING);
    config_schema_item_set_common_selection_set( item , 3 , (const char *[3]) {"png" , "jpg" , "psc"});

    item = config_add_key_value(config , PLOT_DRIVER_KEY , false , CONFIG_STRING);
    config_schema_item_set_common_selection_set( item , 2 , (              const char *[2]) {"PLPLOT" , "TEXT"});