Skip to content

Input rewrite - #354

Open
maartenvanormondt wants to merge 9 commits into
mainfrom
input_rewrite
Open

Input rewrite#354
maartenvanormondt wants to merge 9 commits into
mainfrom
input_rewrite

Conversation

@maartenvanormondt

@maartenvanormondt maartenvanormondt commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

rewrite of sfincs_input.f90

maartenvanormondt and others added 3 commits July 13, 2026 15:44
Extracted from the urban_drainage branch: the sfincs_input.f90 rework
only. One get_keyword interface per type (real/int/logical/char) with
optional legacy-alias lists that emit a one-line deprecation warning
(e.g. wavemaker_signal with legacy wmsignal, infiltrationfile with
legacy infiltration_file). Keywords read directly into the sfincs_data
logicals; the legacy integer switches are derived from them until
sfincs_ncoutput stops writing them as attributes.

Urban-drainage keywords (urbfile, dkbfile, store_river_discharge,
store_urban_drainage_discharge, store_cumulative_urban_drainage) are
not part of this branch; they live on the qsrc branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The get_keyword rewrite renamed these to infiltrationfile /
infiltrationtype but did not list the old spellings as legacy aliases,
so existing models would silently lose infiltration input.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR rewrites the SFINCS main input reader (sfincs.inp) by replacing the legacy read_*_input calls with a centralized keyword parser (get_keyword*) that supports deprecated aliases and post-read normalization of derived flags. It also includes a Windows build configuration change for the bundled netcdf-fortran project.

Changes:

  • Replaced the legacy read_*_input-style parsing in sfincs_input.f90 with a generic get_keyword(...) interface, plus helper routines (find_value, read_line, notabs, alias warnings).
  • Added alias/deprecation handling and reorganized input post-processing (e.g., CRS/Coriolis, output flags, wavemaker, bathtub mode).
  • Updated the netcdf-fortran Visual Studio project to use a newer PlatformToolset.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.

File Description
source/src/sfincs_input.f90 Large refactor of sfincs.inp parsing into a generic keyword parser with alias warnings and consolidated post-processing.
source/third_party_open/netcdf/netcdf-fortran-4.6.1/netcdff_c.vcxproj Updated MSBuild PlatformToolset from v143 to v145.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/src/sfincs_input.f90 Outdated
Comment thread source/src/sfincs_input.f90
Comment thread source/src/sfincs_input.f90 Outdated
Comment thread source/src/sfincs_input.f90 Outdated
Comment thread source/src/sfincs_input.f90 Outdated
Comment thread source/src/sfincs_input.f90
Comment thread source/src/sfincs_input.f90
Comment thread source/src/sfincs_input.f90 Outdated
maartenvanormondt and others added 6 commits July 13, 2026 21:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Refactor input keyword handling by moving the generic `get_keyword` interface and its helper routines (`find_value`, `read_line`, `notabs`, legacy warning, logical parsing, and real-array reader) from `sfincs_input` into `sfincs_read`. `sfincs_input` now imports and uses `sfincs_read` for keyword parsing, reducing duplication and centralizing input-reading behavior for shared callers. Also update the `check_file_exists` call site to capture its return value.
@maartenvanormondt
maartenvanormondt requested a review from Leynse July 13, 2026 19:59
@Leynse Leynse added this to the v2.4.1 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants