Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
beb9f1a
- Initial commit, working on make a generic read_netcdf_quadtree_gene…
Leynse Feb 4, 2026
68e1493
- Working version for storage volume nc with fixed mapping to SFINCS …
Leynse Feb 4, 2026
245c1a1
- Add error when wanted variable was not found in file and directly stop
Leynse Feb 4, 2026
d3db40e
- Add netinfiltrationfile, netinftype variables
Leynse Feb 4, 2026
4353274
- Implement netcdf reader option for all infiltration options
Leynse Feb 4, 2026
378e27e
- Add stop_sfincs check on combination check of infiltration input ty…
Leynse Feb 4, 2026
a2f67b4
- Constant uniform infiltration is allowed for both grid types
Leynse Feb 4, 2026
c654c00
- Edit check - still possible that precip is forced but qinf=0
Leynse Feb 4, 2026
36a5aa8
- Change names to infiltrationfile and infiltrationtype
Leynse Feb 12, 2026
30a0cb6
- Move whole subroutine 'initialize_infiltration' from sfincs_domain.…
Leynse Feb 12, 2026
0dc0720
- Add check whether specified infiltrationtype is correct
Leynse Feb 12, 2026
2a1a974
- Added version for reading in netcdf quadtree manningfile (#271)
Leynse Mar 6, 2026
29a145c
Merge branch '268-make-generic-quadtree-nc-input-reader' of https://g…
Leynse Mar 6, 2026
167387b
- Bump date
Leynse Mar 6, 2026
a0ed4a0
Progress with redoing continuity logic, adding new infiltration flavo…
keesnederhoff Mar 18, 2026
cf6a78d
Included more output options
keesnederhoff Mar 20, 2026
3300914
- clean repo
Leynse Mar 24, 2026
fe8cf95
Merge branch 'redo_infiltration' of https://github.com/Deltares/SFINC…
Leynse Mar 24, 2026
bb61661
submit progress
keesnederhoff Mar 26, 2026
8c91945
Merge branch 'redo_infiltration' of https://github.com/Deltares/SFINC…
keesnederhoff Mar 26, 2026
f1c425b
included loss function in bucket model
keesnederhoff Mar 31, 2026
2a07fe8
ongoing progress
keesnederhoff Apr 15, 2026
a5a25df
Merge branch 'main' into redo_infiltration
maartenvanormondt Apr 15, 2026
462dfd1
Merge branch 'redo_infiltration' of https://github.com/Deltares/SFINC…
maartenvanormondt Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ source/third_party_open/netcdf/x64
source/sfincs/sfincs.opt.yaml
/source/sfincs_lib/*.yaml
/source/third_party_open/netcdf/netcdf-fortran-4.6.1/Debug
/source/build_nvfortran_gpu_h7.sh
/source/build_nvfortran_gpu.sh
/source/Singularityfile-gpu.def
/source/Dockerfile.xpu
/source/Dockerfile.gpu.update01
/source/Dockerfile.gpu.test
/source/Dockerfile.gpu.25.5.ccall
/source/Dockerfile.gpu
66 changes: 60 additions & 6 deletions docs/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,37 @@ SFINCS allows the specification of the following options for accounting for infi
3. The Curve Number method: empirical rainfall-runoff model
4. The Green-Ampt method: empirical rainfall-runoff model
5. The Horton infiltration method
6. The bucket model: linear reservoir with losses

Infiltration is specified with either constant in time values in mm/hr (both uniform and spatially varying), or using more detailed parameters for the Curve Number method, The Green-Ampt method or Horton method.
Spatially uniform infiltration is still specified directly in sfincs.inp with ``qinf``. All modern spatially varying infiltration and bucket-model input should be provided through ``infiltrationfile`` together with ``infiltrationtype``. The older binary keywords (``qinffile``, ``scsfile``, ``smaxfile``, ``sefffile``, ``ksfile``, ``psifile``, ``sigmafile``, ``f0file``, ``fcfile`` and ``kdfile``) remain available for backward compatibility only and should be removed in a future cleanup.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important clarification - netcdf infiltration ONLY works for quadtree models, while the old binary options ONLY work for regular models. So it is not just backward compatibility here


**NOTE - Infiltration in SFINCS is only turned on when any rainfall is forced**

**NOTE - Infiltration methods in SFINCS are not designed to be stacked**


NetCDF infiltration input (recommended):
%%%%%

For all spatially varying infiltration methods the recommended interface is:

.. code-block:: text

infiltrationfile = sfincs.infiltration.nc
infiltrationtype = c2d | cna | cnb | gai | hor | bkt

The required variables in ``infiltrationfile`` depend on ``infiltrationtype``:

* ``c2d``: ``qinf``
* ``cna``: ``scs``
* ``cnb``: ``smax``, ``seff``, ``ks``
* ``gai``: ``psi``, ``sigma``, ``ks``
* ``hor``: ``f0``, ``fc``, ``kd``
* ``bkt``: ``bucket_smax``, ``bucket_k``, ``bucket_loss``

The older separate binary infiltration keywords are still supported for backward compatibility only. The former separate inputs ``bucketfile`` and ``bucket_loss_frac`` have been removed; for the bucket model, all required variables must now be present in ``infiltrationfile``.


Spatially uniform constant in time:
%%%%%

Expand All @@ -383,7 +406,7 @@ Specify the keyword:
Spatially varying constant in time:
%%%%%

For spatially varying infiltration values per cell use the qinffile option, with the same grid based input as the depfile using a binary file.
For spatially varying infiltration values per cell use ``infiltrationfile`` with ``infiltrationtype = c2d``. The ``qinffile`` option below is kept for backward compatibility only and should be removed in a future cleanup.

**qinffile = sfincs.qinf**

Expand Down Expand Up @@ -426,7 +449,7 @@ where Smax = the soil's maximum moisture storage capacity. Smax typically derive

**Without recovery**

For spatially varying infiltration values per cell using the Curve Number method without recovery use the scsfile option, with the same grid based input as the depfile using a binary file. Note here that in pre-processing the wanted CN values should be converted to S values following:
For spatially varying infiltration values per cell using the Curve Number method without recovery use ``infiltrationfile`` with ``infiltrationtype = cna``. The ``scsfile`` option below is kept for backward compatibility only and should be removed in a future cleanup. Note here that in pre-processing the wanted CN values should be converted to S values following:
* scsfile: maximum soil moisture storage capacity in inches

.. code-block:: text
Expand Down Expand Up @@ -458,7 +481,7 @@ This option doesn't support restart functionality.

**With recovery**

Within SFINCS, the Curve number method with recovery can be used as follows. The user needs to provide the following variables. For all variables, one needs to specify these values per cell with the same grid based input as the depfile using a binary file:
Within SFINCS, the Curve number method with recovery is preferably supplied through ``infiltrationfile`` with ``infiltrationtype = cnb``. The separate binary files listed below are kept for backward compatibility only. For all variables, one needs to specify these values per cell with the same grid based input as the depfile using a binary file:

* smaxfile: maximum soil moisture storage capacity in m
* sefffile: soil moisture storage capacity at the start in m
Expand Down Expand Up @@ -498,7 +521,7 @@ The basic form of the Green-Ampt equation is expressed as follows:

In which t is time, K is the saturated hydraulic conductivity, delta_theta is defined as the soil capacity (the difference between the saturated and initial moisture content) and sigma is the soil suction head.

Within SFINCS, the Green-Ampt method can be used as follows. The user needs to provide the following variables. For a range of typical values see Table 1. For all variables, one needs to specify these values per cell with the same grid based input as the depfile using a binary file:
Within SFINCS, the Green-Ampt method is preferably supplied through ``infiltrationfile`` with ``infiltrationtype = gai``. The separate binary files listed below are kept for backward compatibility only. For a range of typically values see Table 1. For all variables, one needs to specify these values per cell with the same grid based input as the depfile using a binary file:

* ksfile: saturated hydraulic conductivity in mm/hr
* sigmafile: soil moisture deficit in [-]
Expand All @@ -522,7 +545,7 @@ The basic form of the Horton equation is expressed as follows:

In which f_t is the infiltration rate at time, f_c is the final, constant infiltration rate, f_0 is the initial infiltration rate, k is a decay constant and t is the time since the start of infiltration.

Within SFINCS, the Horton method can be used as follows. The user needs to provide the following variables. For all variables, one needs to specify these values per cell with the same grid based input as the depfile using a binary file:
Within SFINCS, the Horton method is preferably supplied through ``infiltrationfile`` with ``infiltrationtype = hor``. The separate binary files listed below are kept for backward compatibility only. For all variables, one needs to specify these values per cell with the same grid based input as the depfile using a binary file:

* f0file: maximum (Initial) Infiltration Capacity in mm/hr
* fcfile: Minimum (Asymptotic) Infiltration Rate in mm/hr
Expand All @@ -533,6 +556,37 @@ The recovery of the infiltration rate during dry weather (kr) is calculated as f
This option also supports restart functionality.


The bucket model:
%%%%%

The bucket model is a linear-reservoir representation of infiltration and losses. It is configured with:

.. code-block:: text

infiltrationfile = sfincs.infiltration.nc
infiltrationtype = bkt

The ``infiltrationfile`` must contain the following variables:

* ``bucket_smax``: maximum bucket storage in mm
* ``bucket_k``: drainage coefficient in 1/hr
* ``bucket_loss``: loss fraction in the range 0-1

The former separate inputs ``bucketfile`` and ``bucket_loss_frac`` are no longer supported.


Drainage mimic:
%%%%%

Drainage mimic is configured separately from infiltration and now only supports ``drainagefile``:

.. code-block:: text

drainagefile = sfincs.drainage

This file may be a binary map or a NetCDF file containing ``drainage_rate`` in mm/hr. The former uniform ``qdrain`` keyword has been removed.


Storage volume
^^^^^

Expand Down
40 changes: 27 additions & 13 deletions docs/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -475,54 +475,68 @@ Domain
:units: s/m^(1/3)
:required: no in case of regular mode, ignored in case of subgrid mode
:format: bin
infiltrationfile = sfincs.infiltration.nc
:description: Recommended NetCDF input for spatially varying infiltration and bucket-model losses. Use together with infiltrationtype.
:units: depends on selected infiltrationtype and variables in the NetCDF file
:required: no
:format: net
infiltrationtype = c2d | cna | cnb | gai | hor | bkt
:description: Selects which infiltration method is read from infiltrationfile. Bucket mode requires bucket_smax, bucket_k and bucket_loss in infiltrationfile.
:units: -
:required: Only when infiltrationfile is used
:format: asc
drainagefile = sfincs.drainage
:description: Spatially varying drainage mimic input in mm/hr. Can be a binary map or a NetCDF file with variable drainage_rate. This replaces the removed qdrain keyword.
:units: mm/hr
:required: no
:format: bin or net
qinffile = sfincs.qinf
:description: For spatially varying constant in time infiltration values per cell use the qinffile option, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For spatially varying constant in time infiltration values per cell prefer infiltrationfile with infiltrationtype = c2d.
:units: mm/hr
:required: no
:format: bin
scsfile = sfincs.scs
:description: For spatially varying infiltration values per cell using the Curve Number method A (without recovery) use the scsfile option, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For Curve Number method A (without recovery) prefer infiltrationfile with infiltrationtype = cna.
:units: -
:required: no
:format: bin
smaxfile = sfincs.smax
:description: For spatially varying infiltration values per cell using the Curve Number method B (with recovery) provide the smaxfile (as well as the sefffile and ksfile) as maximum soil moisture storage capacity in m, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For Curve Number method B (with recovery) prefer infiltrationfile with infiltrationtype = cnb. The smaxfile contains the maximum soil moisture storage capacity in m.
:units: m
:required: no
:format: bin
sefffile = sfincs.seff
:description: For spatially varying infiltration values per cell using the Curve Number method B (with recovery) provide the sefffile (as well as the smaxfile and ksfile) as soil moisture storage capacity at the start in m, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For Curve Number method B (with recovery) prefer infiltrationfile with infiltrationtype = cnb. The sefffile contains soil moisture storage capacity at the start in m.
:units: m
:required: no
:format: bin
ksfile = sfincs.ks
:description: For spatially varying infiltration values per cell using the Curve Number method B (with recovery) provide the ksfile (as well as the smaxfile and sefffile) as saturated hydraulic conductivity in mm/hr, with the same grid based input as the depfile using a binary file.
:description: For spatially varying infiltration values per cell using the Green & Ampt method (with recovery) provide the ksfile (as well as the sigmafile and psifile) as saturated hydraulic conductivity in mm/hr, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For Curve Number method B (with recovery) and Green & Ampt infiltration prefer infiltrationfile with infiltrationtype = cnb or gai. The ksfile contains saturated hydraulic conductivity in mm/hr.
:units: mm/hr
:required: no
:format: bin
sigmafile = sfincs.sigma
:description: For spatially varying infiltration values per cell using the Green & Ampt method (with recovery) provide the sigmafile (as well as the psifile and ksfile) as suction head at the wetting front in mm, with the same grid based input as the depfile using a binary file.
:units: mm
:description: Backward compatibility only. For Green & Ampt infiltration prefer infiltrationfile with infiltrationtype = gai. The sigmafile contains soil moisture deficit in [-].
:units: -
:required: no
:format: bin
psifile = sfincs.psi
:description: For spatially varying infiltration values per cell using the Green & Ampt method (with recovery) provide the psifile (as well as the sigmafile and ksfile) as soil moisture deficit in [-], with the same grid based input as the depfile using a binary file.
:units: -
:description: Backward compatibility only. For Green & Ampt infiltration prefer infiltrationfile with infiltrationtype = gai. The psifile contains suction head at the wetting front in mm.
:units: mm
:required: no
:format: bin
f0file = sfincs.f0
:description: For spatially varying infiltration values per cell using the Horton method (with recovery) provide the f0file (as well as the fcfile and kdfile) as maximum (Initial) Infiltration Capacity in mm/hr, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For Horton infiltration prefer infiltrationfile with infiltrationtype = hor. The f0file contains maximum (initial) infiltration capacity in mm/hr.
:units: mm/hr
:required: no
:format: bin
fcfile = sfincs.fc
:description: For spatially varying infiltration values per cell using the Horton method (with recovery) provide the fcfile (as well as the f0file and kdfile) as Minimum (Asymptotic) Infiltration Rate in mm/hr, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For Horton infiltration prefer infiltrationfile with infiltrationtype = hor. The fcfile contains the minimum (asymptotic) infiltration rate in mm/hr.
:units: mm/hr
:required: no
:format: bin
kdfile = sfincs.kd
:description: For spatially varying infiltration values per cell using the Horton method (with recovery) provide the kdfile (as well as the f0file and fcfile) as empirical constant (hr-1) of decay, with the same grid based input as the depfile using a binary file.
:description: Backward compatibility only. For Horton infiltration prefer infiltrationfile with infiltrationtype = hor. The kdfile contains the empirical decay constant in hr-1.
:units: hr-1
:required: no
:format: bin
Expand Down
40 changes: 40 additions & 0 deletions source/sfincs/sfincs.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

------------ Welcome to SFINCS ------------

@@@@@ @@@@@@@ @@ @@ @@ @@@@ @@@@@
@@@ @@@ @@@@@@@ @@ @@@ @@ @@@@@@@ @@@ @@@
@@@ @@ @@ @@@ @@ @@ @@ @@@
@@@@@ @@@@@@ @@ @@@@@@ @@ @@@@@
@@@ @@ @@ @@ @@@ @@ @@ @@@
@@@ @@@ @@ @@ @@ @@ @@@@@@ @@@ @@@
@@@@@ @@ @@ @@ @ @@@@ @@@@@

..............
......:@@@@@@@@:......
..::::..@@........@@.:::::..
..:::::..@@..::..::..@@.::::::..
.::::::..@@............@@.:::::::.
.::::::..@@..............@@.:::::::.
.::::::::..@@............@@..::::::::.
.:::::::::...@@.@..@@..@.@@..::::::::::.
.:::::::::...:@@@..@@..@@@:..:::::::::..
............@@.@@..@@..@@.@@............
^^^~~^^~~^^@@..............@@^^^~^^^~~^^
.::::::::::@@..............@@.:::::::::.
.......:.@@.....@.....@....@@.:.......
.::....@@......@.@@@.@....@@.....::.
.:::~@@.:...:.@@...@@.:.:.@@~::::.
.::~@@@@@@@@@@.....@@@@@@@@@~::.
..:~~~~~~~:.......:~~~~~~~:..
......................
..............

------------------------------------------

Build-Revision: $Rev: v2.3.1 mt. Faber+branch-redo-infiltration
Build-Date: $Date: 2026-03-19

------ Preparing model simulation --------

Reading input file ...
Error : SFINCS input file "sfincs.inp" not found! SFINCS has stopped!
8 changes: 8 additions & 0 deletions source/sfincs/sfincs.vfproj.keesn.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioUserFile ProjectCreator="Intel Fortran" Keyword="Console Application" Version="11.0" ProjectIdGuid="{84DFC66B-C675-4F50-8A9A-62E7E483ACDD}">
<Configurations>
<Configuration Name="Debug|x64" WorkingDirectory="d:\software\SFINCS\test_model\infiltration_testbed\05_bucket\local\">
</Configuration>
<Configuration Name="Release|x64" WorkingDirectory="d:\software\SFINCS\test_model\infiltration_testbed\05_bucket\local\">
</Configuration>
</Configurations></VisualStudioUserFile>
8 changes: 8 additions & 0 deletions source/sfincs_lib/sfincs_lib.vfproj.keesn.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioUserFile ProjectType="typeStaticLibrary" ProjectCreator="Intel Fortran" Keyword="Static Library" Version="11.0" ProjectIdGuid="{53E1EF5D-DBAE-46DC-B269-8CA4B8EF9883}">
<Configurations>
<Configuration Name="Debug|x64" WorkingDirectory="d:\software\SFINCS\test_model\infiltration_testbed\05_bucket\local\">
</Configuration>
<Configuration Name="Release|x64" WorkingDirectory="d:\software\SFINCS\test_model\infiltration_testbed\05_bucket\local\">
</Configuration>
</Configurations></VisualStudioUserFile>
Loading