  Calibration of unknown model parameters is a common task in many ocean model
applications. We present an adjoint-based optimization of an unstructured mesh
shallow water model for the Baltic Sea. Spatially varying bottom friction
parameter is tuned to minimize the misfit with respect to tide gauge sea
surface height (SSH) observations. A key benefit of adjoint-based optimization
is that computational cost does not depend on the number of unknown variables.
Adjoint models are, however, typically very laborious to implement. In this
work, we leverage a domain specific language framework in which the discrete
adjoint model can be obtained automatically. The adjoint model is both exactly
compatible with the discrete forward model and computationally efficient. A
gradient-based quasi-Newton method is used to minimize the misfit. Optimizing
spatially-variable parameters is typically an under-determined problem and can
lead to over-fitting. We employ Hessian-based regularization to penalize the
spatial curvature of the friction field to overcome this problem. The SSH
dynamics in the Baltic Sea are simulated for a 3-month period. Optimization of
the bottom friction parameter results in significant improvement of the model
performance. The results are especially encouraging in the complex Danish
Straits region, highlighting the benefit of unstructured meshes. Domain
specific language frameworks enable automated model analysis and provide easy
access to adjoint modeling. Our application shows that this capability can be
enabled with few efforts, and the optimization procedure is robust and
computationally efficient.
