Virtual Tide Gauges (VTGs)
Zhigang Xu
Maurice Lamontagne Institute
Department of Fisheries and Oceans Canada
October, 2018
Revised, April 2024
Table of Contents
- What is a VTG(Virtual Tide Gauge)?
- The All Source Green’s Function (ASGF)
- The ASGF matrix has two interpretations.
- From An ASGF Convolution to A Regression Model
- VTG in Real-Time Operation in Vancouver Harbour
- VTG Performances at Vancouver Harbour, BC
- VTG Performances at Sept-Iles QC and Halifax Harbour (Bedford Basin) NS.
- A National Network of VTGs
- Summaries and Conclusions
- References
- A Few Key Concepts
- How to Run VTGs on GPSC
- Q/A
What is a VTG(Virtual Tide Gauge)?
A VTG is a mathematical transfer function to transfer astronomical and atmospheric global forcing fields to a time series of water level responses at a point of interest (POI). Its parameters are trained by (short-term) observed data through data assimilation technique (least-squares fittings).
Alternative definition: A VTG is a linear global model with data assimilation skill computed in a smart way; it wastes no computations on all the grid points other than a point of interest (POI).
Advantages of a VTG are numerous:
- a VTG can also predict future water levels whereas a PTG (Physical Tide Gauge) cannot;
- maintaining a PTG in a remote area or harsh environment can be costly or infeasible, a VTG is a good substitute;
- a VTG is a good backup for a PTG in case of instrument failure.
- a VTG is a good tool for quality control of observations by a PTG;
- a VTG provides a platform to integrate all the relevant data (tides, storm surges, and on-going or historic observations) for the site in one place.
The PDF file linked here is my first seminar presentation about VTG in June 2017.
The All Source Green’s Function (ASGF)
Behind the VTG is a core technique called the All-Source Green's Function (ASGF; Xu, 2007, 2011). The ASGF is derived from a global numerical model and is a pre-calculated matrix. Each column of the matrix is a Green's function that corresponds to a source point, and all source points of the world ocean are included (hence the name of the function). The ASGF only needs computed once but can be repeatedly used.
Figure 1 below shows how to obtain the ASGF. The top part is the familiar linear and depth-averaged shallow water equations, which can be discretized and assembled in a matrix equation. The matrix equation is what the usual forward model is. It is not feasible to run this forward model to obtain a complete set of Green’s functions, because all the grid points have to be considered as potential source points and each of which will require one model run. This would imply million times of model runs.
Figure 1: A real ocean (forward) model and a conjugate ocean (inverse) model
What should be run is its conjugated model (the inverse model) as shown in the bottom part of Figure 1. The inverse model reverses the source and receiver points of the forward model. One run of the inverse model with a δ-forcing placed at a point of interest (POI) yields the complete set of the Green’s functions, corresponding to all the grid points in the real ocean treated as potential source points .
The ASGF matrix has two interpretations.
Figure 2: Domains of dependences at 6, 12, 24 and 48 hours
Column-wise, each column is a Green’s function corresponding to a δ-forcing placed a grid point. There are as many columns as the grid points covering the world ocean. Row-wise, a row of the matrix describes a domain of dependence at a specific time. Figure 3 above illustrate four domains of dependences at 6, 12, 24 and 48 hours. Take the one at 6 hours for example, the water level at Sept-Iles, Quebec (the POI ), depends on the forcings (and/or the initial conditions) within the colored region. Anything outside of this region has no influence on the water levels on the POI yet. The domain of dependence grows with time. At 48 hours, forcings in the entire world ocean can affect the water levels at the POI, significantly or insignificantly. The domain of dependence in 1-D wave dynamics is a concept that one will encounter in any textbook on partial differential equations. The domain of dependences here is an expansion to a 2-D case.
From An ASGF Convolution to A Regression Model
The water level at a POI is a convolution of the ASGF matrix G with two global external forcing fields of \(F_{atm}\) for atmospheric forcing and \(F_{tide}\) for astronomic forcing field. The \(F_{atm}\) is computed with MERRA-2 dataset from NASA and the GEM4 model outputs from Environment Canada; the former is used for historical forcings and the latter is for the present and near-future forcing. The \(F_{tide}\) is computed with NASA/JPL ephemerides of the solar system and Doodson’s Harmonic TGP (tide generating potential); the former is used when there are less than 20 years of observations of tidal data, the latter is used when there are longer observations.
Figure 3: Global forcing fields
From the convolution equation, one can further derive a regression model (Xu, 2015a,b). The \(s\) vector is originally the singular values of the G-matrix, but now acts as the regression parameters, ready to be adjusted by the observations in the least-squares sense. For a place where there is a permanent tidal gauge to produce a live data steam, one can exercise recursive least-squares fitting with the second equation to assimilate new data at very hour.
VTG in Real-Time Operation in Vancouver Harbour
Figure 4: Screeshot of VTG web page on 2018/Nov/16, 19:00 UTC
This screen was captured at 2018/Nov/16, 19:00 UTC when this poster was prepared. This time is marked as the vertical brown lines in the two panels. This vertical time bar divides the time series into three regions: to the left of the bar is a hindcast region, to the right of the bar, there are forecast-1 and forecast-2 regions. In the forecast-1 region, the water levels are predicted by the tides and surges (VTG predictions), and in forecast-2 region, the water level are predicted by tides only. The time length of forecast-1 is six days, limited by the length of GEM4 weather forecasts. There is a no time limit in the tidal predictions. The hindcast goes back to day-1 of the observations or 1979/Jan/01 whichever is closer to the present. The time point of 1979/Jan/01 is the beginning of a historical atmospheric forcing field, MERRA-2.
VTG Performances at Vancouver Harbour, BC
Figure 5: Storm surge on 2018/Jan/21, at Vancouver Harbour.
This is an example of VTG performance in comparison with the tidal chart. There is a half-meter of storm surge peaked around 6:00 pm of 2018/Jan/21. The VTG forecast/hindcast is agreed very well by the observations. All the observations points in the period shown fall into the 95%-confidence zone of the VTG predictions. In comparison, the tidal chart underestimates the total water levels by half meters at the peak time of the storm surge.
VTG Performances at Sept-Iles QC and Halifax Harbour (Bedford Basin) NS.
Figure 6: Negative storm surge on 2018/Nov/4, at Sept-Iles QC.
This negative surge happened in Sept-Iles Quebec, peaked at 6:30 pm on November 4, 2018 with a value of 0.8m. A negative surge is more dangerous for safe navigation. It is more deceptive too because it happens usually in a good weather (under a high-pressure system). Without VTG, a captain would be misled by the tidal chart by 80 cm in water depth.
Figure 7: Histograms of misfit distributions from VTG and tidal chart at Sept-Iles.
A comparison of misfit distributions between VTG and the tidal chart at Sept-Iles. The uncertainty of the water level prediction is reduced by nearly 50% by VTG. More importantly, the extremes of the misfits are also reduced greatly.
Figure 8: High persistent water levels at Dartmouth, NS on March 2018.
Interestingly, there was a persistent water level rise for nine days due to atmospheric forcing in Bedford Basin, Dartmouth, Halifax, NS, Canada. The VTG’s prediction for this unusual long were well confirmed the observations. In comparison, the tidal chart for the same location underestimated the water level by up to more than 60 cm.
A National Network of VTGs
A network of VTGs for CHS (Canadian Hydrographic Service) is being built up. Fourteen VTGs have already been implemented and are in real-time operations.
Figure 9: VTG web page stations map
Summaries and Conclusions
A VTG is a new modelling approach; it integrates and features with
- Linear Global Shallow Water Equation Model
- All-Source Green’s Function
- Data Assimilation
- NASA/JPL ephemerides resource
- MERRA-2 and GEM4 model resources
- Real-Time Tide Gauge Data Streams (if there is one).
It can be implemented anywhere. Where maintaining a PTG (Physical Tide Gauge) in a remote or harsh environment can be costly or infeasible, a VTG is a good substitute. A VTG is also a good backup to a PTG. A VTG can also predict future water levels whereas a PTG cannot. A VTG provides good quality of hindcast and forecast. Uncertainty of predictions is reduced by 50% compared with traditional tidal harmonic forecasts.
References
- Xu Z. 2007. The all-source Green's function and its applications to tsunami problems. Science of Tsunami Hazards, Vol. 26, No. 1, pages 59-69 (2007).
- Xu Z. 2011. The All-Source Green's Function of Linear Shallow Water Dynamic System: Its Numerical Constructions and Applications to Tsunami Problems. In: Tsunami, Research and Technologies, Nils-Axel Mörner (Ed.), page numbers (509-540), ISBN: 978-953-307-552-5.
- Xu Z., & Song, Y. T. 2013. Combining the All-Source Green's Functions and the GPS-Derived Source Functions for Fast Tsunami Predictions – Illustrated by the March 2011 Japan Tsunami. Journal of Atmospheric and Oceanic Technology, 30(7), 1542-1554.
- Xu Z. (2015a). The all-source Green's function (ASGF) and its applications to storm surge modeling, part I: from the governing equations to the ASGF convolution. Ocean Dynamics. Volume 65, Issue 12, pp 1743-1760. https://dx.doi.org/10.1007/s10236-015-0893-z
- Xu Z. (2015b). The all-source Green's function (ASGF) and its applications to storm surge modeling, part II: from the ASGF Convolution to Forcing Data Compression and A Regression Model. Ocean Dynamics. Volume 65, Issue 12, pp 1761-1778. https://dx.doi.org/10.1007/s10236-015-0894-y
- Xu Z. (2017) On Virtual Tide Gauge (VTG) (link), seminar presentation at Maurice Lamontagne Institute, June 23, 2017, Mont-Joli, Quebec.
- Xu Z. (2023). Development and Implementation of a National Network of Virtual Tide Gauges for Coastal Protection and Forecasting in Canada. AGU Fall 2023, San Fransico, December 11-15, 2023. (link)
A Few Key Concepts
- Recursive Least Squares
From Gilbert Strange: https://www.dropbox.com/s/kw1z8p77cimc2rb/Pages%20from%20Introduction%20to%20applied%20mathematics%20by%20Gilbert%20Strang%20%28z-lib.org%29_recursive_Least_Squares.pdf?dl=0
How to Run VTGs on GPSC
GPSC
We have a user with access to GPSC (mib003). The documentation is availble on a web site available only from inside the DFO firewall : https://portal.science.gc.ca/confluence/
Matlab scripts
There are two scripts, cmc_on_gpsc.m and vtgs_on_gpsc.m
The first take care of the atmospheric forcing data, the other one runs the available VTGs.
Binaries, shell scripts and MATLAB Runtime
Each script is compiled with the MATLAB Compiler available on GPSC.
The compilation produces a binary of the same name (ex. cmc_on_gpsc) and a shell script to run it (ex. run_cmc_on_gpsc.sh).
These can then be run as
> run_cmc_on_gpsc.sh $MCRROOT
The variable MCRROOT refer to the MATLAB Runtime. It will only be available if the environment has been initialised with
> . ssmuse-sh -x main/opt/matlab/matlab-R2020a
Periodic running using hcron
On GPSC, cron is not usable and we used hcron.
We are running the cmc script, twice a day to download and compress the atmospheric forcing data, and the vtg script every hour.
This can be adjusted by editing the files under ~/.hcron/hcron1.science.gc.ca/events/ (see documentation for the details).
The output of the scripts are available in log files under ~/ (useful when things go wrong).
The scripts
cmc_on_gpsc.m
function msg=cmc_on_gpsc(RD) % Note: It is important to follow the order to run the sections as numbered 1, 2 and 3 below. system('echo $(date)'); %% 1- dload from cmc if nargin==0 RD='/fs/vnas_Hdfo/bioios/mib003/ODYLAB/ATMF/cmc/gem4/'; end obj=ATMFcmc(RD); obj.dload('00'); obj.dload('12'); msg{1}='OK'; %% 2- SVD compression obj.atmfsvdcmpr([1:20]); obj.intMtVs=[]; obj.atmfsvdcmpr([21:40]); obj.intMtVs=[]; obj.atmfsvdcmpr([41:60]); obj.intMtVs=[]; obj.atmfsvdcmpr([61:80]); obj.intMtVs=[]; obj.atmfsvdcmpr([81:92]); msg{2}='OK'; %% 3- upload to AWS HOME='/fs/vnas_Hdfo/bioios/mib003'; [o1 o2]=system([HOME '/ODYLAB/ODYLAB/aws/bin/aws s3 sync ' RD '2022/ s3://atmospheric-forcing-data/cmc/gem4/2022/']); [o3 o4]=system([HOME '/ODYLAB/ODYLAB/aws/bin/aws s3 sync ' RD 'FORECAST/ s3://atmospheric-forcing-data/cmc/gem4/FORECAST/ --delete']); if ~o1 & ~o3 disp("Uploaded to AWS"); else disp(o2); disp(o4); end msg{3}='OK';
vtgs_on_gpsc.m
function msg=vtgs_on_gpsc(slist) system('echo $(date)'); % Set all or a subset of VTGs if nargin==0 slist=[1:92]; else slist=str2num(slist); end % Construct object vtg=vtgAll_constr(slist); nvtg=numel(vtg.VTGs); % Run get_Regr for the chosen VTGs for i=1:nvtg vtg.VTGs{i}.get_Regr(); end msg='OK';
Q/A
Q: Should the surge be expected to be exactly equal to the difference between the hindcast (surges + tides) and the hindcast (tides only)?
A: No, it should not be expected to be exactly equal. When we refer to the total water level as the sum of tides and surges, this is simply a shorthand way of expressing the situation. In reality, we use two regression matrices, T and S, to represent tidal and surge models, respectively. We also have a set of observed water levels.
When we assume that the gravitational forces due to the Sun and Moon are the only contributors to the observations (as is the case with traditional tidal harmonic analysis), we use T alone to fit the observations and obtain a set of regression coefficients, say c1. We can then use T*c1 to compute a solution for hind/forecast, which we call a tidal model solution. This is how the black curve seen on the ODYALBA/VTG webpage is computed.
However, in reality, atmospheric forces such as air pressures and wind stress also contribute significantly to the observations, especially on stormy days. To account for this, we use an augmented regression matrix [T S] to fit the observations and obtain a new set of regression coefficients, c2. Using [T S]c2, we can compute a solution for hind/forecast as well, which we call a VTG solution. This is how the pink line seen on the webpage is computed. We can further split c2 into two parts, c2=[c2a;c2b], and the VTG solution into two parts, [T S]*c2=T*c2a+S*c2b. We call the first part the tidal component and the second part the surge component, which is shown in the second panel on the webpage. Note the first part, T*c2a, is not shown in the webpage. The black line shown there is T*c1, not T*c2a.
Because T and S are not completely orthogonal, c2a should not be expected to be the same as c1. This means that the total subtracted by the tides, [T S]c2-Tc1=T*(c2a-c1)+Sc2b, is not necessarily equal to the surges S*c2b. Tides and surges have overlapping Fourier frequencies, which means that they are not completely separate phenomena.
In summary, when fitting observed water levels, one can use either a tidal model alone or a tidal model and a surge model simultaneously. The former yields results consisting of tides only, while the latter yields results consisting of both tides and surges. It's important to note that the tidal component obtained from the simultaneous fitting should not be expected to be the same as the one obtained from fitting the tidal model alone, as tides and surges are not orthogonal.