コード例 #1
0
ファイル: ecl_config.c プロジェクト: JacobStoren/ert
void ecl_config_set_schedule_file( ecl_config_type * ecl_config , const char * schedule_file ) {
  if (ecl_config->start_date == -1)
    util_abort("%s: must set ecl_data_file first \n",__func__);
  {
    char * base;  /* The schedule target file will be without any path component */
    char * ext;
    util_alloc_file_components(schedule_file , NULL , &base , &ext);
    ecl_config->schedule_target_file = util_alloc_filename(NULL , base , ext);
    free(ext);
    free(base);
  }
  ecl_config->sched_file = sched_file_alloc( ecl_config->start_date );
  
  
  sched_file_parse(ecl_config->sched_file , schedule_file );
  ecl_config->last_history_restart = sched_file_get_num_restart_files( ecl_config->sched_file ) - 1;   /* We keep track of this - so we can stop assimilation at the end of history */
  {
    hash_iter_type * iter = hash_iter_alloc( ecl_config->fixed_length_kw );
    while (!hash_iter_is_complete( iter )) {
      const char * key = hash_iter_get_next_key( iter );
      int length       = hash_get_int( ecl_config->fixed_length_kw , key );
      
      sched_file_add_fixed_length_kw( ecl_config->sched_file , key , length);
    }
    hash_iter_free( iter );
  }
}
コード例 #2
0
ファイル: sched_file.c プロジェクト: YingfangZhou/ert
sched_file_type * sched_file_parse_alloc(const char * filename , time_t start_date) {
  sched_file_type * sched_file = sched_file_alloc( start_date );
  sched_file_parse(sched_file , filename);
  return sched_file;
}