Пример #1
0
static void ecl_sum_data_add_ecl_file(ecl_sum_data_type * data         , 
                                      time_t load_end , 
                                      int   report_step                , 
                                      const ecl_file_type   * ecl_file , 
                                      const ecl_smspec_type * smspec) {
  
  
  int num_ministep  = ecl_file_get_num_named_kw( ecl_file , PARAMS_KW);
  if (num_ministep > 0) {
    int ikw;

    for (ikw = 0; ikw < num_ministep; ikw++) {
      ecl_kw_type * ministep_kw = ecl_file_iget_named_kw( ecl_file , MINISTEP_KW , ikw);
      ecl_kw_type * params_kw   = ecl_file_iget_named_kw( ecl_file , PARAMS_KW   , ikw);

      {
        ecl_sum_tstep_type * tstep;
        int ministep_nr = ecl_kw_iget_int( ministep_kw , 0 );
        tstep = ecl_sum_tstep_alloc_from_file( report_step , 
                                               ministep_nr ,
                                               params_kw , 
                                               ecl_file_get_src_file( ecl_file ),
                                               smspec );
        
        if (tstep != NULL) {
          if (load_end == 0 || (ecl_sum_tstep_get_sim_time( tstep ) < load_end))
            ecl_sum_data_append_tstep__( data , ministep_nr , tstep );
          else 
            /* This tstep is in a time-period overlapping with data we
               already have; discard this. */
            ecl_sum_tstep_free( tstep );
        }
      }
    }
  }
}
Пример #2
0
void ecl_sum_tstep_free__( void * __ministep) {
  ecl_sum_tstep_type * ministep = ecl_sum_tstep_safe_cast( __ministep );
  ecl_sum_tstep_free( ministep );
}