Exemple #1
0
ecl_sum_type * ecl_sum_alloc_writer( const char * ecl_case , bool fmt_output , bool unified , const char * key_join_string , time_t sim_start , bool time_in_days , int nx , int ny , int nz) {
  ecl_sum_type * ecl_sum = ecl_sum_alloc__( ecl_case , key_join_string );
  ecl_sum_set_unified( ecl_sum , unified );
  ecl_sum_set_fmt_case( ecl_sum , fmt_output );

  ecl_sum->smspec = ecl_smspec_alloc_writer( key_join_string , sim_start , time_in_days , nx , ny , nz );
  ecl_sum->data   = ecl_sum_data_alloc_writer( ecl_sum->smspec );

  return ecl_sum;
}
Exemple #2
0
static void ecl_sum_fread(ecl_sum_type * ecl_sum , const char *header_file , const stringlist_type *data_files , bool include_restart) {

  ecl_sum->smspec = ecl_smspec_fread_alloc( header_file , ecl_sum->key_join_string , include_restart);
  {
    bool fmt_file;
    ecl_util_get_file_type( header_file , &fmt_file , NULL);
    ecl_sum_set_fmt_case( ecl_sum , fmt_file );
  }
  ecl_sum_fread_data( ecl_sum , data_files , include_restart );

  {
    ecl_file_enum file_type = ecl_util_get_file_type( stringlist_iget( data_files , 0 ) , NULL , NULL);

    if (file_type == ECL_SUMMARY_FILE)
      ecl_sum_set_unified( ecl_sum , false );
    else if (file_type == ECL_UNIFIED_SUMMARY_FILE)
      ecl_sum_set_unified( ecl_sum , true);
    else
      util_abort("%s: what the f**k? \n",__func__);
  }
}