% A wrapper for function TPXO2ROMS_v5pt1 - also makes a plot with ellipses. %addpath(genpath('/storage0/group/Oceanography/JOHNL/myroms/PrepTides')) %t0 can be any time of day not necessarily 00:00 %lengthSim is the approximate anticipated length of model run (days) (f & u are computed at mid-point). %fnGrid is your ROMS grid file. %TPXO2ROMS will write to fnOut. %The available choices for ROMSnames are: 'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4' '2N2' 'S1' %For example, use ROMSnames={'M2' 'S2' 'MM'}; to use M2, S2, and MM only clear %****************Bay of Fundy*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % t0=datenum(2020,1,1); %seedtime in cmems_OceanDrift.py % lengthSim=3; %approximate length of model run in days % fnGrid='C:\_mystuff\MODELS\myroms\Projects\Bay_of_Fundy\DATA\grd_Bay_of_Fundy.nc'; % fnOut=['C:\_mystuff\MODELS\myroms\Projects\Bay_of_Fundy\DATA\frc_TPXO9_' datestr(t0,'ddmmmyyyy') '.nc']; % ROMSnames={'M2' 'S2' 'N2' 'K2' 'K1' 'O1' 'P1' 'Q1'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=10; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** %****************Alderney Race*************** RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only TIDE_START=3042; %From ROMS *.in file (TIME_REF=-2) t0=TIDE_START+datenum(2011,1,1); %TIDE_START in Matlab datenum lengthSim=30; %approximate length of model run in days fnGrid='C:\Users\aBc\Documents\MATLAB\TPXO\ROMS_alderney_z_test.nc'; fnOut=['C:\Users\aBc\Documents\MATLAB\TPXO\frc_TPXO9_alderneyv1' datestr(t0,'ddmmmyyyy') '_v4a.nc']; ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4' '2N2' 'S1'}; % Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='Q1'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=10; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** %****************Vizhinjam*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=18485; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % fnGrid='C:\_mystuff\MODELS\myroms\Projects\Vizhinjam\DATA\grd_Vizhinjam.nc'; % fnOut=['C:\_mystuff\MODELS\myroms\Projects\Vizhinjam\DATA\frc_TPXO9_Vizhinjam_' datestr(t0,'ddmmmyyyy') '_v5.nc']; % ROMSnames={'M2' 'S2' 'N2' 'K2' 'K1' 'O1' 'P1' 'Q1'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=10; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** % %****************Sattahip*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=18636; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % fnGrid='C:\_mystuff\MODELS\myroms\Projects\Sattahip\DATA\grd_Sattahip.nc'; % fnOut=['C:\_mystuff\MODELS\myroms\Projects\Sattahip\DATA\frc_TPXO9_Sattahip_' datestr(t0,'ddmmmyyyy') '.nc']; % ROMSnames={'M2' 'S2' 'N2' 'K2' 'K1' 'O1' 'P1' 'Q1' 'MM' 'MF' 'M4' 'MN4' 'MS4' '2N2' 'S1'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=10; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse % %******************************************** % %****************Exmouth*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=18858; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % fnGrid='C:\_mystuff\MODELS\myroms\Projects\Exmouth\DATA\grd_Exmouth.nc'; % fnOut=['C:\_mystuff\MODELS\myroms\Projects\Exmouth\Forcing\frc_TPXO9_Exmouth_' datestr(t0,'ddmmmyyyy') '_temp.nc']; % ROMSnames={'M2' 'S2' 'N2' 'K2' 'K1' 'O1' 'P1' 'Q1' 'MM' 'MF' 'M4' 'MN4' 'MS4' '2N2' 'S1'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=10; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse % %******************************************** %****************AGM*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17967; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=17; %approximate length of model run in days % fnGrid='C:\mystuff\MODELS\myroms\Projects\AGM1\DATA\grd_etopo1_AGM1.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\AGM1\DATA\frc_TPXO_AGM1_' datestr(t0,'ddmmmyyyy') '.nc']; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** %****************DM*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17967; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=200; %approximate length of model run in days % fnGrid='C:\mystuff\MODELS\myroms\Projects\DM300\DATA\grd_etopo2_DM300.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\DM300\DATA\frc_TPXO_DM300_' datestr(t0,'ddmmmyyyy') '.nc']; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** %****************SAM*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=15059; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % fnGrid='C:\_mystuff\MODELS\myroms\Projects\SAM\DATA\grd_SAM.nc'; % fnOut=['C:\_mystuff\MODELS\myroms\Projects\SAM\Forcing\frc_TPXO9_BP_SAM_' datestr(t0,'ddmmmyyyy') '.nc']; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4' '2N2' 'S1'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'M2'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** % %****************BP_SAM*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=15059; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days %fnGrid='C:\mystuff\MODELS\myroms\Projects\BP_SAM\DATA\grd_GA_SAM_gridbuilder.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\BP_SAM\DATA\frc_TPXO_BP_SAM_' datestr(t0,'ddmmmyyyy') '.nc']; % ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse % %******************************************** %****************Montara*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=15059; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % fnGrid='C:\mystuff\MODELS\myroms\Projects\Montara\DATA\grd_Montara.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\Montara\DATA\frc_TPXO_Montara_' datestr(t0,'ddmmmyyyy') 'test.nc']; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** % %****************Philippines*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17433; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % if ispc % fnGrid='C:\mystuff\MODELS\myroms\Projects\Philippines\DATA\grd_Philippines.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\BAY1000\DATA\frc_TPXO_Philippines_' datestr(t0,'ddmmmyyyy') '.nc']; % else % fnGrid='/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/grd_BAY100.nc'; % fnOut=['/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/frc_TPXO_BAY100_' datestr(t0,'ddmmmyyyy') '.nc']; % end % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** %****************BAY100A*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17433; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % if ispc % fnGrid='C:\mystuff\MODELS\myroms\Projects\BAY100A\DATA\grd_BAY100A.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\BAY100A\DATA\frc_TPXO_BAY100A_' datestr(t0,'ddmmmyyyy') 'test.nc']; % else % fnGrid='/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100A/DATA/grd_BAY100.nc'; % fnOut=['/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100A/DATA/frc_TPXO_BAY100_' datestr(t0,'ddmmmyyyy') '.nc']; % end % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse % %******************************************** %****************BAY1000******************* % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17433; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % if ispc % fnGrid='C:\mystuff\MODELS\myroms\Projects\BAY1000\DATA\grd_BAY1000.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\BAY1000\DATA\frc_TPXO_BAY1000_' datestr(t0,'ddmmmyyyy') '.nc']; % else % fnGrid='/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/grd_BAY100.nc'; % fnOut=['/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/frc_TPXO_BAY100_' datestr(t0,'ddmmmyyyy') '.nc']; % end % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** %****************BAY5000*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17433; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % if ispc % fnGrid='C:\mystuff\MODELS\myroms\Projects\BAY5000\DATA\grd_BAY5000.nc'; % fnOut=['C:\mystuff\MODELS\myroms\Projects\BAY5000\DATA\frc_TPXO_BAY5000_' datestr(t0,'ddmmmyyyy') '.nc']; % else % fnGrid='/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/grd_BAY100.nc'; % fnOut=['/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/frc_TPXO_BAY100_' datestr(t0,'ddmmmyyyy') '.nc']; % end % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** %****************BAY300*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17433; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %approximate length of model run in days % if ispc % fnGrid='O:\Oceanography\JOHNL\myroms\Projects\BAY300\DATA\grd_BAY300.nc'; % fnOut=['O:\Oceanography\JOHNL\myroms\Projects\BAY300\DATA\frc_TPXO_BAY300_' datestr(t0,'ddmmmyyyy') '.nc']; % else % fnGrid='/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/grd_BAY100.nc'; % fnOut=['/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/frc_TPXO_BAY100_' datestr(t0,'ddmmmyyyy') '.nc']; % end % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** % %****************Modify to suit*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=17433; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=30; %approximate length of model run in days % if ispc % fnGrid='O:\Oceanography\JOHNL\myroms\Projects\BP_SAM\DATA\grd_GA_SAM.nc'; % fnOut=['O:\Oceanography\JOHNL\myroms\Projects\BP_SAM\DATA\frc_TPXO_SAM_' datestr(t0,'ddmmmyyyy') '.nc']; % else % fnGrid='/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/grd_BAY100.nc'; % fnOut=['/storage0/group/Oceanography/JOHNL/myroms/Projects/BAY100/DATA/frc_TPXO_BAY100_' datestr(t0,'ddmmmyyyy') '.nc']; % end % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.1; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse %******************************************** % %****************Modify to suit*************** % RUNTPXO=0; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=15437; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=60; %estimated length of model run (not exact) % fnGrid='O:\Oceanography\HENRY\myroms\Projects\GSV\DATA\romsGrid_HE.nc'; % fnOut=['O:\Oceanography\HENRY\myroms\Projects\GSV\DATA\frc_TPXO_gsv_' num2str(TIDE_START) '.nc']; % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=1; %plot each skipth'th ellipse % sfac=0.05; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=1; %Semi-major axis of scale factor ellipse % %******************************************** %****************Modify to suit*************** % RUNTPXO=1; %set to 0 to skip computation - handy for playing with the plot only % TIDE_START=15198; %From ROMS *.in file (TIME_REF=-2) % t0=TIDE_START+datenum(1968,5,23); %TIDE_START in Matlab datenum % lengthSim=70; %estimated length of model run (not exact) % fnGrid='U:\Luick\myroms\Projects\GBR3\DATA\grd_gbr3.nc'; % fnOut=['U:\Luick\myroms\Projects\GBR3\DATA\frc_TPXO_gbr3_' num2str(TIDE_START) '_XXXX.nc']; % %ROMSnames={'M2'}; % ROMSnames={'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'M4'}; % %ROMSnames={'MM' 'MF' 'Q1' 'O1' 'P1' 'K1' 'N2' 'M2' 'S2' 'K2' 'MN4' 'M4' 'MS4'}; % %Hplot, skip, sfac, and smaj are parameters for the ellipse map % Hplot='M2'; %Which harmonic to plot (name one, e.g. 'M2', 'K1', etc.) % skip=3; %plot each skipth'th ellipse % sfac=0.01; %sf=scalefactor (the ellipse sizes are arbitrary) % smaj=10; %Semi-major axis of scale factor ellipse %******************************************** %Do not use existing filename as number of harmonics may differ, causing untold grief. if RUNTPXO if exist(fnOut,'file') error('File fnOut exists - must delete it or modify fnOut filename.') end TPXO2ROMS_v5pt2(t0,ROMSnames,fnGrid,fnOut,lengthSim) end %Determine the index of the plot harmonic in the ROMS output file. %The harmonic names are not necessarily in the file so search on period. % if strcmp(Hplot,'MM') % period=661.3092; % elseif strcmp(Hplot,'MF') % period=327.8590; % elseif strcmp(Hplot,'Q1') % period=26.8684; % elseif strcmp(Hplot,'O1') % period=25.8193; % elseif strcmp(Hplot,'P1') % period=24.0659; % elseif strcmp(Hplot,'K1') % period=23.9345; % elseif strcmp(Hplot,'N2') % period=12.6583; % elseif strcmp(Hplot,'M2') % period=12.4206; % elseif strcmp(Hplot,'S2') % period=12.0000; % elseif strcmp(Hplot,'K2') % period=11.9672; % elseif strcmp(Hplot,'MN4') % period=6.2692; % elseif strcmp(Hplot,'M4') % period=6.2103; % elseif strcmp(Hplot,'MS4') % period=6.1033; % elseif strcmp(Hplot,'2N2') % period=12.9055; % elseif strcmp(Hplot,'S1') % period=15; % else % error('Harmonic not in TPXO database - try another.') % end % P=nc_varget(fnOut,'tide_period'); % ff=find(P<=period+0.01 & P>=period-0.01); % Nplot=ff; % if isempty(Nplot) % error(['Harmonic not found in ' fnOut]) % end % % %Plot % figure % h=nc_varget(fnGrid,'h'); % mr=nc_varget(fnGrid,'mask_rho'); % lon=nc_varget(fnGrid,'lon_rho'); % lat=nc_varget(fnGrid,'lat_rho'); % Eamp=nc_varget(fnOut,'tide_Eamp'); % Epha=nc_varget(fnOut,'tide_Ephase'); % Cmin=nc_varget(fnOut,'tide_Cmin'); % Cmax=nc_varget(fnOut,'tide_Cmax'); % Cang=nc_varget(fnOut,'tide_Cangle'); % if ndims(Eamp) > 2 % Eamp=squeeze(Eamp(Nplot,:,:)); % Epha=squeeze(Epha(Nplot,:,:)); % Cmin=squeeze(Cmin(Nplot,:,:)); % Cmax=squeeze(Cmax(Nplot,:,:)); % Cang=squeeze(Cang(Nplot,:,:)); % end % hold on % %contourf(lon,lat,Epha); % contourf(lon,lat,Eamp); % [M,L]=size(lat); % avelon=(min(min(lon))+max(max(lon)))/2; % avelat=(min(min(lat))+max(max(lat)))/2; % Cmin=Cmin(1:skip:M,1:skip:L); % Cmax=Cmax(1:skip:M,1:skip:L); % Cang=Cang(1:skip:M,1:skip:L); % mr=mr(1:skip:M,1:skip:L); % lon=lon(1:skip:M,1:skip:L); % lat=lat(1:skip:M,1:skip:L); % %ellipse(sfac*mr.*Cmax,sfac*mr.*Cmin,mr.*Cang,lon,lat,'k'); % %ellipse(sfac*smaj,sfac*smaj/2,0,avelon,avelat,'w'); % %title(['White ellipse: semi-major axis = ' num2str(smaj) ' m/s']) % colormap(squeeze_jet) % colorbar % cj_map % print(gcf,'-dpng','TPXO2ROMS_NOellipses.png'); %Say goodbye disp('"May all our differences be finite"')