Tidal Forcing

From WikiROMS
Jump to navigationJump to search
Description of Tidal Forcing in ROMS

Tidal Forcing Files in ROMS

Once the appropriate CPP options have been set (e.g. SSH_TIDES, UV_TIDES, RAMP_TIDES), a netcdf file of tidal constituents must be generated.

  1. Download the desired tidal constituent database and associated software. There are many tidal constituent databases available for download and the choice of databases depends on the desired constituents and location of the ROMS grid. Two possibilities which have broad geographic range and generally the dominant constituents are the OSU Tidal Data Prediction Software(OTPS) and the ADCIRC tidal database. Remember to download the associated software with each data base as there ire typically routines which facilitate the extraction and interpolation of the database to the ROMS grid.
  2. Interpolate the tidal constituent database to the desired ROMS grid. See the above comment. While it is possible to write code (e.g. MATLAB, FORTRAN) to perform this task, it is typically easier to use the provided packages.
  3. Verify all open boundary grid cells contain valid data. During the interpolation process, depending on the land mask for the ROMS grid and the tidal database grid, it is possible to have grid cells near land points which the ROMS grid may define as water, but the tidal grid defines as land. Should this occur a 180 degree phase shift along the open boundary near land points is possible. As ROMS is tidally forced on the open boundary, this could be problematic.
  4. The phase of the u/v/zeta components of the tidal constituents should be shifted to the appropriate reference time(t=to).It is typical for tidal constituent databases to be stored with the phase shifted by the equilibrium tidal argument. Consequently the reference time for the tide is not the desired time, as set in ocean.in using the variable TIDE_START. In addition, nodal corrections need to be made due to long period tides. The equilibrium argument and nodal corrections can be calculated using the tidal database software or Rich Pawlowicz's T_TIDE MATLAB package. Also, see below for more thoughts on the 18.6 year business.
  5. Convert the amplitude/phase information to tidal ellipse parameters, if necessary. ROMS requires tidal information to be stored as ellipse parameters for use. One tidal ellipse package is ap2ep.m from Zhigang Xu.MATLAB tidal ellipse code is available.
  6. Export tidal ellipse parameters to a ROMS netcdf forcing file.

Two examples of this process are described below.

Warning Newer Matlab versions are incompatible with older versions of t_tide and will cause errors. In particular, the "finite" function has been replaced with "isfinite" Rich Pawlowicz has provided an updated version of t_tide on his website http://www.eos.ubc.ca/~rich/#T_Tide. I have also provided a link here [1]

OSU Tidal Prediction Software Example (Matlab)

Note The fortran based OTPS tidal constituent extraction routines have been replaced by a MATLAB based version.

The processing in this example was carried out in MATLAB using routines found in http://myroms.org/hunter/roms_tides/ and http://myroms.org/hunter/roms_tides/update/otps It requires T_TIDE and the Earth and Space Research TMD TOOLBOX.

  1. Download the ESR Tidal Model Driver(OTPS.tar.Z) to the the working directory e.g. OTPS/. Extract the TMD routines.
    • cd OTPS/a
    • uncompress OTPS.tar.Z
    • tar xvf OTPS.tar
  2. Download the appropriate regional or global model database with respect to the ROMS domain. e.g. For a model of the East coast of the United states, download EC.tar.Z. Uncompressing and extracting this file should great a subdirectory called DATA/
    • uncompress EC.tar.Z
    • tar xvf EC.tar
  3. Now the tidal constituents are ready to be extracted and saved to a ROMS forcing file. An example (using MATLAB) of how to do this is given in otps2frc_v3.m. In the following example, t is the reference date for the tide (i.e. TIDE_START), tpred is the nodal corrections reference time (usually the midpoint of range of the prediction time), and gfile is the ROMS grid file. Also included are and output file and the path the OTIS database.
    • >> t=datenum(2005,1,1);
    • >> tpred=datenum(2006,1,1);
    • >> gfile='/home/hunter/roms/in/roms_latte_grid_3c.nc';
    • >> otps2frc_v3(gfile,t,tpred,'test_EC.nc','DATA/Model_EC')


Note otps2frc_v3 calls extract_HC and generates several intermediate files. It also generates the file setup.inp as input to extract_HC. The format of setup.inp is:

DATA/Model_NA  ! 1. tidal model control file ../ll.dat  ! 2. latitude/longitude/time file z  ! 3. z/U/V/u/v o1,k1,n2,m2,s2  ! 4. tidal constituents to include AP  ! 5. AP/RI oce  ! 6. oce/geo 0  ! 7. 1/0 correct for minor constituents ../nena_8g_z.out  ! 8. output file (ASCII)

Details of the format are found in the OTPS.tar.Z README file.

Note It is also hard-coded into otps2frc_v3 to only look for the constituents m2,s2,k1,o1. If you want more constituents(and they exist in the regional or global database of your choice) you will have to edit otps2frc_v3.m.

Note Depending on the versions of the Matlab scripts used the user may have problems creating a ROMS forcing file. Depending on the version of the file t_vuf.m (called by otps2frc_v3.m) in the Matlab path, the two lines of otps2frc_v3.m that call t_vuf.m may need to be modified. If the version t_vuf.m in the Matlab path requires 4 inputs, instead of the three given by otps2frc_v3.m, then either 'full' or 'nodal' needs to be added as the first input variable.

Warning If you attempt to extract constituents that don't exist in the database, extract_HC MAY fill in data for those constituents, usually by filling in with data from a constituent that exists. So verify the constituent is part of the database.

ADCIRC Tidal Database Example (Matlab)

The processing in this example was carried out in MATLAB using routines found in http://marine.rutgers.edu/~hunter/roms/tides/adcirc/. It has been tested on a SUN and requires T_TIDE.

  1. Download the desired ADCIRC tidal database. e.g. Download ec2001_v2e.zip. Unzip this file into the working directory.
    • unzip ec_95d.zip
  2. Compile tides_ec2001.f into the executable tides_ec2001.out. *
    • f77 -g -o tides_ec2001.out tides_ec2001.f
  3. Now the tidal constituents are ready to be extracted and saved to a ROMS forcing file. An example (using MATLAB) of how to do this is given in adcirc2frc_v2.m. In the following example, t is the reference date for the tide (i.e. TIDE_START),tp is a prediction time(usually the same as the reference data) used to calculate nodal corrections and gfile is the ROMS grid file. Also included are an output filename and a processing flag. The processing flag determines whether tides_ec2001.out is executed. It needs to b e run only once. As it can take a very long time, once the output file tides.out is generated, change this from 1 to 0.
    • >> t=datenum(2005,1,1);
    • >> tp=datenum(2006,1,1);
    • >> gfile='/home/hunter/roms/in/roms_latte_grid_3c.nc';
    • >> adcirc2frc_v2(gfile,t,tp,'test_adcirc.nc',1)

Note * - The file tides_ec2001.f is written to compile using SUN f77. It will not work with g77 as downloaded from the ADCIRC website. There is a logical unit of of 105 which is out of range for g77. It must be edited to change thes lo a number <99. An example of and edited file is available in http://marine.rutgers.edu/~hunter/roms/tides/adcirc/tides_ec2001.f.

Note This version of adcirc2frc_v2.m includes all tidal constituents from the ADCIRC database. Any undesired constituents must be removed after the tidal file is generated.

Comments on the 18.6 year tides

The "18 year" tide is not a separate tidal constituent, but is rather a modulation of the amplitude (and a phase shift) of the other tides. The amplitude of the modulation for three constituents is shown here:

18yrs small.jpg

  • Because we run multi-decadal simulations, we have chosen not to include the "nodal corrections" in the external forcing file but to modify ROMS to compute them for the time at hand. The alternative would be to swap out the tidal forcing file every few years.
  • These long-period modulations cause us to be dubious of the ROMS detiding algorithm since it is learning on the fly but not forgetting what it was learning nine years before.
  • I have been asked by several people how I create the tides files. My scripts (without tidal potentials) are File:Tides ncl.tar.gz.