The command line
petroscript (or python -m petroscript) has four commands. Each is one of the Python doors, so a
command does what the same lines of Python do:
| Command | The Python it runs | Prints |
|---|---|---|
petroscript load DECK FOLDER | ps.load(DECK).to_python(FOLDER) | the script’s path, FOLDER/<NAME>.py |
petroscript compile SOURCE FOLDER | ps.compile(model).write(FOLDER) | each file’s sha256 and path, as sha256sum does |
petroscript check SOURCE | ps.compile(model).check() | the rows, each once |
petroscript run [--no-preflight] SOURCE [FOLDER] | ps.compile(model).run(folder=FOLDER); preflight=False with the flag | the run’s folder, last |
A SOURCE is a deck, which ps.load reads, or a Python script that binds model to a ps.Model.
The script load writes binds it; a script of your own ends with a line such as model = merle.
run runs deck.check() first: what Flow refuses in its pre-flight (a dry run of the deck and
one short step) is refused before the run, in Flow’s own words, and the command exits 1;
run --no-preflight skips the pre-flight. Then it runs the simulator ps.simulators() lists
first (PETROSCRIPT_FLOW, then OPM Flow on PATH) in FOLDER, or in ./<model name>/ when FOLDER
is left out. Read the run in Python with ps.results.open(folder).
Exit codes: 0 done; 1 a refusal, printed with its fix line, or an error row from check; 2 a
usage error.
$ cd /work$ petroscript load CASE.DATA casecase/CASE.py$ petroscript check case/CASE.py[preflight.passed] checked by flow 2026.04 at /usr/bin/flow: a dry run of the whole deck (NOSIM) and initialisation with one 0.01-day step, in 2.6 s$ petroscript run case/CASE.py runsopm-flow: running CASE.DATA/work/runsPetroScript is licensed under the Apache License 2.0. © 2026 Blauweiss EDV LLC. PetroScript by Blauweiss AI.For AI agents: llms.txt