Pflotran python package

29 views
Skip to first unread message

Salomon

unread,
Jul 24, 2026, 10:12:06 AM (10 days ago) Jul 24
to pflotran-users
Dear Pflotran users,

I would like to know whether any Python libraries wrapping Pflotran have been developed.
So what we could run Pflotran and access to the output directly within Python (something like pflotran.run(script) and out = pflotran.output() )
I have found pypflotran, but it does not seem to be up-to-date any more.

Best regards,
Salomon



Shengbang Zhong

unread,
Jul 24, 2026, 10:23:27 AM (10 days ago) Jul 24
to pflotra...@googlegroups.com
Hello Salomon,

Yes, the original pyflotran is not available any more. I have written my own python code to run pflotran and postprocess output data. I think you can search for how to achieve them.

Best regards,
Shengbang

--
You received this message because you are subscribed to the Google Groups "pflotran-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pflotran-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pflotran-users/829de268-4bff-403b-8ab1-77e0851d823fn%40googlegroups.com.

Hammond, Glenn E

unread,
Jul 24, 2026, 10:36:01 AM (10 days ago) Jul 24
to pflotra...@googlegroups.com
Salomon,

Are you interested in wrapper commands to launch PFLOTRAN, tools for generating input decks, or both?

For my current projects, I rely almost exclusively on Python scripting to generate input decks, utilizing LLMs to streamline the process. Aside from prototyping conceptual models, manual scripting is becoming a thing of the past. I recommend creating a template input deck and using an LLM to develop your workflow and execute runs efficiently.

Glenn
From: pflotra...@googlegroups.com <pflotra...@googlegroups.com> on behalf of Shengbang Zhong <hgm...@gmail.com>
Date: Friday, July 24, 2026 at 7:23 AM
To: pflotra...@googlegroups.com <pflotra...@googlegroups.com>
Subject: Re: [pflotran-users: 8825] Pflotran python package

You don't often get email from hgm...@gmail.com. Learn why this is important
Check twice before you click! This email originated from outside PNNL.

Salomon

unread,
Jul 24, 2026, 12:23:29 PM (9 days ago) Jul 24
to pflotran-users
Hello Shengbang Zhong  and Glenn , 

Thank you for your answers.

Indeed, generating input desks, launching pflotran, pre/post processing pflotran (etc..)  is not complicated.

To be more specific, I would like to retrieve the pflotran OUTPUT via RAM, rather than reading (in Python) the output file generated by pflotran.
I currently couple pflotran with other speciation codes (PhreeqC, ...) and the coupling performance would particularly benefit from a RAM-access to the output files.
My demand is more a matter of performance than anything, as reading input file takes much longer than from RAM ...

Currently, i do not have the time to develop a pflotran python package that could do such things, but maybe in the future as it may be of interest to other members of the pflotran community ?

Salomon

Hammond, Glenn E

unread,
Jul 24, 2026, 12:48:32 PM (9 days ago) Jul 24
to pflotra...@googlegroups.com
Given recent advancements in AI, it no longer makes sense for anyone to manually write a Python package for PFLOTRAN or anything else. AI will handle that task.

To access PFLOTRAN data in-memory, I recommend writing code that replicates the steps in pflotran.F90. However, instead of calling simulation%ExecuteRun(), you should call the relevant routines in simulation_subsurface.F90 to advance the simulation to specific points in time of your choosing. For example: 
This approach allows you to access all underlying data directly through the simulation object. RealizationGetVariable() will be very helpful.

Glenn
From: pflotra...@googlegroups.com <pflotra...@googlegroups.com> on behalf of Salomon <salomo...@gmail.com>
Date: Friday, July 24, 2026 at 9:24 AM
To: pflotran-users <pflotra...@googlegroups.com>
Subject: Re: [pflotran-users: 8828] Pflotran python package

You don't often get email from salomo...@gmail.com. Learn why this is important
Reply all
Reply to author
Forward
0 new messages