<commit_before># NTHMP test problem 1: Solitary wave on a simple beach (analytical version)

We model the runup of a 1D solitary wave on a sloping beach. The analytical solution to this problem is known ([Synolakis, 1987](https://doi.org/10.1017/S002211208700329X)) and is used for model testing herein. A comparison with experimental data is in [benchmark problem 4](../BP04). 

This test problem is from the NTHMP benchmark suite. The test data and a problem description is available in [Randy LeVeque's repository](https://github.com/rjleveque/nthmp-benchmark-problems/tree/master/BP01-DmitryN-Single_wave_on_simple_beach). 

The [SWALS model](BP1_testcases.f90) solves this problem using the nonlinear shallow water equations without friction. The code allows the numerical method to be specified on the commandline, and we test both the `rk2` finite volume solver, and the `leapfrog_nonlinear` finite-difference solver. Both solvers perform well, although for this kind of problem the `rk2` method is somewhat more accurate.

## Results from the rk2 finite volume method

The results below use a grid size of 10cm and the `rk2` finite volume scheme.

Below we compare the modelled and analytical time-series at two sites in the model domain. The model compares very well with the analytical solution. The gap in the analytical solution (top panel) represents drying at that site. Minor deviations between the numerical and analytical solutions can be reduced by refining the mesh.

![Figure 1: Comparison of modelled (rk2) and analytical time-series at two sites](Model-vs-data-at-two-sites_rk2.png)

Below we compare the modelled free-surface profiles at several instants in time. Due to the finite model time-step, the modelled time is close to, but not exactly equal, the analytically desired times. Again the model performs well.

![Figure 2: Comparison of modelled (rk2) and analytical free-surface profiles at several instants in time](Model-vs-data-canonical-profiles_rk2.png)

## Results from the leapfrog nonlinear finite difference method

The results below use a grid size of 10cm (as above) with the `leapfrog_nonlinear` finite difference scheme. 

Below we compare the modelled and analytical time-series at two sites in the model domain. The model compares well with the analytical solution, although is slightly less accurate than the `rk2` solution above with the same grid size. Minor deviations from the analytical solution can be reduced by refining the mesh.

![Figure 1: Comparison of modelled (leapfrog nonlinear) and analytical time-series at two sites](Model-vs-data-at-two-sites_leapfrog_nonlinear.png)

Below we compare the modelled free-surface profiles at several instants in time. Due to the finite model time-step, the modelled time is close to, but not exactly equal, the analytically desired times. Again the model performs well.

![Figure 2: Comparison of modelled (leapfrog nonlinear) and analytical free-surface profiles at several instants in time](Model-vs-data-canonical-profiles_leapfrog_nonlinear.png)<commit_msg>add fig links<commit_after># NTHMP test problem 1: Solitary wave on a simple beach (analytical version)

We model the runup of a 1D solitary wave on a sloping beach. The analytical solution to this problem is known ([Synolakis, 1987](https://doi.org/10.1017/S002211208700329X)) and is used for model testing herein. A comparison with experimental data is in [benchmark problem 4](../BP04). 

This test problem is from the NTHMP benchmark suite. The test data and a problem description is available in [Randy LeVeque's repository](https://github.com/rjleveque/nthmp-benchmark-problems/tree/master/BP01-DmitryN-Single_wave_on_simple_beach). 

The [SWALS model](BP1_testcases.f90) solves this problem using the nonlinear shallow water equations without friction. The code allows the numerical method to be specified on the commandline, and we test both the `rk2` finite volume solver, and the `leapfrog_nonlinear` finite-difference solver. Both solvers perform well, although for this kind of problem the `rk2` method is somewhat more accurate.

## Results from the rk2 finite volume method

The results below use a grid size of 10cm and the `rk2` finite volume scheme.

Below we compare the modelled and analytical time-series at two sites in the model domain. The model compares very well with the analytical solution. The gap in the analytical solution (top panel) represents drying at that site. Minor deviations between the numerical and analytical solutions can be reduced by refining the mesh.

![Figure 1: Comparison of modelled (rk2) and analytical time-series at two sites](https://github.com/GeoscienceAustralia/ptha/blob/figures/propagation/SWALS/examples/nthmp/BP01/Model-vs-data-at-two-sites_rk2.png)

Below we compare the modelled free-surface profiles at several instants in time. Due to the finite model time-step, the modelled time is close to, but not exactly equal, the analytically desired times. Again the model performs well.

![Figure 2: Comparison of modelled (rk2) and analytical free-surface profiles at several instants in time](https://github.com/GeoscienceAustralia/ptha/blob/figures/propagation/SWALS/examples/nthmp/BP01/Model-vs-data-canonical-profiles_rk2.png)

## Results from the leapfrog nonlinear finite difference method

The results below use a grid size of 10cm (as above) with the `leapfrog_nonlinear` finite difference scheme. 

Below we compare the modelled and analytical time-series at two sites in the model domain. The model compares well with the analytical solution, although is slightly less accurate than the `rk2` solution above with the same grid size. Minor deviations from the analytical solution can be reduced by refining the mesh.

![Figure 1: Comparison of modelled (leapfrog nonlinear) and analytical time-series at two sites](https://github.com/GeoscienceAustralia/ptha/blob/figures/propagation/SWALS/examples/nthmp/BP01/Model-vs-data-at-two-sites_leapfrog_nonlinear.png)

Below we compare the modelled free-surface profiles at several instants in time. Due to the finite model time-step, the modelled time is close to, but not exactly equal, the analytically desired times. Again the model performs well.

![Figure 2: Comparison of modelled (leapfrog nonlinear) and analytical free-surface profiles at several instants in time](https://github.com/GeoscienceAustralia/ptha/blob/figures/propagation/SWALS/examples/nthmp/BP01/Model-vs-data-canonical-profiles_leapfrog_nonlinear.png)
{'fraction_non_alphanumeric': 0.060652709359605914, 'fraction_numerical': 0.017241379310344827, 'mean_word_length': 5.054986020503262, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5904192', 'n_tokens_mistral': 1893, 'n_tokens_neox': 1657, 'n_words': 825}