class: center, middle, titlepage # HF radar assimilation exercise Alexander Barth
1
, Solène Jousset
2
,
1
University of Liege, Belgium
2
SHOM, France http://tinyurl.com/assim-exercise ![logo](Fig/logo_ulg2.svg) ![logo](Fig/GHER.svg) --- # A quick introduction to Julia https://github.com/Alexander-Barth/HF-radar-assim-exercise/blob/master/Julia.md --- # Ensemble generation ![half:](Fig/wind_ens.svg) * 88 ROMS model runs with perturbed: * Boundary conditions * Wind forcing * Solar radiation * Ensemble run is the most costly step * For Ensemble OI: the ensemble is static taken from the time evolution of the model * Ensemble state from different times * Here: ensemble is from a free-running ensemble simulation * In total 528 ensemble members --- # Grid staggering ![right:](Fig/arakawa2.svg) * ROMS uses the Arakawa C grid * $u$ and $v$ velocities are not defined at the same location --- # Interpolation of velocity ![right:](Fig/arakawa_C.svg) * Velocity is interpolated to a common location * Here: $u$ and $v$ are interpolated to the center of the grid * For the $u$ component see figure --- # Geometry ![right:](Fig/HF-radar.svg) * Measurement location is characterized by the distance from the HF radar site and the bearing angle β. * A single HF radar site measures the radial velocity relative to the direction α. --- # Observation operator * Observation operator is implemented as the function `interp_radvel` * Interpolation used the package `Interpolations` * Assumes that the grid is aligned in the North-South and East-West directions (which is the case here) * Example of interpolating the component `us` at the location 8°N and 43°W ```julia using Interpolations us = .... # surface current itpu = extrapolate(interpolate((lon_u[:,1],lat_u[1,:]),us,Gridded(Linear())), NaN); itpu(8,43) # value at the location longitude = 8 and latitude = 43 ``` --- # Observation error covariance * Observation error covariance `R` is assumed to be a diagonal matrix with all diagonal elements equal to 0.01 (m²/s²). ```julia using LinearAlgebra R = Diagonal(fill(0.01,size(yo))) ``` * Observations are perturbed by adding random noise. ```julia yo = yo + sqrt(R) * randn(size(yo)) ``` * Set the seed to make the exercise exactly reproducible across different computers. ```julia using Random srand(12345) ``` --- # Exercises * Work in groups 1) Compute the __ensemble standard of the velocity vector__ as $$\sqrt{ var(u) + var(v)}$$ Create a plot (x-axis is the longitude and y-axis is the latitude) and the color represents the ensemble standard. 2) What is the __probability__ that the speed (norm of the velocity vector) exceeds 20 cm/s assuming that the ensemble members are a sample of the model probability distribution function (pdf)? Create a plot (x-axis is the longitude and y-axis is the latitude) and the color represents the probability --- 3) Simplified __twin experiment__: * Let's assume that the last ensemble member is the reality (true current) * The last ensemble member will be used to extract observations, but it will not be used during the analysis * Assimilate radial observations of two HF radar sites * Optimize the __position and orientation__ of two HF radar sites. We assume that the field of view of the HF Radar 120 degrees but the orientation of the antenna can be chosen freely. The range of HF radar is fixed to 100 km with a radial resolution of 5 km. * Validate the mean of the analysis ensemble with the true currents --- # Useful functions * __`mean`__ and __`var`__ for the mean and variance (module `Statistics`) * __`plot`__, __`pcolor`__ and __`scatter`__ for plotting 1D, 2D or unstructed data (module `PyPlot`) * `sin` and `cos` are the trigonometric function (built-in) * __element-wise operations have always a dot (`.`)__, for example `.![true,false]` returns `[false,true]` or `sin.([0,pi/2])` returns `[0.0, 1.0]` * type __`?mean`__ for more information about the function `mean` (likewise for other functions) * indices start at 1 * range of indices are written as `1:10` (and the upper bound is inclusive) --- # Using Binder * Binder is a web service to run notebooks on a server * The exercise can be made using Binder by clicking on the following icons: * exercise [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Alexander-Barth/HF-radar-assim-exercise/nb?filepath=assim_exercise.ipynb) * solution of the exercise [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Alexander-Barth/HF-radar-assim-exercise/nb?filepath=assim_exercise_SOLUTION.ipynb) * Setting-up the working environement on the binder service can take a couple of minutes. * __Binder will automatically shut down user sessions that have more than 10 minutes of inactivity and you will lose your session__. * Use the `File` 🠖 `Download as` 🠖 `Notebook` to save your work. You can also use `File` 🠖 `Open` and click on the right `Upload` button to upload as saved notebook file. --- # Installing the software on your laptop * Instead of using Binder the notebooks can also be run on your laptop * In this case follow the instructions here https://github.com/Alexander-Barth/HF-radar-assim-exercise#setting-up-your-work-environment * Follow [the link](https://raw.githubusercontent.com/Alexander-Barth/HF-radar-assim-exercise/master/assim_exercise.ipynb) (or https://tinyurl.com/assim-notebook) and then choose `File` 🠖 `Save` in your web-browser as with the file name `assim_exercise.ipynb` --- # Submit results * Choose group name (variable `groupname`, please do not use special characters like accents) * Submit your results using your group name and the the location and orientation of the 2 HF radar sites: ```julia submit_results(groupname,sitelon1,sitelat1,siteorientation1, sitelon2,sitelat2,siteorientation2) ``` * View how well you are doing: http://data-assimilation.net/scores/?game=OGCB2024 * You can run the function `submit_results` as many time as you want, but use always the same group name. Only the best result will appear. * Still make sure that your placed your HF radar sites on land...