Commit fc0bb079 authored by thopri's avatar thopri
Browse files

fix that generates list of FES harmonics automatically

parent 71d5242a
Tidal Boundary Conditions Generation
====================================
By providing a global tidal model dataset (TPXO and FES are currently supported) PyNEMO can generate boundary conditions for the
NEMO configuration supplied using the namelist file.
To use the namelist needs to be configured with the required options. These are listed below::
ln_tide = .true. ! =T : produce bdy tidal conditions
sn_tide_model = 'fes' ! Name of tidal model (fes|tpxo)
clname(1) = 'M2' ! constituent name
clname(2) = 'S2'
clname(3) = 'O1'
clname(4) = 'K1'
clname(5) = 'N2'
ln_trans = .false. ! interpolate transport rather than velocities
! TPXO file locations
sn_tide_grid = './grid_tpxo7.2.nc'
sn_tide_h = './h_tpxo7.2.nc'
sn_tide_u = './u_tpxo7.2.nc'
! location of FES data
sn_tide_fes = './FES/'
these options define the location of the tidal model datasets, note this differs depending on model as TPXO has all harmonic
constants in one netcdf file whereas FES has three separate netcdf files for each constant. Extra harmonics can be appended
to the clname(n) list FES supports 34 constants and TPXO7.2 has 13 to choose from. Other versions of TPXO should work with PyNEMO
but have not been yet been tested.
So far the tidal model datasets have been downloaded and used locally but could also be stored on a TREDDS server although this has
not been tested to generate tidal boundaries
Future work
-----------
Create options of harmonic constants to request rather than manually specifying a list. These could be based on common requirements
and/or based on the optimal harmonics to use for a specified time frame.
......@@ -75,7 +75,7 @@
clname(4) = 'K1'
clname(5) = 'N2'
ln_trans = .false. ! interpolate transport rather than
! velocities
! velocities
!------------------------------------------------------------------------------
! Time information
!------------------------------------------------------------------------------
......
......@@ -37,10 +37,12 @@ class HcExtract(object):
mu_name = 'mask_u'
mv_name = 'mask_v'
#constituents = ['2N2', 'EPS2', 'J1', 'K1', 'K2', 'L2', 'LA2', 'M2', 'M3', 'M4', 'M6', 'M8', 'MF', 'MKS2',
#'MM', 'MN4', 'MS4', 'MSF', 'MSQM', 'MTM', 'MU2', 'N2', 'N4', 'NU2', 'O1', 'P1', 'Q1', 'R2',
#'S1', 'S2', 'S4', 'SA', 'SSA', 'T2']
constituents = ['M2','S2','O1','K1','N2']
# create list of HC using namelist file as reference
constituents = list(settings['clname'].values())
# clean strings in list and change to upper case if not already
for i in range(len(constituents)):
constituents[i] = constituents[i].strip("',/\n")
constituents[i] = constituents[i].upper()
self.cons = constituents
self.mask_dataset = {}
......
......@@ -2,6 +2,7 @@
Module to extract constituents for the input grid mapped onto output grid
@author: Mr. Srikanth Nagella
@author: thopri
'''
# pylint: disable=E1103
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment