%This script uses another from the internet and the OTPS tide stuff to
%generate tidal forcing for Poverty Bay. This script has to be run in two
%steps, depending on the number of tidal constituents being included, and
%is hard coded in to just make it two steps. There is a flag in
%../M_FILES/otpsfrc_v3.m for setting if it is the first part or not. Set
%this accordingly as one for yes or zero for no. Then run this file. After
%the first part edit otps_harmonics_u and v and z so the line with the
%constituent names on it is all one line. If there are few enough then this
%step can be skipped. Set the flag to zero in otps...m and run this m file
%again.
addpath ../matlab/tidal_ellipse/
addpath ../matlab/tides/
addpath ../matlab/tri/
addpath ../M_FILES/


%gfile = '/data/users-tmp/abever/MODELS/WAIPAOA2/FORCING/INP_3AUG/modern_test_grid.nc'
%gfile = '../../FORCING/calus_grid.nc'
gfile = '../tidal_interp_grid.nc'
%gfile = '../../FORCING/swf_grid3.nc'
% Tidal starting time, must match with the tidal starting time in the
% ocean.in file.
Tstart = datenum([2008 1 1 0 0 0]);

% ROMS tidal forcing file.
ofile = 'calus_tide.nc';

% OTPX tidal model output.
data = './DATA/Model_Mex';

otps2frc_v3(gfile,Tstart,Tstart,ofile,data);
