Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed bins to levels #68

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
cae9550
Start new branch for testing SFINCS-SnapWave IG wave generation. Made…
Leynse Feb 14, 2023
88fa29a
- finc2ig wasn't actually used in snapwave, so removed
Leynse Feb 20, 2023
c4352fe
- Make possible to change baldock_opt from 1 (default) to 2
Leynse Feb 21, 2023
a1bd664
- Add dissipation due to wave breaking and friction to his-output as …
Leynse Feb 21, 2023
7634c26
- Similarly add dissipation due to wave breaking and friction for IG …
Leynse Feb 21, 2023
43feb73
- Change minimum snapwave_depth
Leynse Feb 21, 2023
6b03e52
- Start adding a 3rd option in Baldock dissipation subroutine
Leynse Feb 23, 2023
3936f68
- Add cg wave group speed to nc his output
Leynse Mar 2, 2023
47442ce
- Calculate percentage of breaking waves Qb based on wave heights in …
Leynse Mar 2, 2023
5eb4fa5
- Use Hk_ig0 for ig waves in the same way as Hk0 is used for incident…
Leynse Mar 8, 2023
cedbc83
- Remove Qb from Esink by removing from fsh_local calculation
Leynse Mar 13, 2023
b565eff
- Temporarily added hardcoded depth limit of 0.2m below which no ener…
Leynse Mar 15, 2023
3a2849a
Merge branch 'main' of https://github.com/Deltares/SFINCS into sfincs…
Leynse Mar 17, 2023
7735895
- Add info about running with dynamic waves (wmvfile) and spectrum if…
Leynse Mar 17, 2023
5097482
- Update names in his output to 'directionally averaged'
Leynse Mar 20, 2023
6b1a8bc
- bugfix to achieve: in sfincs_wavemaker.f90, use user specified rati…
Leynse Mar 20, 2023
5c9c3ac
- Give info to user about 'Number of boundary SnapWave nodes' found
Leynse Mar 28, 2023
5f65a95
- Add general ig_opt = 2 to use first estimate of new shoaling rate f…
Leynse Apr 3, 2023
217ca4e
- Add a third alpha estimator formula for testing
Leynse May 8, 2023
139660b
- Add IG parametrisation version 4
Leynse May 26, 2023
306928f
- Intermediate commit building in method of paper, as option 5 for now
Leynse Aug 15, 2023
321a93e
- Rename fsh to alphaig
Leynse Aug 16, 2023
4f923b0
- Stable result now because of check: Sxxprev(itheta)<=0.0
Leynse Aug 16, 2023
0fda67b
- Clean up a bit
Leynse Aug 16, 2023
5a2138e
- With fixing alpha to 8, result seems plausible
Leynse Aug 16, 2023
b8b9953
- Now result seems good also with using alphaig_local instead of fixe…
Leynse Aug 16, 2023
c1188c9
- Too soon, was still result with constant 8. But adding the 4Hs thre…
Leynse Aug 16, 2023
216d1e6
- The Hinc,0 needed to be as rms to, so divided by sqrt(2)
Leynse Aug 16, 2023
cf92bc2
- Didn't need the real*8 to fix the issues actually
Leynse Aug 16, 2023
ce1c4e2
- Setting a minimum slope for deep water when determining alpha seems…
Leynse Aug 17, 2023
bd228bd
- Update error code ierr = -1 if simulation stopped
Leynse Aug 17, 2023
f520dc3
- Instead of the minimum slope requirement, only allow positive dSxx …
Leynse Aug 17, 2023
0f3e9c8
- Also works when you don't take the absolute value (which is anyway …
Leynse Aug 17, 2023
7660e26
- For clarity already divide by cg_ig(k) in srch_local
Leynse Aug 17, 2023
a7924f4
- First working implementation with a weighted nearest offshore incid…
Leynse Aug 18, 2023
a62b1c2
- Calculate depthforcerelease on the fly and spatially varying, inste…
Leynse Aug 18, 2023
dd4eb8a
- Calculate using depthprev as I think it should be in srcsh_local wi…
Leynse Aug 18, 2023
5807f7a
- Directly put relative into shoaling parameter function
Leynse Aug 18, 2023
0162cf3
- Add a factor 'snapwave_alphaigfac' so you could increase/reduce the…
Leynse Aug 22, 2023
bfdda56
- Bring back depthforcerelease (needed for 2D Duck case)
Leynse Aug 23, 2023
8d4c622
- Put a limit on from what depth we do want extra IG transfer, now se…
Leynse Aug 29, 2023
4cf47af
- Add all the missing baldock solving for igopt == 5!
Leynse Aug 29, 2023
d987c22
- Big change in calculating srcsh! Think it should be /dx instead of …
Leynse Aug 29, 2023
fa49553
- Maybe should go bak to /Cg, will investigate later
Leynse Aug 30, 2023
fb1995f
- Big improvement results because of solving Sxx and dSxx now also in…
Leynse Sep 1, 2023
81b3d51
- Deep water limilation of reldepth=10 to start alphaig>0 not actuall…
Leynse Sep 1, 2023
426ca7e
- Newer version parametrisation: v032
Leynse Sep 7, 2023
60d62f9
- Need to convert Hig for IG at boundary from Hm0 to Hrms > divide Ei…
Leynse Sep 19, 2023
d1babd7
- Add a separate user option for snapwave_alpha_ig, multiplication fa…
Leynse Sep 29, 2023
eab08a4
- Checked again, and shouldn't do the /2 reduction on ee for getting …
Leynse Sep 29, 2023
f97ccf1
- Intermediate commit, new version of IG estimation
Leynse Nov 23, 2023
9857740
- Fix bug of reversed order alphaig formulations for deep and shallow
Leynse Nov 24, 2023
386d28d
- Add beta and snapwavedepth to quadtree map output
Leynse Nov 24, 2023
22f91bf
- Bring back the option to subtract the IG wave energy from the incid…
Leynse Nov 27, 2023
c9b482b
- alphaig limit meant to be at 1
Leynse Dec 14, 2023
684f182
- Determine beta slope based on zb instead of depth, because depth ch…
Leynse Dec 14, 2023
48d940e
- Make it still possible to run with real dSxxdx, rather estimated us…
Leynse Dec 14, 2023
5df8828
- Write all needed code so that once Herbers method to estimate Hig0 …
Leynse Dec 22, 2023
f440ab3
- Changed location calling subroutine build_boundw, since we need the…
Leynse Dec 22, 2023
83dc827
- Added function to calculate water depth at input gridpoint locs > f…
Leynse Dec 22, 2023
7aceead
- Fix zsmax netcdf output, same as current main
Leynse Jan 9, 2024
0dc7953
- Have correct indices output now for snapwavedepth
Leynse Jan 9, 2024
65ed74b
Make subroutine find_nearest_depth_for_boundary_points actually worki…
Leynse Jan 10, 2024
5743b2f
- Start of making subroutine determine_ig_bc
Leynse Jan 10, 2024
1f56095
- Working now is making extra directional spreading bins in build_jon…
Leynse Jan 10, 2024
bc7119f
- Working now is making jonswap spectrum and 2D vardens until the end…
Leynse Jan 10, 2024
c46234a
- Endpoint of today, whole way into subroutine build_etdir
Leynse Jan 10, 2024
c79976a
- Working now is making 2D var dens of random wave angles in build_jo…
Leynse Jan 11, 2024
f041401
- Make possible in Part 2 to correct the Hm0 of 2D Vardens spectrum t…
Leynse Jan 11, 2024
1067842
- Commit first working version of Part 3, with a Hm0ig being computed!
Leynse Jan 11, 2024
d082a6b
- Make sure the right updated water depth is used in subroutine updat…
Leynse Jan 11, 2024
df083b9
- Added option to calculate Tp/Tm01/Tm-1,0 from spectrum
Leynse Jan 11, 2024
d801c24
- Also calculate Tp now over smoothed spectrum, smoothed as in Matlab…
Leynse Jan 11, 2024
54641ec
- Some more cleanup of code
Leynse Jan 11, 2024
fe71999
- And finally the whole determine_ig_bc subroutine and supporting fun…
Leynse Jan 11, 2024
4b33483
- Lot of cleaning up old parts that were legacy from earlier IG param…
Leynse Jan 12, 2024
7d5fdf3
- Small fixes
Leynse Jan 12, 2024
39a0622
- Move " snapwave_tpmean = tpmean_bwv & snapwave_tpigmean = tpmea…
Leynse Jan 12, 2024
f95365d
- Remove write statement
Leynse Jan 12, 2024
7347bb0
Merge branch 'main' of https://github.com/Deltares/SFINCS into sfincs…
Leynse Jan 12, 2024
03c41a2
- Fix small merge mess up
Leynse Jan 12, 2024
94a00b1
- Revert some unwanted changes/additions because of merging
Leynse Jan 12, 2024
34a9db7
- Remove bakfile
Leynse Jan 12, 2024
d0d969c
- show quadtree_rotation in degrees
Leynse Jan 23, 2024
9bd762a
some quadtree bug fixes
maartenvanormondt Feb 3, 2024
f3d48fd
bug fix advection mask (was not using the correct kcuv indices, duhhh…
maartenvanormondt Feb 3, 2024
0ef1df1
added option to turn off advection mask
maartenvanormondt Feb 4, 2024
8afb7c3
Merge branch 'main' into sfincs_snapwave_ig_qt_fix
maartenvanormondt Feb 4, 2024
062f9bf
subgrid bins changed to levels
maartenvanormondt Feb 7, 2024
e053b62
small updates
maartenvanormondt Feb 12, 2024
f4aef91
- Update to main
Leynse Feb 13, 2024
c9628c0
- Undo some unnessary changes
Leynse Feb 13, 2024
e9a1713
- var status was already used > error now
Leynse Feb 13, 2024
885b35e
- in sfincs.f90 > the sfincs_finalize loop should always be performed…
Leynse Feb 13, 2024
6113e7b
- small bug when single dtmaxout interval exactly coincides with mode…
Leynse Feb 14, 2024
9527e6a
- Bugfix for twet > apperently order did matter in checking logicals …
Leynse Feb 14, 2024
7f61571
Merge branch '39-the-return-code-of-the-sfincs-model-is-always-0-even…
Leynse Feb 14, 2024
9bcea17
- Change that check if sbgfile is netcdf or not is not done using net…
Leynse Feb 14, 2024
a8e2f9b
Revert "- Change that check if sbgfile is netcdf or not is not done u…
maartenvanormondt Feb 21, 2024
3bb6a29
update netcdf error handling for binary subgrid file
maartenvanormondt Feb 21, 2024
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
4 changes: 2 additions & 2 deletions source/sfincs/sfincs.vfproj.leijnse.user
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<Configurations>
<Configuration Name="Debug|Win32"/>
<Configuration Name="Release|Win32"/>
<Configuration Name="Debug|x64" CommandArguments="sfincs.inp -autostartstop -t 1" WorkingDirectory="d:\repos\SFINCS_testbed_branch\sfincs_testbed_v2.0.3_alpha_03112023\models\03_Application\Hernani2D_advection\Input\"/>
<Configuration Name="Release|x64" WorkingDirectory="d:\repos\SFINCS_testbed_branch\sfincs_testbed_v2.0.3_alpha_03112023\models\03_Application\Puget_Sound_2020\Input\"/></Configurations></VisualStudioUserFile>
<Configuration Name="Debug|x64" CommandArguments="sfincs.inp -autostartstop -t 1" WorkingDirectory="d:\tmp\Majuro_Koen\"/>
<Configuration Name="Release|x64" WorkingDirectory="d:\repos\phd_waves\paper_IG_parametrisation\05_application_case\Duck_NC\01_modelsetup\ext_delilah_02_ig_final_withoutreduction_herbers\"/></Configurations></VisualStudioUserFile>
1 change: 1 addition & 0 deletions source/sfincs_lib/sfincs_lib.vfproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<File RelativePath="..\src\snapwave\snapwave_data.f90"/>
<File RelativePath="..\src\snapwave\snapwave_date.f90"/>
<File RelativePath="..\src\snapwave\snapwave_domain.f90"/>
<File RelativePath="..\src\snapwave\snapwave_infragravity.f90"/>
<File RelativePath="..\src\snapwave\snapwave_ncoutput.F90">
<FileConfiguration Name="Release|x64">
<Tool Name="VFFortranCompilerTool" Preprocess="preprocessYes"/></FileConfiguration>
Expand Down
1 change: 1 addition & 0 deletions source/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ libsfincs_la_SOURCES = \
snapwave/snapwave_results.f90 \
snapwave/snapwave_data.f90 \
snapwave/snapwave_boundaries.f90 \
snapwave/snapwave_infragravity.f90 \
snapwave/snapwave_date.f90 \
snapwave/snapwave_ncoutput.F90 \
snapwave/snapwave_domain.f90 \
Expand Down
16 changes: 1 addition & 15 deletions source/src/quadtree.F90
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ subroutine quadtree_read_file(qtrfile)
write(*,*)'Quadtree grid info - dy :', quadtree_dy
write(*,*)'Quadtree grid info - mmax :', quadtree_mmax
write(*,*)'Quadtree grid info - nmax :', quadtree_nmax
write(*,*)'Quadtree grid info - rotation :', quadtree_rotation
write(*,*)'Quadtree grid info - rotation :', quadtree_rotation / pi * 180
!
end subroutine

Expand Down Expand Up @@ -363,20 +363,6 @@ subroutine quadtree_read_file_netcdf(qtrfile)
NF90(nf90_get_var(net_file_qtr%ncid, net_file_qtr%mask_varid, quadtree_mask(:)))
NF90(nf90_get_var(net_file_qtr%ncid, net_file_qtr%snapwave_mask_varid, quadtree_snapwave_mask(:)))
!
! Indices in netcdf file are zero-based so add 1
!
quadtree_level = quadtree_level + 1
quadtree_n = quadtree_n + 1
quadtree_m = quadtree_m + 1
quadtree_md1 = quadtree_md1 + 1
quadtree_md2 = quadtree_md2 + 1
quadtree_mu1 = quadtree_mu1 + 1
quadtree_mu2 = quadtree_mu2 + 1
quadtree_nd1 = quadtree_nd1 + 1
quadtree_nd2 = quadtree_nd2 + 1
quadtree_nu1 = quadtree_nu1 + 1
quadtree_nu2 = quadtree_nu2 + 1
!
! Read attibute (should read EPSG code here ?)
!
NF90(nf90_get_att(net_file_qtr%ncid, nf90_global, 'x0', quadtree_x0))
Expand Down
12 changes: 8 additions & 4 deletions source/src/sfincs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ program sfincs
if (ierr==0) then
ierr = sfincs_update(deltat)
endif
!
if (ierr==0) then
ierr = sfincs_finalize()
endif
! Output:
!ierr = 0 ! simulation ran succesfully
!ierr = 1 ! simulation was stopped because of instabilities
!
! Always finalize, especially in case of error:
!if (ierr==0) then
ierr = sfincs_finalize()
!endif
!
end program
4 changes: 2 additions & 2 deletions source/src/sfincs_boundaries.f90
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ subroutine find_boundary_indices()
!
ind1_bnd_gbp(nb) = ib1
ind2_bnd_gbp(nb) = ib2
fac_bnd_gbp(nb) = dst2/(dst1 + dst2)
fac_bnd_gbp(nb) = dst2/max(dst1 + dst2, 1.0e-9)
!
else
!
Expand Down Expand Up @@ -719,7 +719,7 @@ subroutine update_boundary_fluxes(dt)
!
! Interpolation required
!
dzuv = (subgrid_uv_zmax(ip) - subgrid_uv_zmin(ip)) / (subgrid_nbins - 1)
dzuv = (subgrid_uv_zmax(ip) - subgrid_uv_zmin(ip)) / (subgrid_nlevels - 1)
iuv = int((zsuv - subgrid_uv_zmin(ip))/dzuv) + 1
facint = (zsuv - (subgrid_uv_zmin(ip) + (iuv - 1)*dzuv) ) / dzuv
depthuv = subgrid_uv_havg(iuv, ip) + (subgrid_uv_havg(iuv + 1, ip) - subgrid_uv_havg(iuv, ip))*facint
Expand Down
8 changes: 4 additions & 4 deletions source/src/sfincs_continuity.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ subroutine compute_water_levels(dt, tloop)
endif
!
! Put non-default store options in a separate subroutine (all but zsmax) to save computation time when not used (both regular and subgrid):
if (store_maximum_velocity .eqv. .true. .or. store_maximum_flux .eqv. .true. .or. store_twet .eqv. .true.) then
if ((store_maximum_velocity .eqv. .true.) .or. (store_maximum_flux .eqv. .true.) .or. (store_twet .eqv. .true.)) then
!
call compute_store_variables(dt)
!
endif
!
!
call system_clock(count1, count_rate, count_max)
tloop = tloop + 1.0*(count1 - count0)/count_rate
!
Expand Down Expand Up @@ -494,8 +494,8 @@ subroutine compute_water_levels_subgrid(dt)
!
! Interpolation from subgrid tables needed.
!
dzvol = subgrid_z_volmax(nm) / (subgrid_nbins - 1)
iuv = min(int(z_volume(nm)/dzvol) + 1, subgrid_nbins - 1)
dzvol = subgrid_z_volmax(nm) / (subgrid_nlevels - 1)
iuv = min(int(z_volume(nm)/dzvol) + 1, subgrid_nlevels - 1)
facint = (z_volume(nm) - (iuv - 1)*dzvol ) / dzvol
zs(nm) = subgrid_z_dep(iuv, nm) + (subgrid_z_dep(iuv + 1, nm) - subgrid_z_dep(iuv, nm))*facint
!
Expand Down
21 changes: 18 additions & 3 deletions source/src/sfincs_data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ module sfincs_data
real :: tstart_all, tfinish_all
real*4 :: dtavg
!!!
!!! Error code
integer :: error
!!!
!!! Constants
!!!
real*4 g ! gravitational constant g
Expand Down Expand Up @@ -70,7 +73,7 @@ module sfincs_data
real*4 dym2
real*4 nuvisc
real*4 nuviscdim
real*4 nuviscinp
real*4 nuviscinp
real*4 spw_merge_frac
real*4 tsunami_arrival_threshold
real*4 dtwave
Expand Down Expand Up @@ -216,6 +219,7 @@ module sfincs_data
logical :: use_spw_precip
logical :: friction2d
logical :: advection_limiter
logical :: advection_mask
!!!
!!! sfincs_input.f90 switches
integer storevelmax
Expand Down Expand Up @@ -288,6 +292,7 @@ module sfincs_data
integer*1, dimension(:), allocatable :: kcs
integer*1, dimension(:), allocatable :: kcuv
! integer*1, dimension(:), allocatable :: kfu
integer*1, dimension(:), allocatable :: mask_adv
integer*1, dimension(:), allocatable :: scs_rain ! logic if previous time step was raining
!
! Quadtree
Expand Down Expand Up @@ -455,7 +460,7 @@ module sfincs_data
!
! Sub-grid
!
integer :: subgrid_nbins
integer :: subgrid_nlevels
!
real*4, dimension(:), allocatable :: subgrid_z_zmin
real*4, dimension(:), allocatable :: subgrid_z_zmax
Expand Down Expand Up @@ -519,7 +524,17 @@ module sfincs_data
real*4, dimension(:), allocatable :: fwuv
real*4, dimension(:), allocatable :: mean_wave_direction
real*4, dimension(:), allocatable :: wave_directional_spreading
! real*4, dimension(:), allocatable :: tauwavv
real*4, dimension(:), allocatable :: dw
real*4, dimension(:), allocatable :: df
real*4, dimension(:), allocatable :: dwig
real*4, dimension(:), allocatable :: dfig
real*4, dimension(:), allocatable :: cg
real*4, dimension(:), allocatable :: qb
real*4, dimension(:), allocatable :: betamean
real*4, dimension(:), allocatable :: srcsh
real*4, dimension(:), allocatable :: alphaig

! real*4, dimension(:), allocatable :: tauwavv
!
!!!
!!! Boundary data
Expand Down
Loading