Skip to content

Conversation

@jreyns
Copy link
Contributor

@jreyns jreyns commented Nov 20, 2025

What was done

Add various functionality for storm impact modeling to main

Evidence of the work done

  • Video/figures
    <add video/figures if applicable>
  • [x ] Clear from the issue description
  • Not applicable

Tests

  • Tests updated
    <add testcase numbers if applicable, Issue number>
  • Not applicable

Documentation

  • Documentation updated
    to do: UNST-9452
  • Not applicable

Issue link

@jreyns jreyns requested a review from hrajagers November 20, 2025 18:57
@hrajagers hrajagers requested a review from Copilot November 20, 2025 20:09
Copy link
Contributor

Copilot AI left a comment

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 adds functionality for storm impact modeling to the main branch, incorporating changes related to sediment transport, wave modeling, dynamic vegetation roughness, and various code quality improvements. The changes span morphology kernels, wave computation modules, sediment transport algorithms, and flow initialization routines.

Key Changes

  • Added new alfad50 parameter for Van Rijn transport formulas (forms 19 and 20) to adjust transport based on grain size
  • Implemented dynamic vegetation roughness functionality that adjusts friction based on erosion/sedimentation
  • Enhanced wave-current interaction calculations and streaming layer physics
  • Multiple consistency improvements and bug fixes across sediment transport and wave modules

Reviewed Changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
trab20.f90 Added alfad50 parameter for grain size-dependent transport scaling
trab19.f90 Added alfad50 parameter and facua conditional logic
calseddf1993.f90 Corrected comment attribution from Van Rijn to Coleman
bedtr2004.f90 Added layer boundary check for aks calculation
bedbc2004.f90 Completed comment for orbital velocity magnitude
rdtrafrm.f90 Updated default parameters and added alfad50 for transport forms 19 and 20
swancom1.F Added breaker fraction initialization and condition check
fm_external_forcings_init.f90 Fixed format specifiers in error messages
setbobs.f90 Reordered variable initialization for 1D links
flow_sedmorinit.f90 Added dynamic vegetation support and removed wetslope warning
flow_flowinit.f90 Implemented dynamic vegetation polygon processing
flow_allocflow.f90 Allocated arrays for dynamic vegetation tracking
wave_comp_stokes_velocities.f90 Replaced magic number with constant
xbeachwaves.f90 Extensive conversion from 'd0' to '_dp' for consistency, added safety checks
xbeach_math_tools.F90 Added array initialization after allocation
setwavfu.f90 Added wave force factor and removed unused code
compute_wave_forcing_rhs.f90 Moved xbeach_flow_bc call outside kmx check
m_fm_bott3d.f90 Added dynamic vegetation link-based cumulative change tracking
fm_fallve.f90 Added comment about kmx==1 limitation
fm_erosed.f90 Enhanced diffusion parameter handling and fixed kmaxsd reference
duneaval.f90 Added bermslope transport support
bermslopenudging.f90 Simplified fixfac calculation and added wave direction consideration
apply_sediment_bc.f90 Fixed boundary condition array indexing
update_verticalprofiles.f90 Corrected wave turbulence penetration formula and conditional
set_kbot_ktop.f90 Added TODO comment for z-layer morphology
getvanrijnwci.f90 Changed single precision to double precision
getustwav.f90 Refactored streaming layer calculations and removed roller contribution
getustbcfuhi.f90 Enhanced wave velocity profile handling and streaming layer physics
furu.f90 Reordered Stokes drift calculation
flow_initimestep.f90 Added dynamic vegetation update call
compute_dynveg.f90 New module implementing dynamic vegetation roughness updates
unstruc_netcdf.f90 Fixed variable name from 'tp' to 'twav'
zlin.f90 Added precision module import
unstruc_model.f90 Added dynamic vegetation parameters and configuration
m_waves.f90 Added new wave force tuning parameters
m_sediment.f90 Added cumulative erosion tracking and diffusion parameters
m_physcoef.f90 Added dynamic vegetation roughness parameters
m_flow.f90 Added arrays for dynamic vegetation state tracking

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

end if
!
if (alfad50 > 0.0_fp) then
!uamag = uamag * (0.000225_fp/d50)**alfad50 ! hoe kan een snelheidsasymmetrie fie zijn van korrelgrootte?
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'fie' to 'functie' (function in Dutch).

Suggested change
!uamag = uamag * (0.000225_fp/d50)**alfad50 ! hoe kan een snelheidsasymmetrie fie zijn van korrelgrootte?
!uamag = uamag * (0.000225_fp/d50)**alfad50 ! hoe kan een snelheidsasymmetrie functie zijn van korrelgrootte?

Copilot uses AI. Check for mistakes.
end if
!
if (alfad50 > 0.0_fp) then
!uamag = uamag * (0.000225_fp/d50)**alfad50 ! hoe kan een snelheidsasymmetrie fie zijn van korrelgrootte?
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'fie' to 'functie' (function in Dutch).

Suggested change
!uamag = uamag * (0.000225_fp/d50)**alfad50 ! hoe kan een snelheidsasymmetrie fie zijn van korrelgrootte?
!uamag = uamag * (0.000225_fp/d50)**alfad50 ! hoe kan een snelheidsasymmetrie functie zijn van korrelgrootte?

Copilot uses AI. Check for mistakes.
Comment on lines +1690 to 1691
integer, save :: lunfil

Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The variable 'lunfil' is declared with the 'save' attribute but is never used in the visible code. If it's unused, it should be removed to avoid confusion.

Suggested change
integer, save :: lunfil

Copilot uses AI. Check for mistakes.
do L = Lb, Ltop(LL)
if (hu(L) <= slfacdeltau) then
htop = min(hu(L), slfacdeltau) ! max height within streaming layer
alin = 1_dp - htop / slfacdeltau ! linear from 1 at bed to 0 at 3*deltau
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Comment states 'linear from 1 at bed to 0 at 3*deltau' but the actual calculation uses slfacdeltau, which equals strlyrfac * deltau (default 3.0 * deltau). The comment should reference slfacdeltau for clarity or state the general formula.

Suggested change
alin = 1_dp - htop / slfacdeltau ! linear from 1 at bed to 0 at 3*deltau
alin = 1_dp - htop / slfacdeltau ! linear from 1 at bed to 0 at slfacdeltau (= strlyrfac * deltau)

Copilot uses AI. Check for mistakes.
if (writeall) then
call prop_set(prop_ptr, 'physics', 'Umodlin', umodlin, 'Linear friction umod, for friction_type=4,5,6')
end if
call prop_set(prop_ptr, 'physics', 'DynRoughVeg', dynroughveg, 'Switch for dynamic vegetation rougness. Default 0.')
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'rougness' to 'roughness'.

Suggested change
call prop_set(prop_ptr, 'physics', 'DynRoughVeg', dynroughveg, 'Switch for dynamic vegetation rougness. Default 0.')
call prop_set(prop_ptr, 'physics', 'DynRoughVeg', dynroughveg, 'Switch for dynamic vegetation roughness. Default 0.')

Copilot uses AI. Check for mistakes.
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.

2 participants