diff --git a/src/expreccs/core/expreccs.py b/src/expreccs/core/expreccs.py index d6b8520..e2fff24 100644 --- a/src/expreccs/core/expreccs.py +++ b/src/expreccs/core/expreccs.py @@ -39,12 +39,6 @@ def expreccs(): plot_results(dic) return - # Process the input file (open expreccs.utils.inputvalues to see the abbreviations meaning) - dic = process_input(dic, file) - - # Make the output folders - write_folders(dic) - # For regional and site given decks, then we create a new deck with the proyected pressures if dic["expreccs"]: dic["reg"] = dic["expreccs"].split(",")[0] @@ -52,6 +46,12 @@ def expreccs(): create_deck(dic) return + # Process the input file (open expreccs.utils.inputvalues to see the abbreviations meaning) + dic = process_input(dic, file) + + # Make the output folders + write_folders(dic) + # Get the location of wells and faults in the reservoirs dic = mapping_properties(dic) write_properties(dic) diff --git a/src/expreccs/utils/reg_sit_given_decks.py b/src/expreccs/utils/reg_sit_given_decks.py index 820a235..0802607 100644 --- a/src/expreccs/utils/reg_sit_given_decks.py +++ b/src/expreccs/utils/reg_sit_given_decks.py @@ -18,6 +18,10 @@ def create_deck(dic): """Create a deck from given reg and site decks with projected pressures""" + if not os.path.exists(f"{dic['exe']}/{dic['fol']}"): + os.system(f"mkdir {dic['exe']}/{dic['fol']}") + if not os.path.exists(f"{dic['exe']}/{dic['fol']}/bc"): + os.system(f"mkdir {dic['exe']}/{dic['fol']}/bc") case = f"{dic['exe']}/{dic['reg']}/{dic['reg'].upper()}" rst = case + ".UNRST" grid = case + ".EGRID" @@ -372,7 +376,7 @@ def write_files(dic): lol.append("'BCCON.INC' /") count = 1 with open( - f"{dic['exe']}/{dic['fol']}/EXPRECCS.DATA", + f"{dic['exe']}/{dic['fol']}/{dic['fol'].upper()}.DATA", "w", encoding="utf8", ) as file: diff --git a/src/expreccs/utils/writefile.py b/src/expreccs/utils/writefile.py index 3733885..f828726 100644 --- a/src/expreccs/utils/writefile.py +++ b/src/expreccs/utils/writefile.py @@ -206,8 +206,6 @@ def write_folders(dic): if not os.path.exists(f"{dic['exe']}/{dic['fol']}"): os.system(f"mkdir {dic['exe']}/{dic['fol']}") if dic["expreccs"]: - if not os.path.exists(f"{dic['exe']}/{dic['fol']}/bc"): - os.system(f"mkdir {dic['exe']}/{dic['fol']}/bc") return for fil in ["preprocessing", "jobs", "output", "postprocessing"]: if not os.path.exists(f"{dic['exe']}/{dic['fol']}/{fil}"): diff --git a/tests/test_main.py b/tests/test_main.py index 1634a8e..1dfe8d1 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -35,9 +35,8 @@ def test(): assert os.path.exists("./rotate/postprocessing/rotate_site_closed_pressure.png") os.system("scp -r ./rotate/preprocessing/regional/. ./rotate/output/regional") os.system("scp -r ./rotate/preprocessing/site_closed/. ./rotate/output/site_closed") - os.system("scp rotate.txt ./rotate/output") os.chdir(f"{cwd}/tests/configs/rotate/output") - os.system("expreccs -i rotate.txt -o expreccs -e regional,site_closed") + os.system("expreccs -o expreccs -e regional,site_closed") assert os.path.exists("./expreccs/BCCON.INC") os.chdir(f"{cwd}/tests/configs/rotate/output/expreccs") os.system("flow EXPRECCS.DATA --enable-tuning=true --linear-solver=cprw")