Input rewrite - #354
Open
maartenvanormondt wants to merge 9 commits into
Open
Conversation
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>
There was a problem hiding this comment.
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 insfincs_input.f90with a genericget_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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rewrite of sfincs_input.f90