[MITgcm-support] Tidal phase in obcs_add_tides

Matthew Mazloff mmazloff at ucsd.edu
Wed Aug 14 00:08:21 EDT 2019


The meat of the matlab code I used for TPXO is pasted below

(I think this code came mostly from Heriberto Vazquez Peralta and Ruth Musgrave.)


start_date = datenum(2015,01,01);
start_date = start_date+1/12; %MODEL STARTS 2:00
load /data/SO12/SWOT/GRID/grid XC YC hFacW hFacS DRF

% Using transport instead of amplitude I need the depth at each boundary
transport=1;
if transport
    [NX NY NZ] = size(hFacW);
    depth_w = zeros(1,NY,'double');
    depth_s = zeros(NX,1,'double');
    depth_n = zeros(NX,1,'double');
    for k = 1:NZ
        depth_w = depth_w + DRF(k)*hFacW(iobcs,:,k);
        depth_s = depth_s + DRF(k)*hFacS(:,iobcs,k);
        depth_n = depth_n + DRF(k)*hFacS(:,end-iobcs+1,k);
    end
end

% Loading names from Pawlowicz set
load t_constituents
names=mat2cell(const.name,ones(146,1),4);

consts = {'M2  ','S2  ','N2  ','K2  ','K1  ','O1  ','P1  ','Q1  '};
phase_date=zeros(8,1);
freq=zeros(8,1);
for jj = 1 : numel(consts)
    ind = find(strcmp(names,consts{jj})); % Index of constituents in Pawlowicz
    names(ind,:)
    [v,u,f]=t_vuf(start_date,ind,nan); % Phase correction for real forcing
    phase_date(jj)=v;
    freq(jj)=const.freq(ind);
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Western Boundary
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
lat = YC(iobcs,:); lon = XC(iobcs,:)-360;

[amp,Gph,Depth,conList]=tmd_extract_HC([dir_tpxo,'DATA/','Model_tpxo7.2'],lat,lon,'u',[1:8]);

if transport
    unos=ones(size(amp,1),1);
    amp=amp.*(unos*Depth)./(unos*depth_w);
    dd=isfinite(amp);
    amp(~dd)=0;
end
Gph=Gph/360; % To cycles.

New_Gph = bsxfun(@minus,Gph,phase_date); % Correcting the phase to date

% Transforming the phase to seconds
T = 3600*1./freq; % Periods for each constituent

New_Gph_sec = bsxfun(@times,New_Gph,T); % Phase in seconds
New_Gph_sec = New_Gph_sec';
amp=amp'/100; % Transforming to m/s

prec = 'single';

if transport
    tr='_trans';
else
    tr=[];
end

amp(isnan(amp))=0;
New_Gph_sec(isnan(New_Gph_sec))=0;

fid = fopen([save_dir 'OBW_SWOT_TdlAmp',tr,'_Jan_2015v1.bin'],'w','b');
fwrite(fid,amp,prec);
fclose(fid);

fid = fopen([save_dir 'OBW_SWOT_TdlPhs',tr,'_Jan_2015v1.bin'],'w','b');
fwrite(fid,New_Gph_sec,prec);
fclose(fid);



> On Aug 11, 2019, at 5:30 PM, Richet, Oceane (O&A, Hobart) <Oceane.Richet at csiro.au> wrote:
> 
> Hello everyone,
> 
> I am implementing the tides at the boundaries of my regional domain and I am wondering what is exactly the tidal phase that I have to put in input. I know that this tidal phase is in second in the MITgcm but what I am trying to figure out is, in the case of the tpxo data, what are the corrections that I have to apply to the tpxo tidal phase. The phase is already in degree GMT but do I have to apply a nodal correction (and also on the amplitude?)? Does the input phase in the MITgcm correspond to the Greenwich phase lag (difference between the astronomical argument and the observed phase - this is what I saw in a previous study)? I am a bit confused by all the things that I read and I would like to clarify this point.
> 
> Thank you!
> 
> Océane 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support <http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20190813/fe6319fd/attachment-0001.html>


More information about the MITgcm-support mailing list