Extracting depth to water table

50 views
Skip to first unread message

MABOSSANI AKARA

unread,
Jan 29, 2026, 5:31:38 PMJan 29
to ParFlow
Hello All,
I am using Parflow to simulate temporal changes in water table.
I am using an orthogonal grid with solids to define the active model domain.
domain.png
I was able to run the model, but I am having issues extracting the depth to water table. The saturation file shows that the position of the water table is correct. 
satur_output.png

But when I try extracting the depth to water using  "hydro.calculate_water_table_depth(pressure, saturation, dz)", the output does not look right.
DTW.png
I have attached the plotting ('plot_wt_og.py.txt') scripts and will appreciate any suggestions.



s8_testcase.pfidb
btm_elv.sa
top_elv.sa
s8_testcase.out.press.00118.pfb
plot_wt_og.py.txt
s8_testcase.out.satur.00118.pfb

Georgios Artavanis

unread,
Feb 20, 2026, 2:55:51 PM (7 days ago) Feb 20
to ParFlow
Hello,

Thanks for your message.

Can you please provide some more information about your run? I see in the pfidb file that the dimensions of your domain are NXxNYxNZ = 24x4x610. Are you trying to plot wtd across one of these dimensions? I think the problem might lie in the line

ax.plot(list(wtd[0, ...])[2],'b', lw=0.5, label='water table')

Can you share the shape of your wtd array and what you are trying to plot in this line? My guess is that the list is unnecessary and that it might cause some bug in the plot. Instead, I would use NumPy indexing for clarity.

In addition, the same can be said about this line:

ax.plot(list(z0-wtd[0, ...])[2],'b', lw=0.5)

I'm not sure what the correct formulation is here (whether you should subtract from your elevation or not), but the list might again introduce a bug. if you can share the intended behavior in the plot, we can do more debugging.

Best,
George

MABOSSANI AKARA

unread,
Feb 20, 2026, 5:52:01 PM (7 days ago) Feb 20
to ParFlow
Hello George,
Thanks for your response. As you correctly pointed out, my domain grid is 24x4x610.
The wtd array is  4x24 (NYxNX) and I am trying to plot the water table along the x-direction.
As suggested I used  "ax.plot(wtd[0,:],'b', lw=0.5, label='water table')" but the issue remains.
Below is the expected plot:
WTD2.png
I am not sure if the inactive cells above the land surface and below the bottom surface are contributing to my issue.

Thanks

Message has been deleted

Georgios Artavanis

unread,
Feb 24, 2026, 11:11:04 AM (4 days ago) Feb 24
to ParFlow
Hello,

Can you please share how you define your domain and how you constructed your solid file (pfsol)? It could be, as you said, that inactive cells are contributing to the issues. Also, could you simplify the plotting by plotting just the wtd from that step over the entire domain (as a 2D plot, for example with plt.imshow())?

We also noticed that DX, DY are significantly larger than DZ, and we would like to confirm that this is intended to be so for this domain.

Thanks,
George

MABOSSANI AKARA

unread,
Feb 24, 2026, 4:54:18 PM (3 days ago) Feb 24
to ParFlow
I used the 'pfpatchysolid' tool to prepare the solid files (see create_slds_otg.tcl).
I prepared one solid for the entire domain and 5 other solids files to assign hydraulic parameters.
The python script used to run Parflow is attached ("s8_pf_og2.py").
Below is a plot of the water table.
DTW2.png
I noticed that for most of the domain (in previous figure), the "parflow.tools.hydrology.calculate_water_table_depth" function returns NaN (4 by 24 array).
DTW2_array.png
I thought a fine discretization is required to better map Parflow solids onto the computational grid; this is the reason for the small dZ.
Please let me know if my understanding of how solids are mapped onto the computational grid is accurate.

Thanks.

s8_pf_og2.py
lay4.pfsol
domain.pfsol
s8_testcase.out.press.00099.pfb
lay5.pfsol
lay6.pfsol
lay2.pfsol
lay3.pfsol
create_slds_otg.tcl
Reply all
Reply to author
Forward
0 new messages