smspec_node_type * smspec_node_alloc_lgr( ecl_smspec_var_type var_type , const char * wgname , const char * keyword , const char * unit , const char * lgr , const char * key_join_string , int lgr_i, int lgr_j , int lgr_k, int param_index , float default_value) { smspec_node_type * smspec_node = smspec_node_alloc_new( param_index , default_value ); smspec_node_init_lgr( smspec_node , var_type , wgname , keyword , unit , lgr , key_join_string , lgr_i, lgr_j , lgr_k); return smspec_node; }
smspec_node_type * smspec_node_alloc( ecl_smspec_var_type var_type , const char * wgname , const char * keyword , const char * unit , const char * key_join_string , const int grid_dims[3] , int num , int param_index, float default_value) { /* Well and group names in the wgname parameter is quite messy. The situation is as follows: o The ECLIPSE SMSPEC files are very verbose, and contain many entries like this: KEYWORD : "WWCT" WGNAME : ":+:+:+:+" i.e. the keyword indicates that this is a perfectly legitimate well variable, however the special wgname value ":+:+:+:+" shows that this just a rubbish entry. We do not want to internalize these rubbish entries and this function should just return NULL. The ":+:+:+:+" string is in the #define symbol DUMMY_WELL and the macro IS_DUMMY_WELL(wgname) can used to compare with the DUMMY_WELL value. o When the ecl_sum instance is created in write mode; it must be possible to add smspec nodes for wells/groups which do not have a name yet. In this case we accept NULL as input value for the wgname parameter. o In the case of variables which do not use the wgname variable at all, e.g. like "FOPT" - the wgname input value is ignored completely. */ smspec_node_type * smspec_node = smspec_node_alloc_new( param_index , default_value ); if (smspec_node_init( smspec_node , var_type , wgname , keyword , unit , key_join_string , grid_dims, num)) return smspec_node; else { smspec_node_free( smspec_node ); return NULL; } }
smspec_node_type * ecl_sum_add_blank_var( ecl_sum_type * ecl_sum , float default_value) { smspec_node_type * smspec_node = smspec_node_alloc_new( -1 , default_value ); ecl_smspec_add_node( ecl_sum->smspec , smspec_node ); return smspec_node; }