mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Updated ERT, opm-common and opm-parser
ERT 80650d05d49b419ec74ba316312313dfc6ba0875 opm-common e7db252f3e310a04718f315e6cdb9d6c428c5762 opm-parser 817722b99baa62cc63a5f859cc90b951f0b0636e
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_QC_H__
|
||||
#define __ENKF_TUI_QC_H__
|
||||
#ifndef ERT_ENKF_TUI_QC_H
|
||||
#define ERT_ENKF_TUI_QC_H
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_ANALYSIS_H__
|
||||
#define __ENKF_TUI_ANALYSIS_H__
|
||||
#ifndef ERT_ENKF_TUI_ANALYSIS_H
|
||||
#define ERT_ENKF_TUI_ANALYSIS_H
|
||||
|
||||
void enkf_tui_analysis_menu(void *);
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ void enkf_tui_export_field(const enkf_main_type * enkf_main , field_file_format_
|
||||
const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main);
|
||||
const bool output_transform = true;
|
||||
const enkf_config_node_type * config_node;
|
||||
state_enum analysis_state;
|
||||
const int last_report = enkf_main_get_history_length( enkf_main );
|
||||
int iens1 , iens2 , iens , report_step;
|
||||
path_fmt_type * export_path;
|
||||
@@ -53,10 +52,6 @@ void enkf_tui_export_field(const enkf_main_type * enkf_main , field_file_format_
|
||||
|
||||
report_step = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report);
|
||||
enkf_tui_util_scanf_iens_range("Realizations members to export(0 - %d)" , enkf_main_get_ensemble_size( enkf_main ) , PROMPT_LEN , &iens1 , &iens2);
|
||||
if (enkf_config_node_get_var_type( config_node ) == DYNAMIC_STATE)
|
||||
analysis_state = enkf_tui_util_scanf_state("Export Forecast/Analyzed: [F|A]" , PROMPT_LEN , false);
|
||||
else
|
||||
analysis_state = ANALYZED;
|
||||
|
||||
{
|
||||
char * path_fmt;
|
||||
@@ -71,7 +66,7 @@ void enkf_tui_export_field(const enkf_main_type * enkf_main , field_file_format_
|
||||
enkf_node_type * node = enkf_node_alloc(config_node);
|
||||
|
||||
for (iens = iens1; iens <= iens2; iens++) {
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens , .state = BOTH };
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens };
|
||||
if (enkf_node_try_load(node , fs , node_id)) {
|
||||
char * filename = path_fmt_alloc_path( export_path , false , iens);
|
||||
{
|
||||
@@ -127,17 +122,10 @@ void enkf_tui_export_gen_data(void * arg) {
|
||||
const int last_report = enkf_main_get_history_length( enkf_main );
|
||||
|
||||
const enkf_config_node_type * config_node;
|
||||
state_enum state = ANALYZED;
|
||||
path_fmt_type * file_fmt;
|
||||
|
||||
config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , GEN_DATA , INVALID_VAR);
|
||||
var_type = enkf_config_node_get_var_type(config_node);
|
||||
if ((var_type == DYNAMIC_STATE) || (var_type == DYNAMIC_RESULT))
|
||||
state = enkf_tui_util_scanf_state("Plot Forecast/Analyzed: [F|A]" , PROMPT_LEN , false);
|
||||
else if (var_type == PARAMETER)
|
||||
state = ANALYZED;
|
||||
else
|
||||
util_abort("%s: internal error \n",__func__);
|
||||
|
||||
|
||||
report_step = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report);
|
||||
@@ -158,7 +146,7 @@ void enkf_tui_export_gen_data(void * arg) {
|
||||
|
||||
msg_show( msg );
|
||||
for (iens = iens1; iens <= iens2; iens++) {
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens , .state = state };
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens};
|
||||
if (enkf_node_try_load(node , fs, node_id)) {
|
||||
char * full_path = path_fmt_alloc_path( file_fmt , false , iens);
|
||||
char * path;
|
||||
@@ -193,13 +181,11 @@ void enkf_tui_export_profile(void * enkf_main) {
|
||||
bool * report_active;
|
||||
|
||||
const enkf_config_node_type * config_node;
|
||||
state_enum analysis_state;
|
||||
int direction; /* 0: i running, 1: j running, 2: k running */
|
||||
int total_cells;
|
||||
int *cell_list;
|
||||
path_fmt_type * file_fmt;
|
||||
|
||||
analysis_state = ANALYZED; /* */
|
||||
config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD , INVALID_VAR);
|
||||
iens_active = enkf_tui_util_scanf_alloc_iens_active( ens_size , PROMPT_LEN , &iens1 , &iens2); /* Not used yet ... */
|
||||
report_active = enkf_tui_util_scanf_alloc_report_active( last_report , PROMPT_LEN );
|
||||
@@ -258,7 +244,7 @@ void enkf_tui_export_profile(void * enkf_main) {
|
||||
for (report_step = 0; report_step <= last_report; report_step++) {
|
||||
if (report_active[report_step]) {
|
||||
for (iens = iens1; iens <= iens2; iens++) {
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens , .state = analysis_state };
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens };
|
||||
if (enkf_node_try_load(node , fs, node_id)) {
|
||||
{
|
||||
const field_type * field = enkf_node_value_ptr( node );
|
||||
@@ -298,10 +284,8 @@ void enkf_tui_export_cell(void * enkf_main) {
|
||||
const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main);
|
||||
{
|
||||
const enkf_config_node_type * config_node;
|
||||
state_enum analysis_state;
|
||||
int cell_nr;
|
||||
|
||||
analysis_state = ANALYZED;
|
||||
config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD , INVALID_VAR);
|
||||
cell_nr = enkf_tui_util_scanf_ijk(enkf_config_node_get_ref(config_node) , PROMPT_LEN);
|
||||
{
|
||||
@@ -319,7 +303,7 @@ void enkf_tui_export_cell(void * enkf_main) {
|
||||
|
||||
for (report_step = 0; report_step <= last_report; report_step++) {
|
||||
if (report_active[report_step]) {
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens1 , .state = analysis_state};
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens1 };
|
||||
if (enkf_node_try_load(node , fs , node_id)) {
|
||||
for (iens = iens1; iens <= iens2; iens++) {
|
||||
node_id.iens = iens;
|
||||
@@ -360,10 +344,8 @@ void enkf_tui_export_time(void * enkf_main) {
|
||||
const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main);
|
||||
{
|
||||
const enkf_config_node_type * config_node;
|
||||
state_enum analysis_state;
|
||||
int cell_nr;
|
||||
|
||||
analysis_state = ANALYZED;
|
||||
config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD ,INVALID_VAR);
|
||||
cell_nr = enkf_tui_util_scanf_ijk(enkf_config_node_get_ref(config_node) , PROMPT_LEN);
|
||||
{
|
||||
@@ -380,17 +362,14 @@ void enkf_tui_export_time(void * enkf_main) {
|
||||
path_fmt_type * file_fmt = path_fmt_scanf_alloc("Give filename to store line (with %d for report iens) =>" , 0 , NULL , false);
|
||||
|
||||
|
||||
if (analysis_state == BOTH) {
|
||||
x = util_calloc( 2 * (step2 - step1 + 1) , sizeof * x);
|
||||
y = util_calloc( 2 * (step2 - step1 + 1) , sizeof * y);
|
||||
} else {
|
||||
{
|
||||
x = util_calloc( (step2 - step1 + 1) , sizeof * x);
|
||||
y = util_calloc( (step2 - step1 + 1) , sizeof * y);
|
||||
}
|
||||
|
||||
|
||||
for (iens = iens1; iens <= iens2; iens++) {
|
||||
enkf_tui_util_get_time(fs , config_node , node , analysis_state , cell_nr , step1 , step2 , iens , x ,y);
|
||||
enkf_tui_util_get_time(fs , config_node , node , cell_nr , step1 , step2 , iens , x ,y);
|
||||
{
|
||||
char * filename = path_fmt_alloc_file(file_fmt , true , iens);
|
||||
FILE * stream = util_fopen(filename , "w");
|
||||
@@ -399,10 +378,6 @@ void enkf_tui_export_time(void * enkf_main) {
|
||||
for (report_step = step1; report_step <= step2; report_step++) {
|
||||
fprintf(stream , "%g %g \n",x[index] , y[index]);
|
||||
index++;
|
||||
if (analysis_state == BOTH) {
|
||||
fprintf(stream , "%g %g \n",x[index] , y[index]);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
fclose(stream);
|
||||
free(filename);
|
||||
@@ -422,7 +397,6 @@ void enkf_tui_export_time(void * enkf_main) {
|
||||
void enkf_tui_export_fieldP(void * arg) {
|
||||
enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
|
||||
const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main);
|
||||
state_enum analysis_state = BOTH;
|
||||
const enkf_config_node_type * config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD , INVALID_VAR );
|
||||
int iens1 = 0;
|
||||
int iens2 = enkf_main_get_ensemble_size( enkf_main );
|
||||
@@ -435,7 +409,7 @@ void enkf_tui_export_fieldP(void * arg) {
|
||||
export_file = util_alloc_stdin_line();
|
||||
{
|
||||
enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main);
|
||||
enkf_node_type ** ensemble = enkf_node_load_alloc_ensemble( config_node , fs , report_step , iens1 , iens2 , analysis_state );
|
||||
enkf_node_type ** ensemble = enkf_node_load_alloc_ensemble( config_node , fs , report_step , iens1 , iens2 );
|
||||
enkf_node_type * sum = enkf_node_alloc( config_node );
|
||||
int active_ens_size = 0;
|
||||
int iens;
|
||||
@@ -565,7 +539,6 @@ void enkf_tui_export_scalar2csv(void * arg) {
|
||||
msg_type * msg = msg_alloc("Exporting report_step/member: " , false);
|
||||
node_id_type node_id;
|
||||
|
||||
node_id.state = BOTH;
|
||||
|
||||
/* Header line */
|
||||
fprintf(stream , "\"Report step\"");
|
||||
@@ -619,12 +592,10 @@ void enkf_tui_export_stat(void * arg) {
|
||||
{
|
||||
const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main);
|
||||
const enkf_config_node_type * config_node;
|
||||
state_enum analysis_state;
|
||||
const int ens_size = enkf_main_get_ensemble_size( enkf_main );
|
||||
const int last_report = enkf_main_get_history_length( enkf_main );
|
||||
int report_step;
|
||||
|
||||
analysis_state = ANALYZED; /* Hardcoded analyzed */
|
||||
config_node = enkf_tui_util_scanf_key( ensemble_config , PROMPT_LEN , INVALID , INVALID_VAR );
|
||||
report_step = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report);
|
||||
{
|
||||
@@ -661,8 +632,7 @@ void enkf_tui_export_stat(void * arg) {
|
||||
enkf_node_type ** ensemble = enkf_main_get_node_ensemble( enkf_main ,
|
||||
enkf_main_tui_get_fs( enkf_main ) ,
|
||||
enkf_config_node_get_key( config_node ) ,
|
||||
report_step ,
|
||||
analysis_state );
|
||||
report_step );
|
||||
enkf_node_type * mean = enkf_node_copyc( ensemble[0] );
|
||||
enkf_node_type * std = enkf_node_copyc( ensemble[0] );
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_EXPORT_H__
|
||||
#define __ENKF_TUI_EXPORT_H__
|
||||
#ifndef ERT_ENKF_TUI_EXPORT_H
|
||||
#define ERT_ENKF_TUI_EXPORT_H
|
||||
|
||||
void enkf_tui_export_menu(void *);
|
||||
|
||||
|
||||
@@ -137,9 +137,7 @@ static void enkf_tui_fs_copy_ensemble__(
|
||||
const char * source_case,
|
||||
const char * target_case,
|
||||
int report_step_from,
|
||||
state_enum state_from,
|
||||
int report_step_to,
|
||||
state_enum state_to,
|
||||
bool only_parameters)
|
||||
{
|
||||
msg_type * msg = msg_alloc("Copying: " , false);
|
||||
@@ -186,7 +184,7 @@ static void enkf_tui_fs_copy_ensemble__(
|
||||
const char * key = stringlist_iget(nodes, i);
|
||||
enkf_config_node_type * config_node = ensemble_config_get_node(config , key);
|
||||
msg_update(msg , key);
|
||||
enkf_node_copy_ensemble(config_node, src_fs , target_fs , report_step_from, state_from, report_step_to , state_to , ens_size , ranking_permutation);
|
||||
enkf_node_copy_ensemble(config_node, src_fs , target_fs , report_step_from, report_step_to , ens_size , ranking_permutation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +208,6 @@ void enkf_tui_fs_initialize_case_from_copy(void * arg)
|
||||
int ens_size;
|
||||
int last_report;
|
||||
int src_step;
|
||||
state_enum src_state;
|
||||
enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
|
||||
|
||||
ens_size = enkf_main_get_ensemble_size( enkf_main );
|
||||
@@ -221,9 +218,8 @@ void enkf_tui_fs_initialize_case_from_copy(void * arg)
|
||||
source_case = enkf_tui_fs_alloc_existing_case( enkf_main , "Initialize from case" , prompt_len);
|
||||
if (source_case != NULL) {
|
||||
src_step = util_scanf_int_with_limits("Source report step",prompt_len , 0 , last_report);
|
||||
src_state = enkf_tui_util_scanf_state("Source analyzed/forecast [A|F]" , prompt_len , false);
|
||||
enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , source_case , false );
|
||||
enkf_main_init_current_case_from_existing(enkf_main, source_fs , src_step , src_state);
|
||||
enkf_main_init_current_case_from_existing(enkf_main, source_fs , src_step);
|
||||
enkf_fs_decref(source_fs);
|
||||
}
|
||||
util_safe_free( source_case );
|
||||
@@ -240,8 +236,6 @@ void enkf_tui_fs_copy_ensemble(void * arg)
|
||||
int report_step_from;
|
||||
char * report_step_from_as_char;
|
||||
int report_step_to;
|
||||
state_enum state_from;
|
||||
state_enum state_to;
|
||||
|
||||
enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
|
||||
|
||||
@@ -251,8 +245,7 @@ void enkf_tui_fs_copy_ensemble(void * arg)
|
||||
report_step_from_as_char = util_scanf_int_with_limits_return_char("Source report step",prompt_len , 0 , last_report);
|
||||
if(strlen(report_step_from_as_char) !=0){
|
||||
util_sscanf_int(report_step_from_as_char , &report_step_from);
|
||||
state_from = enkf_tui_util_scanf_state("Source analyzed/forecast [a|f]" , prompt_len , false);
|
||||
if(state_from != UNDEFINED) {
|
||||
{
|
||||
util_printf_prompt("Target case" , prompt_len , '=' , "=> ");
|
||||
char target_case[256];
|
||||
|
||||
@@ -266,10 +259,7 @@ void enkf_tui_fs_copy_ensemble(void * arg)
|
||||
char * report_step_to_as_char = util_scanf_int_with_limits_return_char("Target report step",prompt_len , 0 , last_report);
|
||||
if (strlen(report_step_to_as_char)) {
|
||||
util_sscanf_int(report_step_to_as_char , &report_step_to);
|
||||
state_to = enkf_tui_util_scanf_state("Target analyzed/forecast [a|f]" , prompt_len , false);
|
||||
if(state_to != UNDEFINED) {
|
||||
enkf_tui_fs_copy_ensemble__(enkf_main, source_case, target_case, report_step_from, state_from, report_step_to, state_to, false);
|
||||
}
|
||||
enkf_tui_fs_copy_ensemble__(enkf_main, source_case, target_case, report_step_from, report_step_to, false);
|
||||
}
|
||||
free(report_step_to_as_char);
|
||||
}
|
||||
@@ -290,8 +280,6 @@ void enkf_tui_fs_copy_ensemble_of_parameters(void * arg)
|
||||
int report_step_from;
|
||||
char * report_step_from_as_char;
|
||||
int report_step_to;
|
||||
state_enum state_from;
|
||||
state_enum state_to;
|
||||
|
||||
enkf_main_type * enkf_main = enkf_main_safe_cast( arg );
|
||||
|
||||
@@ -301,8 +289,7 @@ void enkf_tui_fs_copy_ensemble_of_parameters(void * arg)
|
||||
report_step_from_as_char = util_scanf_int_with_limits_return_char("Source report step",prompt_len , 0 , last_report);
|
||||
if(strlen(report_step_from_as_char) !=0){
|
||||
util_sscanf_int(report_step_from_as_char , &report_step_from);
|
||||
state_from = enkf_tui_util_scanf_state("Source analyzed/forecast [a|f]" , prompt_len , false);
|
||||
if(state_from != UNDEFINED){
|
||||
{
|
||||
|
||||
util_printf_prompt("Target case" , prompt_len , '=' , "=> ");
|
||||
char target_case[256];
|
||||
@@ -317,10 +304,7 @@ void enkf_tui_fs_copy_ensemble_of_parameters(void * arg)
|
||||
char * report_step_to_as_char = util_scanf_int_with_limits_return_char("Target report step",prompt_len , 0 , last_report);
|
||||
if(strlen(report_step_to_as_char) !=0){
|
||||
util_sscanf_int(report_step_to_as_char , &report_step_to);
|
||||
state_to = enkf_tui_util_scanf_state("Target analyzed/forecast [a|f]" , prompt_len , false);
|
||||
if(state_to != UNDEFINED){
|
||||
enkf_tui_fs_copy_ensemble__(enkf_main, source_case, target_case, report_step_from, state_from, report_step_to, state_to, true);
|
||||
}
|
||||
enkf_tui_fs_copy_ensemble__(enkf_main, source_case, target_case, report_step_from, report_step_to, true);
|
||||
}
|
||||
free(report_step_to_as_char);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_FS_H__
|
||||
#define __ENKF_TUI_FS_H__
|
||||
#ifndef ERT_ENKF_TUI_FS_H
|
||||
#define ERT_ENKF_TUI_FS_H
|
||||
|
||||
void enkf_tui_fs_menu(void * );
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_HELP_H__
|
||||
#define __ENKF_TUI_HELP_H__
|
||||
#ifndef ERT_ENKF_TUI_HELP_H
|
||||
#define ERT_ENKF_TUI_HELP_H
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,10 @@ void enkf_tui_init(enkf_main_type * enkf_main, bool all_members , bool all_param
|
||||
|
||||
if (param_list != NULL) {
|
||||
enkf_fs_type * init_fs = enkf_main_tui_get_fs( enkf_main );
|
||||
enkf_main_initialize_from_scratch(enkf_main , init_fs , param_list , iens1 , iens2 , init_mode);
|
||||
bool_vector_type * iens_mask = bool_vector_alloc( ens_size , false );
|
||||
bool_vector_iset_block( iens_mask , iens1 , iens2 - iens1 + 1, true );
|
||||
enkf_main_initialize_from_scratch(enkf_main , init_fs , param_list , iens_mask , init_mode);
|
||||
bool_vector_free( iens_mask );
|
||||
stringlist_free( param_list );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_INIT_H__
|
||||
#define __ENKF_TUI_INIT_H__
|
||||
#ifndef ERT_ENKF_TUI_INIT_H
|
||||
#define ERT_ENKF_TUI_INIT_H
|
||||
|
||||
|
||||
void enkf_tui_init_menu(void * );
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_INTER_MAIN_H__
|
||||
#define __ENKF_INTER_MAIN_H__
|
||||
#ifndef ERT_ENKF_INTER_MAIN_H
|
||||
#define ERT_ENKF_INTER_MAIN_H
|
||||
#include <ert/enkf/enkf_main.h>
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_MISC_H__
|
||||
#define __ENKF_TUI_MISC_H__
|
||||
#ifndef ERT_ENKF_TUI_MISC_H
|
||||
#define ERT_ENKF_TUI_MISC_H
|
||||
|
||||
|
||||
void enkf_tui_misc_menu( void * arg);
|
||||
|
||||
@@ -119,7 +119,6 @@ static void enkf_tui_ranking_create_data__( void * arg , bool sort_increasing) {
|
||||
const char * prompt2 = "Report step of data [Blank: last step]";
|
||||
const char * ranking_name = "Name of new ranking";
|
||||
|
||||
state_enum state = FORECAST;
|
||||
char * user_key;
|
||||
|
||||
util_printf_prompt(prompt1 , prompt_len , '=' , "=> ");
|
||||
@@ -147,7 +146,7 @@ static void enkf_tui_ranking_create_data__( void * arg , bool sort_increasing) {
|
||||
util_printf_prompt(ranking_name , prompt_len , '=' , "=> ");
|
||||
char * ranking_key = util_alloc_stdin_line();
|
||||
if (ranking_key != NULL) {
|
||||
ranking_table_add_data_ranking( ranking_table , sort_increasing , ranking_key , user_key , key_index , fs , config_node, step , state );
|
||||
ranking_table_add_data_ranking( ranking_table , sort_increasing , ranking_key , user_key , key_index , fs , config_node, step );
|
||||
ranking_table_display_ranking( ranking_table , ranking_key );
|
||||
}
|
||||
util_safe_free( ranking_key );
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_RANKING_H__
|
||||
#define __ENKF_TUI_RANKING_H__
|
||||
#ifndef ERT_ENKF_TUI_RANKING_H
|
||||
#define ERT_ENKF_TUI_RANKING_H
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ void enkf_tui_run_exp(void * enkf_main) {
|
||||
free( prompt );
|
||||
}
|
||||
if (bool_vector_count_equal(iactive , true))
|
||||
enkf_main_run_exp(enkf_main , iactive , true );
|
||||
enkf_main_run_exp(enkf_main , iactive );
|
||||
|
||||
bool_vector_free(iactive);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ void enkf_tui_run_create_runpath__(void * __enkf_main) {
|
||||
util_safe_free( select_string );
|
||||
free( prompt );
|
||||
}
|
||||
enkf_main_run_exp(enkf_main , iactive , false );
|
||||
enkf_main_create_run_path(enkf_main , iactive , 0 );
|
||||
bool_vector_free(iactive);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_RUN_H__
|
||||
#define __ENKF_TUI_RUN_H__
|
||||
#ifndef ERT_ENKF_TUI_RUN_H
|
||||
#define ERT_ENKF_TUI_RUN_H
|
||||
|
||||
void enkf_tui_run_menu(void *);
|
||||
void enkf_tui_run_exp(void *);
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_SIMPLE_H__
|
||||
#define __ENKF_TUI_SIMPLE_H__
|
||||
#ifndef ERT_ENKF_TUI_SIMPLE_H
|
||||
#define ERT_ENKF_TUI_SIMPLE_H
|
||||
|
||||
|
||||
void enkf_tui_simple_menu(void * );
|
||||
|
||||
@@ -146,7 +146,6 @@ static void enkf_tui_table__(enkf_main_type * enkf_main , bool gen_kw_table , bo
|
||||
}
|
||||
|
||||
{
|
||||
state_enum state = FORECAST;
|
||||
int active_length = 0;
|
||||
int total_line_count = 0;
|
||||
double line[num_keys];
|
||||
@@ -159,8 +158,7 @@ static void enkf_tui_table__(enkf_main_type * enkf_main , bool gen_kw_table , bo
|
||||
for (ikey = 0; ikey < num_keys; ikey++) {
|
||||
if (active[ikey]) {
|
||||
node_id_type node_id = {.report_step = step,
|
||||
.iens = iens ,
|
||||
.state = state };
|
||||
.iens = iens };
|
||||
if (enkf_node_user_get( nodes[ikey] , fs , index_keys[ikey] , node_id , &line[ikey]))
|
||||
line_count++;
|
||||
else
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_TABLE__
|
||||
#define __ENKF_TUI_TABLE__
|
||||
#ifndef ERT_ENKF_TUI_TABLE
|
||||
#define ERT_ENKF_TUI_TABLE
|
||||
|
||||
void enkf_tui_table_menu(void * );
|
||||
|
||||
|
||||
@@ -42,51 +42,6 @@
|
||||
|
||||
|
||||
|
||||
/**
|
||||
This functions displays the user with a prompt, and reads 'A' or
|
||||
'F' (lowercase OK), to check whether the user is interested in the
|
||||
forecast or the analyzed state.
|
||||
*/
|
||||
|
||||
|
||||
state_enum enkf_tui_util_scanf_state(const char * prompt, int prompt_len, bool accept_both) {
|
||||
char analyzed_string[64];
|
||||
bool OK;
|
||||
state_enum state;
|
||||
do {
|
||||
OK = true;
|
||||
util_printf_prompt(prompt , prompt_len , '=' , "=> ");
|
||||
//scanf("%s" , analyzed_string);
|
||||
fgets(analyzed_string, prompt_len, stdin);
|
||||
char *newline = strchr(analyzed_string,'\n');
|
||||
if(newline)
|
||||
*newline = 0;
|
||||
//getchar(); /* Discards trailing <RETURN> from standard input buffer? */
|
||||
if (strlen(analyzed_string) == 0){
|
||||
OK = true;
|
||||
state = UNDEFINED;
|
||||
}
|
||||
else if (strlen(analyzed_string) == 1) {
|
||||
char c = toupper(analyzed_string[0]);
|
||||
if (c == 'A')
|
||||
state = ANALYZED;
|
||||
else if (c == 'F')
|
||||
state = FORECAST;
|
||||
else {
|
||||
if (accept_both) {
|
||||
if (c == 'B')
|
||||
state = BOTH;
|
||||
else
|
||||
OK = false;
|
||||
} else
|
||||
OK = false;
|
||||
}
|
||||
} else
|
||||
OK = false;
|
||||
} while ( !OK );
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -325,38 +280,21 @@ int enkf_tui_util_scanf_ijk(const field_config_type * config, int prompt_len) {
|
||||
*/
|
||||
|
||||
|
||||
void enkf_tui_util_get_time(enkf_fs_type * fs , const enkf_config_node_type * config_node, enkf_node_type * node , state_enum analysis_state , int get_index , int step1 , int step2 , int iens , double * x , double * y ) {
|
||||
void enkf_tui_util_get_time(enkf_fs_type * fs , const enkf_config_node_type * config_node, enkf_node_type * node , int get_index , int step1 , int step2 , int iens , double * x , double * y ) {
|
||||
const char * key = enkf_config_node_get_key(config_node);
|
||||
int report_step;
|
||||
int index = 0;
|
||||
for (report_step = step1; report_step <= step2; report_step++) {
|
||||
|
||||
if (analysis_state & FORECAST) {
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens , .state = FORECAST };
|
||||
if (enkf_node_try_load(node , fs , node_id)) {
|
||||
const field_type * field = enkf_node_value_ptr( node );
|
||||
y[index] = field_iget_double(field , get_index);
|
||||
} else {
|
||||
fprintf(stderr," ** Warning field:%s is missing for member,report: %d,%d \n",key , iens , report_step);
|
||||
y[index] = -1;
|
||||
}
|
||||
x[index] = report_step;
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
if (analysis_state & ANALYZED) {
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens , .state = ANALYZED };
|
||||
if (enkf_node_try_load(node , fs , node_id)) {
|
||||
const field_type * field = enkf_node_value_ptr( node );
|
||||
y[index] = field_iget_double(field , get_index);
|
||||
} else {
|
||||
fprintf(stderr," ** Warning field:%s is missing for member,report: %d,%d \n",key , iens , report_step);
|
||||
y[index] = -1;
|
||||
}
|
||||
x[index] = report_step;
|
||||
index++;
|
||||
node_id_type node_id = {.report_step = report_step , .iens = iens };
|
||||
if (enkf_node_try_load(node , fs , node_id)) {
|
||||
const field_type * field = enkf_node_value_ptr( node );
|
||||
y[index] = field_iget_double(field , get_index);
|
||||
} else {
|
||||
fprintf(stderr," ** Warning field:%s is missing for member,report: %d,%d \n",key , iens , report_step);
|
||||
y[index] = -1;
|
||||
}
|
||||
x[index] = report_step;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_UTIL_H__
|
||||
#define __ENKF_TUI_UTIL_H__
|
||||
#ifndef ERT_ENKF_TUI_UTIL_H
|
||||
#define ERT_ENKF_TUI_UTIL_H
|
||||
|
||||
#include <ert/util/bool_vector.h>
|
||||
|
||||
@@ -29,12 +29,11 @@
|
||||
|
||||
void enkf_tui_util_scanf_report_steps(int , int , int * , int * );
|
||||
const enkf_config_node_type * enkf_tui_util_scanf_key(const ensemble_config_type * , int , ert_impl_type , enkf_var_type);
|
||||
state_enum enkf_tui_util_scanf_state(const char * , int , bool);
|
||||
int enkf_tui_util_scanf_ijk(const field_config_type * , int);
|
||||
void enkf_tui_util_scanf_ijk__(const field_config_type * , int , int * , int * , int *);
|
||||
bool * enkf_tui_util_scanf_alloc_report_active(int , int );
|
||||
bool * enkf_tui_util_scanf_alloc_iens_active(int , int , int * , int *);
|
||||
void enkf_tui_util_get_time(enkf_fs_type * , const enkf_config_node_type * , enkf_node_type * , state_enum , int , int , int , int , double * , double * );
|
||||
void enkf_tui_util_get_time(enkf_fs_type * , const enkf_config_node_type * , enkf_node_type * , int , int , int , int , double * , double * );
|
||||
void enkf_tui_util_scanf_iens_range(const char * , int , int , int * , int * );
|
||||
int enkf_tui_util_scanf_report_step(int , const char * , int );
|
||||
char * enkf_tui_util_scanf_report_step_as_char(int , const char * , int );
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ENKF_TUI_WORKFLOW_H__
|
||||
#define __ENKF_TUI_WORKFLOW_H__
|
||||
#ifndef ERT_ENKF_TUI_WORKFLOW_H
|
||||
#define ERT_ENKF_TUI_WORKFLOW_H
|
||||
|
||||
void enkf_tui_workflow_menu(void *);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
for more details.
|
||||
*/
|
||||
|
||||
#ifndef __ERT_TUI_CONST__
|
||||
#ifndef ERT_TUI_CONST
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user