static void ecl_rft_node_init_PLT_cells( ecl_rft_node_type * rft_node , const ecl_file_view_type * rft_view) { /* For PLT there is quite a lot of extra information which is not yet internalized. */ const ecl_kw_type * conipos = ecl_file_view_iget_named_kw( rft_view , CONIPOS_KW , 0); const ecl_kw_type * conjpos = ecl_file_view_iget_named_kw( rft_view , CONJPOS_KW , 0); const ecl_kw_type * conkpos = ecl_file_view_iget_named_kw( rft_view , CONKPOS_KW , 0); const int * i = ecl_kw_get_int_ptr( conipos ); const int * j = ecl_kw_get_int_ptr( conjpos ); const int * k = ecl_kw_get_int_ptr( conkpos ); const float * WR = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONWRAT_KW , 0)); const float * GR = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONGRAT_KW , 0)); const float * OR = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONORAT_KW , 0)); const float * P = ecl_kw_get_float_ptr( ecl_rft_node_get_pressure_kw( rft_node , rft_view )); const float * depth = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONDEPTH_KW , 0)); const float * flowrate = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONVTUB_KW , 0)); const float * oil_flowrate = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONOTUB_KW , 0)); const float * gas_flowrate = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONGTUB_KW , 0)); const float * water_flowrate = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONWTUB_KW , 0)); const float * connection_start = NULL; const float * connection_end = NULL; /* The keywords CONLENST_KW and CONLENEN_KW are ONLY present if we are dealing with a MSW well. */ if (ecl_file_view_has_kw( rft_view , CONLENST_KW)) connection_start = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONLENST_KW , 0)); if (ecl_file_view_has_kw( rft_view , CONLENEN_KW)) connection_end = ecl_kw_get_float_ptr( ecl_file_view_iget_named_kw( rft_view , CONLENEN_KW , 0)); { int c; for ( c = 0; c < ecl_kw_get_size( conipos ); c++) { ecl_rft_cell_type * cell; double cs = 0; double ce = 0; if (connection_start) cs = connection_start[c]; if (connection_end) ce = connection_end[c]; /* The connection coordinates are shifted -= 1; i.e. all internal usage is offset 0. */ cell = ecl_rft_cell_alloc_PLT( i[c] -1 , j[c] -1 , k[c] -1 , depth[c] , P[c] , OR[c] , GR[c] , WR[c] , cs , ce, flowrate[c] , oil_flowrate[c] , gas_flowrate[c] , water_flowrate[c]); ecl_rft_node_append_cell( rft_node , cell ); } } }
ecl_rsthead_type * ecl_rsthead_alloc( const ecl_file_view_type * rst_view, int report_step) { const ecl_kw_type * intehead_kw = ecl_file_view_iget_named_kw( rst_view , INTEHEAD_KW , 0); // const ecl_kw_type * doubhead_kw = ecl_file_view_iget_named_kw(rst_view, DOUBHEAD_KW, 0); const ecl_kw_type * doubhead_kw = NULL;//ecl_file_view_iget_named_kw( rst_view , DOUBHEAD_KW , 0); const ecl_kw_type * logihead_kw = NULL; if (ecl_file_view_has_kw(rst_view, LOGIHEAD_KW)) logihead_kw = ecl_file_view_iget_named_kw( rst_view , LOGIHEAD_KW , 0); if (ecl_file_view_has_kw(rst_view, DOUBHEAD_KW)) doubhead_kw = ecl_file_view_iget_named_kw(rst_view, DOUBHEAD_KW, 0); if (ecl_file_view_has_kw( rst_view , SEQNUM_KW)) { const ecl_kw_type * seqnum_kw = ecl_file_view_iget_named_kw( rst_view , SEQNUM_KW , 0); report_step = ecl_kw_iget_int( seqnum_kw , 0); } return ecl_rsthead_alloc_from_kw( report_step , intehead_kw , doubhead_kw , logihead_kw ); }
ecl_rft_node_type * ecl_rft_node_alloc(const ecl_file_view_type * rft_view) { ecl_kw_type * welletc = ecl_file_view_iget_named_kw(rft_view , WELLETC_KW , 0); ecl_rft_node_type * rft_node = ecl_rft_node_alloc_empty(ecl_kw_iget_ptr(welletc , WELLETC_TYPE_INDEX)); if (rft_node != NULL) { ecl_kw_type * date_kw = ecl_file_view_iget_named_kw( rft_view , DATE_KW , 0); rft_node->well_name = util_alloc_strip_copy( ecl_kw_iget_ptr(welletc , WELLETC_NAME_INDEX)); /* Time information. */ { int * time = ecl_kw_get_int_ptr( date_kw ); rft_node->recording_date = ecl_util_make_date( time[DATE_DAY_INDEX] , time[DATE_MONTH_INDEX] , time[DATE_YEAR_INDEX] ); } rft_node->days = ecl_kw_iget_float( ecl_file_view_iget_named_kw( rft_view , TIME_KW , 0 ) , 0); if (ecl_file_view_has_kw( rft_view , CONLENST_KW)) rft_node->MSW = true; else rft_node->MSW = false; ecl_rft_node_init_cells( rft_node , rft_view ); } return rft_node; }