# Storm surge simulation set up¶

Once we have identified an appropriate date for a storm surge simulation hindcast (see Storm surge overview for examples), we need to generate forcing files. We are forcing the storm surge system in two ways: sea surface height anomaly at the Juan de Fuca boundary and atmopsheric winds and pressure at the sea surface. The usual tidal forcing is also applied. The initial conditions should also be considered carefully.

## Initial conditions and start date¶

Initial conditions on temperature and salinity are generated by model spin-up. The initial conditions on the velocities and sea surface height are zero. We use restart files from model spin-up runs to initialize the temperature and salinity. The procedure is described here: Initializing T+S with a restart file.

It is a good idea to choose a restart file close to the start date of your simulation.

Since the velocities and sea surface height are initially zero, the model needs time for spin up. Storm surge simulations should begin at least one day prior to the storm event of interest. Two days would be safer. Analysis of the spin up period can be found here.

## Sea surface height forcing¶

We force the sea surface height anomaly at the Juan de Fuca boundary based on tidal observations from Tofino. The tidal component of the observed water level height at Tofino has been removed. The water level height observations are taken from the DFO and the tidal predictions are generated with t_tide. Details are found in this notebook: SSH_Tofino.ipynb.

This notebook can be edited to generate forcing files for other time frames.

To use these forcing files in NEMO, we must edit namelist.lateral. The title of the forcing files should have the format ssh_y2006m01.nc. Each file contains one month of the hourly sea surface height anomaly. First, tell NEMO that you are using external data on the barotropic fields:

!-----------------------------------------------------------------------
&nambdy        !  unstructured open boundaries                          ("key_bdy")
!-----------------------------------------------------------------------
nb_bdy         = 1        ! number of open boundary sets
ln_coords_file = .false.  ! =T : read bdy coordinates from file
cn_coords_file = ''       ! bdy coordinates files
nn_dyn2d       =  2       ! boundary conditions for barotropic fields
nn_dyn2d_dta   =  3       ! = 0, bdy data are equal to the initial state
! = 1, bdy data are read in 'bdydata   .nc' files
! = 2, use tidal harmonic forcing data from files
! = 3, use external data AND tidal harmonic forcing


Ensure that nn_dyn2d =2 and nn_dyn2d_dta=3.

Next, insert the forcing files into the nambdy_dta section. It should look like:

&nambdy_dta      !  open boundaries - external data           ("key_bdy")
!-----------------------------------------------------------------------
!         !  file name            ! freq (hr)  ! variable  !  time  !  clim  ! period  ! weights  ! rotation !
!         !                       ! (<0 == mo) !   name    ! interp !  (T/F) !         ! filename ! pairing  !
bn_ssh = 'ssh/ssh',                   1,        'sossheig', .true.,  .false.,  'monthly',  '',        ''
bn_u2d = 'ssh/ssh',                   1,        'vobtcrtx', .true.,  .false.,  'monthly',  '',        ''
bn_v2d = 'ssh/ssh',                   1,        'vobtcrty', .true.,  .false.,  'monthly',  '',        ''
bn_u3d = '',                      24,        'vozocrtx', .true.,  .false., 'daily',   '',        ''
bn_v3d = '',                      24,        'vomecrty', .true.,  .false., 'daily',   '',        ''
bn_tem = 'SalishSea2_Masson_DC', 168,        'votemper', .true.,  .true.,  'yearly',  '',        ''
bn_sal = 'SalishSea2_Masson_DC', 168,        'vosaline', .true.,  .true.,  'yearly',  '',        ''

cn_dir = 'open_boundaries/west/'
ln_full_vel = .false.
&end


## Atmospheric Forcing¶

Atmospheric forcing is an important component of storm surges. Currently, we are using model output for winds, pressure and a variety of other fields from CGRF (see Atmospheric Forcing). Ensure that the atmospheric forcing files for the simulation dates of interest have been generated.

## Namelists¶

Example namelists and run set files for storm surge simulations are located in the SS-run-sets repo. The iodef.xml tells NEMO to output hourly data for several storm surge locations of interest.