Skip to content

280-timestep-analysis-output#280

Merged
Leynse merged 44 commits intomainfrom
267-timestep-analysis-output
Mar 19, 2026
Merged

280-timestep-analysis-output#280
Leynse merged 44 commits intomainfrom
267-timestep-analysis-output

Conversation

@vanasseltk
Copy link
Copy Markdown
Collaborator

No description provided.

@keesnederhoff keesnederhoff changed the title Initial commit 267-timestep-analysis-output Mar 12, 2026
@keesnederhoff keesnederhoff changed the title 267-timestep-analysis-output 280-timestep-analysis-output Mar 12, 2026
@keesnederhoff keesnederhoff marked this pull request as ready for review March 12, 2026 16:09
Leynse and others added 20 commits March 13, 2026 08:55
- determination required timestep should be based over the flux uv point instead of cell centre nm
- renaming variables
- doing calculation of average required timestep per cell in finalize
- naming to _analysis consistently
- make a initialize_timestep_analysis subroutine
- keep compute_cell_min_timestep simple in sfincs_momentum instead
- fix openacc data management
Todo still:
- clear log message of most limiting cell
- netcdf output working based on combined uv point output to nm cell
…ge_limiting_timestep'

- Note that percentage limiting timestep might not be visible when plotting as continuous/patches, if simulation is always limitied by 1 flux link (2 cells)
- Also double check still indices for quadtree model output
Copy link
Copy Markdown
Collaborator

@Leynse Leynse left a comment

Choose a reason for hiding this comment

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

Great work!

  • THough a number of things needed to be changed - minimum required timestep should be determined over flux links, not grid cells
  • See also proposed changes to variable names, output limiting as percentage, add message in sfincs.log file etc.
  • Tested for a regular and quadtree model
  • Compiles for windows and Docker CPU (GPU ongoing)

@keesnederhoff - Can you check whether you agree?
@maartenvanormondt - CAn you check the 4 flux link indexing in _ncoutput.f90, and whether (ndm>0) statements etc are needed?

Comment thread source/src/sfincs_lib.f90 Outdated
Comment thread source/src/sfincs_openacc.f90 Outdated
Comment thread source/src/sfincs_timestep_diag.f90 Outdated
Comment thread source/src/sfincs_timestep_diag.f90 Outdated
Comment thread source/src/sfincs_timestep_diag.f90 Outdated
Comment thread source/src/sfincs_timestep_diag.f90 Outdated
Comment thread source/src/sfincs_timestep_diag.f90 Outdated
Comment thread source/src/sfincs_ncoutput.F90 Outdated
@maartenvanormondt
Copy link
Copy Markdown
Contributor

Gents, nice work! I indeed had to add a bunch of neighbor checks for quadtree but I think it is now working as expected (not yet tested for regular grids, but I do not expect issues). I also moved some of the routines around. The heavy lifting to determine required time steps per cell and percentage limiting per cell (these had been determined at uv points, but in the output we want them per cell) is now done in timestep_analysis_finalize (it thought that was a bit neater than doing it in sfincs_ncoutput.nc). The writing to the log file is now done in timestep_analysis_write_log. Can you guys test?

@keesnederhoff
Copy link
Copy Markdown
Contributor

Thanks both for your detailed review and improvements. The code is easy to understand, looks elegant, and also worked great on the examples I had around. I did update the documentation to ensure this matches the implementation in the source code. I think it is ready to be merged!

Copy link
Copy Markdown
Collaborator

@Leynse Leynse left a comment

Choose a reason for hiding this comment

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

  • Great addition, now finally working correctly for GPU as well. Time to merge!

@Leynse Leynse merged commit cae9d81 into main Mar 19, 2026
@Leynse Leynse deleted the 267-timestep-analysis-output branch March 19, 2026 13:58
Leynse added a commit that referenced this pull request Mar 20, 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.

4 participants