According to https://www.myroms.org/wiki/index.php/tide_start; the following formula is used to add the tides onto zeta.
Now looking at the code in set_tides.F;
Code: Select all
!-----------------------------------------------------------------------
! Add tidal elevation (m) to sea surface height climatology.
!-----------------------------------------------------------------------
!
Etide(:,:)=0.0_r8
cff=2.0_r8*pi*(time(ng)-tide_start*day2sec)
DO itide=1,NTC
IF (Tperiod(itide).gt.0.0_r8) THEN
omega=cff/Tperiod(itide)
DO j=JstrR,JendR
DO i=IstrR,IendR
Etide(i,j)=Etide(i,j)+ &
& ramp*SSH_Tamp(i,j,itide)* &
& COS(omega-SSH_Tphase(i,j,itide))
# ifdef MASKING
Etide(i,j)=Etide(i,j)*rmask(i,j)
# endif
END DO
END DO
END IF
END DO
Code: Select all
& COS(omega-(2*pi*SSH_Tphase(i,j,itide)/Tperiod(itide))
The reason why I'm so interested in the tides is because I want to add the tidal model into the observations so I can assimilate SSH whilst still including tides! Computing the tidal contribution to zeta from the tidal forcing harmonics in the same way as ROMS seemed like the best way to add the tides to the AVISO SSH observations for assimilating.
In doing so I wrote a matlab script to plot the tidal contribution to sea level that I'd like to partiality share;
Code: Select all
tide_start=1*day2sec; %tide_start needs to be in seconds among all the time variables including Tperiod
Tperiod=nc_read(TideFile,'tide_period');
SSH_Tphase=nc_read(TideFile,'tide_Ephase')/360;
SSH_Tamp=nc_read(TideFile,'tide_Eamp'); Etide=zeros(iend,jend);
cff=2*pi*(Time(n)-(tide_start));
for itide=1:NTC
if Tperiod(itide)>0
omega=cff/(Tperiod(itide)*hour2sec);
for j=1:jend
for i=1:iend
& Etide(i,j)=Etide(i,j)+(SSH_Tamp(i,j,itide)*cos(omega-(SSH_Tphase(i,j,itide)))); % OLD VERSION!
Etide(i,j)=Etide(i,j)+(SSH_Tamp(i,j,itide)*cos(omega-((2*pi*SSH_Tphase(i,j,itide))/(Tperiod(itide)*hour2sec)))) % CORRECTED VERSION!;
Etide(i,j)=Etide(i,j)*mask(i,j);
end
end
end
end
I've also tried looking at other grids and other tidal forcing but the changes from 'corrected' to the current code dramatically vary from different locations Some were more simply just different and didn't experience this disjointed to smooth transition which makes me second guess my logic I am still quite the amateur at ocean modeling so if I have made a mistake that's quite obvious I won't feel at all bad to be corrected! Thanks!