Esempio n. 1
0
const char * ecl_config_get_schedule_file(const ecl_config_type * ecl_config)
{
  if (ecl_config->sched_file != NULL )
    return sched_file_iget_filename(ecl_config->sched_file, 0);
  else
    return NULL ;
}
Esempio n. 2
0
void ecl_config_fprintf_config( const ecl_config_type * ecl_config , FILE * stream ) {
  fprintf( stream , CONFIG_COMMENTLINE_FORMAT );
  fprintf( stream , CONFIG_COMMENT_FORMAT , "Here comes configuration information related to the ECLIPSE model.");

  fprintf( stream , CONFIG_KEY_FORMAT      , DATA_FILE_KEY );
  fprintf( stream , CONFIG_ENDVALUE_FORMAT , ecl_config->data_file );
  
  fprintf( stream , CONFIG_KEY_FORMAT      , SCHEDULE_FILE_KEY );
  fprintf( stream , CONFIG_ENDVALUE_FORMAT , sched_file_iget_filename( ecl_config->sched_file , 0));

  fprintf( stream , CONFIG_KEY_FORMAT      , ECLBASE_KEY );
  fprintf( stream , CONFIG_ENDVALUE_FORMAT , path_fmt_get_fmt( ecl_config->eclbase ));

  if (ecl_config->include_all_static_kw) {
    fprintf( stream , CONFIG_KEY_FORMAT      , STATIC_KW_KEY );
    fprintf( stream , CONFIG_ENDVALUE_FORMAT , DEFAULT_ALL_STATIC_KW );
  }
  {
    int size = stringlist_get_size( ecl_config->user_static_kw );
    if (size > 0) {
      int i;
      fprintf( stream , CONFIG_KEY_FORMAT      , STATIC_KW_KEY );
      for (i=0; i < size; i++)
        if (i < (size -1 ))
          fprintf( stream , CONFIG_VALUE_FORMAT      , stringlist_iget( ecl_config->user_static_kw , i));
        else
          fprintf( stream , CONFIG_ENDVALUE_FORMAT      , stringlist_iget( ecl_config->user_static_kw , i));
    }
  }

  /*
    if (ecl_config->refcase != NULL) {
    fprintf( stream , CONFIG_KEY_FORMAT      , REFCASE_KEY );
    fprintf( stream , CONFIG_ENDVALUE_FORMAT , ecl_config_get_refcase_name( ecl_config ));
    }
  */

  if (ecl_config->grid != NULL) {
    fprintf( stream , CONFIG_KEY_FORMAT      , GRID_KEY );
    fprintf( stream , CONFIG_ENDVALUE_FORMAT , ecl_config_get_gridfile( ecl_config ));
  }

  if (ecl_config->schedule_prediction_file != NULL) {
    fprintf( stream , CONFIG_KEY_FORMAT      , SCHEDULE_PREDICTION_FILE_KEY );
    fprintf( stream , CONFIG_ENDVALUE_FORMAT , ecl_config_get_schedule_prediction_file( ecl_config ));
  }
  
  if (ecl_config->init_section != NULL) {
    fprintf( stream , CONFIG_KEY_FORMAT      , INIT_SECTION_KEY );
    fprintf( stream , CONFIG_ENDVALUE_FORMAT , ecl_config_get_init_section( ecl_config ));
  }

  
  {
    hash_iter_type * iter = hash_iter_alloc( ecl_config->fixed_length_kw );
    while (!hash_iter_is_complete( iter )) {
      const char  * kw  = hash_iter_get_next_key( iter );
      int   length      = hash_get_int( ecl_config->fixed_length_kw , kw); 

      fprintf( stream , CONFIG_KEY_FORMAT    , ADD_FIXED_LENGTH_SCHEDULE_KW_KEY );
      fprintf( stream , CONFIG_VALUE_FORMAT  , kw );
      fprintf( stream , CONFIG_INT_FORMAT    , length );
      fprintf( stream , "\n");
      
    }
    hash_iter_free( iter );
  }

  
  
  fprintf(stream , "\n\n");
}