void qc_module_init( qc_module_type * qc_module , const config_type * config) { if (config_item_set( config , QC_PATH_KEY )) qc_module_set_path( qc_module , config_get_value( config , QC_PATH_KEY )); if (config_item_set( config , QC_WORKFLOW_KEY)) { const char * qc_workflow = config_get_value_as_path(config , QC_WORKFLOW_KEY); qc_module_set_workflow( qc_module , qc_workflow ); } }
void ecl_config_init( ecl_config_type * ecl_config , const config_type * config ) { if (config_item_set( config , ECLBASE_KEY )) ecl_config_set_eclbase( ecl_config , config_iget(config , ECLBASE_KEY ,0,0) ); if (config_item_set( config , DATA_FILE_KEY )) ecl_config_set_data_file( ecl_config , config_iget( config , DATA_FILE_KEY ,0,0)); if (config_item_set( config , SCHEDULE_FILE_KEY )) ecl_config_set_schedule_file( ecl_config , config_iget( config , SCHEDULE_FILE_KEY ,0,0)); if (config_item_set(config , GRID_KEY)) ecl_config_set_grid( ecl_config , config_iget(config , GRID_KEY , 0,0) ); if (config_item_set( config , ADD_FIXED_LENGTH_SCHEDULE_KW_KEY)) { int iocc; for (iocc = 0; iocc < config_get_occurences(config , ADD_FIXED_LENGTH_SCHEDULE_KW_KEY); iocc++) ecl_config_add_fixed_length_schedule_kw( ecl_config , config_iget(config , ADD_FIXED_LENGTH_SCHEDULE_KW_KEY , iocc , 0) , config_iget_as_int(config , ADD_FIXED_LENGTH_SCHEDULE_KW_KEY , iocc , 1)); } if (config_item_set( config , REFCASE_KEY)) { const char * refcase_path = config_get_value_as_path( config , REFCASE_KEY ); if (!ecl_config_load_refcase( ecl_config , refcase_path)) fprintf(stderr,"** Warning: loading refcase:%s failed \n", refcase_path); } if (config_item_set( config , REFCASE_LIST_KEY)) { config_content_item_type * item = config_get_content_item( config , REFCASE_LIST_KEY); int i; for (i=0; i < config_content_item_get_size( item ); i++) { config_content_node_type * node = config_content_item_iget_node( item , i ); int j; for (j=0; j < config_content_node_get_size( node ); j++) { const char * case_glob = config_content_node_iget_as_path( node , j ); ecl_refcase_list_add_matching( ecl_config->refcase_list , case_glob ); } } } /* Deprecated */ if (config_item_set( config , PLOT_REFCASE_LIST_KEY)) { const char * case_list_file = config_get_value( config , PLOT_REFCASE_LIST_KEY); FILE * stream = util_fopen(case_list_file , "r"); bool at_eof; do { char * case_name = util_fscanf_alloc_line(stream , &at_eof); if (case_name) { ecl_refcase_list_add_case( ecl_config->refcase_list , case_name); free( case_name ); } } while (!at_eof); fclose( stream ); } if (config_item_set(config , INIT_SECTION_KEY)) ecl_config_set_init_section( ecl_config , config_get_value( config , INIT_SECTION_KEY )); else if (ecl_config->can_restart) /** This is a hard error - the datafile contains <INIT>, however the config file does NOT contain INIT_SECTION, i.e. we have no information to fill in for the <INIT> section. This case will not be able to initialize an ECLIPSE model, and that is broken behaviour. */ util_exit("Sorry: when the datafile contains <INIT> the config file MUST have the INIT_SECTION keyword. \n"); /* The user has not supplied a INIT_SECTION keyword whatsoever, this essentially means that we can not restart - because: 1. The EQUIL section must be inlined in the DATAFILE without any special markup. 2. ECLIPSE will fail hard if the datafile contains both an EQUIL section and a restart statement, and when we have not marked the EQUIL section specially with the INIT_SECTION keyword it is impossible for ERT to dynamically change between a datafile with initialisation and a datafile for restart. IFF the user has no intentitions of any form of restart, this is perfectly legitemate. */ if (config_item_set( config , END_DATE_KEY )) { const char * date_string = config_get_value( config , END_DATE_KEY ); time_t end_date; if (util_sscanf_date( date_string , &end_date)) ecl_config_set_end_date( ecl_config , end_date ); else fprintf(stderr,"** WARNING **: Failed to parse %s as a date - should be in format dd/mm/yyyy \n",date_string); } }