[MITgcm-support] Tidal forcing at the open boundaries

Matthew Mazloff mmazloff at ucsd.edu
Tue Apr 23 12:34:18 EDT 2019


Hello

Yes, I believe you have to convert phase to seconds

And TPXO does give amplitude in m/s if you pass it ‘u’ or ‘v’ instead of ‘z'

From 
tmd_extract_HC.m
%                    'z' - elvation (m)
%                    'u','v' - velocities (cm/s)
%                    'U','V' - transports (m^2/s);

I have attached relevant code snippet below that I have used to get amp and phase (here called New_Gph_sec)

I forget where I got this originally - maybe Ruth Musgrave?
Matt


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); %MAKE SURE TPXO depth consistent with mine
    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 Apr 23, 2019, at 7:53 AM, Ruan Xiaozhou <saberruan at hotmail.com> wrote:
> 
> Dear MITgcm users,
> 
> This might be an old question (I couldn’t find a satisfying answer in the old posts though). I’m trying to force a nested patch with tidal forcing at the open boundaries using the OBCS package. However, the required tidal amplitude and phase input files have some weird units that confused me. In the OBCS_PARAMS.h file, it specifically says the ‘amplitude’ should have the unit of m/s and the ‘phase’ should have the unit of second. I guess maybe it makes sense for the ‘phase' if it is defined as ph * T/(2 pi) where T is the tidal period and ph is what I have from normal tidal output dataset (e.g. TPXO) that has the unit of radian. But the amplitude input is directly used to add to both velocities (u and v) at the open boundaries but it normally has the unit of meter in tidal datasets. I was wondering if anyone could share their experience converting the units of these tidal input files? 
> 
> Thanks for your time.
> 
> Cheers,
> Xiaozhou 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20190423/d676fe9f/attachment-0001.html>


More information about the MITgcm-support mailing list