The residual current is inconsistent after adding the tide

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
tao
Posts: 13
Joined: Tue Aug 13, 2024 3:09 pm
Location: south China university of technology

The residual current is inconsistent after adding the tide

#1 Unread post by tao »

I added tides to my model. The tide data comes from TPXO9_v5, and I used otps2frc(https://github.com/NakamuraTakashi/ROMS ... _atlas30.m) to generate the NETCDF file.

With the addition of tides, my currents are significantly skewed. Here are three images: the average current without tides, the average current with the addition of tides, and the monthly average data from HYCOM
1.png
1.png (246.85 KiB) Viewed 6407 times
2.png
2.png (274.6 KiB) Viewed 6407 times
3.png
3.png (260.46 KiB) Viewed 6407 times
Here are my parameters and CPP options

Model Input Parameters: ROMS/TOMS version 4.0
Tuesday - February 4, 2025 - 2:58:17 PM
--------------------------------------------------------------------------------

scs05

Operating system : Linux
CPU/hardware : x86_64
Compiler system : gfortran
Compiler command : /usr/local/openmpi/bin/mpif90
Compiler flags : -frepack-arrays -O3 -ffast-math -
OCN Communicator : 0, PET size = 4

Input Script : scs05.in

SVN Root URL : https://www.myroms.org/svn/src/trunk
SVN Revision : 1107

Local Root : /home/A/src
Header Dir : /home/A/Projects/scs05
Header file : scs05.h
Analytical Dir : /home/A/Projects/scs05

Resolution, Grid 01: 343x348x35, Parallel Nodes: 4, Tiling: 2x2


Physical Parameters, Grid: 01
=============================

51840 ntimes Number of timesteps for 3-D equations.
150.000 dt Timestep size (s) for 3-D equations.
20 ndtfast Number of timesteps for 2-D equations between
each 3D timestep.
1 ERstr Starting ensemble/perturbation run number.
1 ERend Ending ensemble/perturbation run number.
0 nrrec Number of restart records to read from disk.
F LcycleRST Switch to recycle time-records in restart file.
576 nRST Number of timesteps between the writing of data
into restart fields.
1 ninfo Number of timesteps between print of information
to standard output.
1 nSTA Number of timesteps between the writing of data
the stations file.
T ldefout Switch to create a new output NetCDF file(s).
72 nHIS Number of timesteps between the writing fields
into history file.
5760 ndefHIS Number of timesteps between creation of new
history files.
0 nQCK Number of timesteps between the writing fields
into quicksave file.
1 ntsAVG Starting timestep for the accumulation of output
time-averaged data.
51840 nAVG Number of timesteps between the writing of
time-averaged data into averages file.
51840 ndefAVG Number of timesteps between creation of new
time-averaged file.
5.0000E+00 nl_tnu2(01) NLM Horizontal, harmonic mixing coefficient
(m2/s) for tracer 01: temp
5.0000E+00 nl_tnu2(02) NLM Horizontal, harmonic mixing coefficient
(m2/s) for tracer 02: salt
1.0000E+00 nl_visc2 NLM Horizontal, harmonic mixing coefficient
(m2/s) for momentum.
F LuvSponge Turning OFF sponge on horizontal momentum.
F LtracerSponge(01) Turning OFF sponge on tracer 01: temp
F LtracerSponge(02) Turning OFF sponge on tracer 02: salt
1.0000E-06 Akt_bak(01) Background vertical mixing coefficient (m2/s)
for tracer 01: temp
1.0000E-06 Akt_bak(02) Background vertical mixing coefficient (m2/s)
for tracer 02: salt
1.0000E-05 Akv_bak Background vertical mixing coefficient (m2/s)
for momentum.
3.0000E-04 rdrg Linear bottom drag coefficient (m/s).
3.0000E-03 rdrg2 Quadratic bottom drag coefficient.
2.0000E-02 Zob Bottom roughness (m).
2.0000E+00 blk_ZQ Height (m) of surface air humidity measurement.
2.0000E+00 blk_ZT Height (m) of surface air temperature measurement.
1.0000E+01 blk_ZW Height (m) of surface winds measurement.
1.0000E-01 Dcrit Minimum depth for wetting and drying (m).
1 lmd_Jwt Jerlov water type.
2 Vtransform S-coordinate transformation equation.
4 Vstretching S-coordinate stretching function.
8.0000E+00 theta_s S-coordinate surface control parameter.
2.0000E+00 theta_b S-coordinate bottom control parameter.
10.000 Tcline S-coordinate surface/bottom layer width (m) used
in vertical coordinate stretching.
1025.000 rho0 Mean density (kg/m3) for Boussinesq approximation.
T Lnodal Switch to apply a 18.5-year lunar nodal correction.
0.000 dstart Time-stamp assigned to model initialization (days).
0.000 tide_start Reference time origin for tidal forcing (days).
20210101.00 time_ref Reference time for units attribute (yyyymmdd.dd)
3.0000E+01 Tnudg(01) Nudging/relaxation time scale (days)
for tracer 01: temp
3.0000E+01 Tnudg(02) Nudging/relaxation time scale (days)
for tracer 02: salt
3.0000E+01 Znudg Nudging/relaxation time scale (days)
for free-surface.
3.0000E+01 M2nudg Nudging/relaxation time scale (days)
for 2D momentum.
3.0000E+01 M3nudg Nudging/relaxation time scale (days)
for 3D momentum.
3.0000E+01 obcfac Factor between passive and active
open boundary conditions.
F VolCons(1) NLM western edge boundary volume conservation.
F VolCons(2) NLM southern edge boundary volume conservation.
F VolCons(3) NLM eastern edge boundary volume conservation.
F VolCons(4) NLM northern edge boundary volume conservation.
10.000 T0 Background potential temperature (C) constant.
32.000 S0 Background salinity (PSU) constant.
-1.000 gamma2 Slipperiness variable: free-slip (1.0) or
no-slip (-1.0).
F LuvSrc Turning OFF momentum point Sources/Sinks.
F LwSrc Turning OFF volume influx point Sources/Sinks.
F LtracerSrc(01) Turning OFF point Sources/Sinks on tracer 01: temp
F LtracerSrc(02) Turning OFF point Sources/Sinks on tracer 02: salt
F LsshCLM Turning OFF processing of SSH climatology.
F Lm2CLM Turning OFF processing of 2D momentum climatology.
F Lm3CLM Turning OFF processing of 3D momentum climatology.
F LtracerCLM(01) Turning OFF processing of climatology tracer 01: temp
F LtracerCLM(02) Turning OFF processing of climatology tracer 02: salt
F LnudgeM2CLM Turning OFF nudging of 2D momentum climatology.
F LnudgeM3CLM Turning OFF nudging of 3D momentum climatology.
F LnudgeTCLM(01) Turning OFF nudging of climatology tracer 01: temp
F LnudgeTCLM(02) Turning OFF nudging of climatology tracer 02: salt

T Hout(idFsur) Write out free-surface.
T Hout(idUbar) Write out 2D U-momentum component.
T Hout(idVbar) Write out 2D V-momentum component.
T Hout(idUvel) Write out 3D U-momentum component.
T Hout(idVvel) Write out 3D V-momentum component.
T Hout(idWvel) Write out W-momentum component.
T Hout(idTvar) Write out tracer 01: temp
T Hout(idTvar) Write out tracer 02: salt
T Hout(idDano) Write out density anomaly.
T Hout(idVvis) Write out vertical viscosity: AKv.
T Hout(idTdif) Write out vertical diffusion: AKt(itemp).
T Hout(idSdif) Write out vertical diffusion: AKt(isalt).
T Hout(idHsbl) Write out depth of surface boundary layer.

T Aout(idFsur) Write out averaged free-surface.
T Aout(idUbar) Write out averaged 2D U-momentum component.
T Aout(idVbar) Write out averaged 2D V-momentum co Node # 1 (pid= 44) is active.
Node # 2 (pid= 45) is active.
Node # 3 (pid= 46) is active.
mponent.
T Aout(idUvel) Write out averaged 3D U-momentum component.
T Aout(idVvel) Write out averaged 3D V-momentum component.
T Aout(idWvel) Write out averaged W-momentum component.
T Aout(idOvel) Write out averaged omega vertical velocity.
T Aout(idTvar) Write out averaged tracer 01: temp
T Aout(idTvar) Write out averaged tracer 02: salt

T Aout(idFsuD) Write out detided free-surface.
T Aout(idu2dD) Write out detided 2D U-velocity.
T Aout(idv2dD) Write out detided 2D V-velocity.

1 inp_lib Using standard NetCDF library for input files.
1 out_lib Using standard NetCDF library for output files.

Output/Input Files:

Output Restart File: roms_rst.nc
Prefix for History Files: scs05_his_B
Prefix for Averages Files: roms_avg_B
Output Detiding Harmonics File: scs05_har_B.nc
Output Stations File: scs05_sta_B.nc
Input Grid File: SCS04_grid.nc
Input Nonlinear Initial File: SCS04_ini.nc
Tidal Forcing File: frc_TPXO9v5_scs05.nc
Input Forcing File 01: frc_bulkflux_202101.nc
frc_bulkflux_202102.nc
frc_bulkflux_202103.nc
frc_bulkflux_202104.nc
Input Lateral Boundary File 01: SCS04_bry_01.nc
SCS04_bry_02.nc
SCS04_bry_03.nc
SCS04_bry_04.nc
Station positions File: stations.in
ROMS I/O variables Metadata File: /home/A/src/ROMS/External/varinfo.dat

TIDES_DATE - Checking tidal reference date for zero phase:
zero_phase_date = 20210101.0000 (read from frc_TPXO9v5_scs05.nc)
tide_DateNumber = 738157.0000 (2021-01-01 00:00:00)
old tide_start = 0.0000 (days)
new tide_start = 0.0000 (days)

Tile partition information for Grid 01: 343x348x35 tiling: 2x2

tile Istr Iend Jstr Jend Npts

0 1 172 1 174 1047480
1 173 343 1 174 1041390
2 1 172 175 348 1047480
3 173 343 175 348 1041390

Tile minimum and maximum fractional coordinates for Grid 01:
(interior points only)

tile Xmin Xmax Ymin Ymax grid

0 0.50 172.50 0.50 174.50 RHO-points
1 172.50 343.50 0.50 174.50 RHO-points
2 0.50 172.50 174.50 348.50 RHO-points
3 172.50 343.50 174.50 348.50 RHO-points

0 1.00 172.50 0.50 174.50 U-points
1 172.50 343.00 0.50 174.50 U-points
2 1.00 172.50 174.50 348.50 U-points
3 172.50 343.00 174.50 348.50 U-points

0 0.50 172.50 1.00 174.50 V-points
1 172.50 343.50 1.00 174.50 V-points
2 0.50 172.50 174.50 348.00 V-points
3 172.50 343.50 174.50 348.00 V-points

Maximum halo size in XI and ETA directions:

HaloSizeI(1) = 552
HaloSizeJ(1) = 561
TileSide(1) = 181
TileSize(1) = 32218



Stations Parameters, Grid: 01
=============================

4 Nstation Number of stations to write out into stations file.
T Sout(idFsur) Write out free-surface.
T Sout(idUbar) Write out 2D U-momentum component.
T Sout(idVbar) Write out 2D V-momentum component.
T Sout(idu2dE) Write out 2D U-eastward at RHO-points.
T Sout(idv2dN) Write out 2D V-northward at RHO-points.
T Sout(idUvel) Write out 3D U-momentum component.
T Sout(idVvel) Write out 3D V-momentum component.
T Sout(idWvel) Write out W-momentum component.
T Sout(idOvel) Write out omega vertical velocity.
T Sout(idTvar) Write out tracer 01: temp
T Sout(idTvar) Write out tracer 02: salt
T Sout(idVvis) Write out vertical viscosity coefficient.

Flag and positions for station 0001: 1 111.5550 17.9430
Flag and positions for station 0002: 1 111.7480 17.6680
Flag and positions for station 0003: 1 111.9430 17.3890
Flag and positions for station 0004: 1 112.1350 17.1140

Tracer Advection Scheme: NLM
========================

Variable Grid Horizontal Vertical
--------- ---- ------------ ------------

temp 1 Upstream3 Centered4

salt 1 HSIMT HSIMT

Akima4 Fourth-order Akima advection
Centered2 Second-order centered differences advection
Centered4 Fourth-order centered differences advection
HSIMT Third High-order Spatial Inteporlation at Middle Time Advection with TVD limiter
MPDATA Multidimensional Positive Definite Advection Algorithm, recursive method
Splines Conservative Parabolic Splines Reconstruction Advection (only vertical; not recommended)
Split_U3 Split third-order Upstream Advection
Upstream3 Third-order Upstream-biased Advection (only horizontal)


Lateral Boundary Conditions: NLM
============================

Variable Grid West Edge South Edge East Edge North Edge
--------- ---- ---------- ---------- ---------- ----------

zeta 1 Chapman Imp Chapman Imp Chapman Imp Chapman Imp

ubar 1 Flather Flather Flather Flather

vbar 1 Flather Flather Flather Flather

u 1 Rad + Nud Rad + Nud Rad + Nud Rad + Nud

v 1 Rad + Nud Rad + Nud Rad + Nud Rad + Nud

temp 1 Rad + Nud Rad + Nud Rad + Nud Rad + Nud

salt 1 Rad + Nud Rad + Nud Rad + Nud Rad + Nud

Activated C-preprocessing Options:

scs05 scs05
ADD_FSOBC Adding tidal elevation to processed OBC data
ADD_M2OBC Adding tidal currents to processed OBC data
ANA_BSFLUX Analytical kinematic bottom salinity flux
ANA_BTFLUX Analytical kinematic bottom temperature flux
ASSUMED_SHAPE Using assumed-shape arrays
AVERAGES Writing out time-averaged nonlinear model fields
AVERAGES_DETIDE Writing out time-averaged nonlinear model detided fields
BOUNDARY_ALLREDUCE Using mpi_allreduce in mp_boundary routine
BULK_FLUXES Surface bulk fluxes parameterization
COLLECT_ALLREDUCE Using mpi_allreduce in mp_collect routine
CURVGRID Orthogonal curvilinear grid
DIFF_GRID Horizontal diffusion coefficient scaled by grid size
DJ_GRADPS Parabolic Splines density Jacobian (Shchepetkin, 2002)
DOUBLE_PRECISION Double precision arithmetic numerical kernel.
EMINUSP Compute Salt Flux using E-P
LIMIT_BSTRESS Limit bottom stress to maintain bottom velocity direction
LMD_CONVEC LMD convective mixing due to shear instability
LMD_MIXING Large/McWilliams/Doney interior mixing
LMD_NONLOCAL LMD convective nonlocal transport
LMD_RIMIX LMD diffusivity due to shear instability
LMD_SHAPIRO Shapiro filtering boundary layer depth
LMD_SKPP KPP surface boundary layer mixing
LONGWAVE_OUT Compute outgoing longwave radiation internally
MASKING Land/Sea masking
MIX_GEO_TS Mixing of tracers along geopotential surfaces
MIX_S_UV Mixing of momentum along constant S-surfaces
MPI MPI distributed-memory configuration
NONLINEAR Nonlinear Model
NONLIN_EOS Nonlinear Equation of State for seawater
PERFECT_RESTART Processing perfect restart variables
POWER_LAW Power-law shape time-averaging barotropic filter
PROFILE Time profiling activated
RADIATION_2D Use tangential phase speed in radiation conditions
RAMP_TIDES Ramping tidal forcing for one day
REDUCE_ALLREDUCE Using mpi_allreduce in mp_reduce routine
RI_SPLINES Parabolic Spline Reconstruction for Richardson Number
!RST_SINGLE Double precision fields in restart NetCDF file
SALINITY Using salinity
SOLAR_SOURCE Solar Radiation Source Term
SOLVE3D Solving 3D Primitive Equations
SPLINES_VDIFF Parabolic Spline Reconstruction for Vertical Diffusion
SPLINES_VVISC Parabolic Spline Reconstruction for Vertical Viscosity
SSH_TIDES Adding tidal elevation to SSH climatology
STATIONS Writing out station data
TIDE_GENERATING_FORCES Adding astronomical TGF term to pressure gradient
TS_DIF2 Harmonic mixing of tracers
UV_ADV Advection of momentum
UV_COR Coriolis term
UV_U3HADVECTION Third-order upstream horizontal advection of 3D momentum
UV_C4VADVECTION Fourth-order centered vertical advection of momentum
UV_LOGDRAG Logarithmic bottom stress
UV_TIDES Add tidal currents to 2D momentum climatologies
UV_VIS2 Harmonic mixing of momentum
VAR_RHO_2D Variable density barotropic mode
VISC_GRID Horizontal viscosity coefficient scaled by grid size
WET_DRY Wetting and drying activated

Appreciate any suggestions :D

tao
Posts: 13
Joined: Tue Aug 13, 2024 3:09 pm
Location: south China university of technology

Re: The residual current is inconsistent after adding the tide

#2 Unread post by tao »

I have a question whether the fact that I used HYCOM's hourly reanalysis data to generate my boundary file, which includes UV, Ubar, and Vbar data, means that my model calculated two tidal forcing

tao
Posts: 13
Joined: Tue Aug 13, 2024 3:09 pm
Location: south China university of technology

Re: The residual current is inconsistent after adding the tide

#3 Unread post by tao »

Hi everyone, after some time, I'm back with a question.
The descriptions of SSH_TIDE and UV_TIDE say that tidal Forcing is added just on the open boundaries, but my tidal forcing file has tidal Data at every grid point, as does the data in \src\Data\ROMS\Forcing\test_head_frc.nc, which really confuses me.
How can I make sure that the tides are applied to the open boundary and not let the useless data confuse me? Appreciate any help :)

MoeinDst
Posts: 8
Joined: Tue Nov 22, 2022 5:31 pm
Location: University of Genoa
Contact:

Re: The residual current is inconsistent after adding the tide

#4 Unread post by MoeinDst »

Hello Tao.
See these threads that might give you an idea.
viewtopic.php?p=206#p206
viewtopic.php?p=22928#p22928

Also might worth to look into the set_tides.F and see how ROMS adds the tides.
Hope it helps.

User avatar
wilkin
Posts: 924
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: The residual current is inconsistent after adding the tide

#5 Unread post by wilkin »

I can confirm that SSH_TIDES and UV_TIDES add harmonic tidal variability strictly at the model perimeter. That the information is provided via a 2-D field on the full model grid is a matter of legacy going way back. The values in the interior are unused for forcing. However, if the DETIDE option is activated this 2-D file format is used to accumulate the on-the-fly harmonic fit that detides the high frequency output.

If your high-frequency HYCOM output is for a model with resolved explicit tides, then yes, you have tides times two.

Something else to consider in a domain this large is whether the luni-solar tide generating forces are significant. In our model the Indonesian Seas we found these forces actually act to reduce tidal energy in some regions by working against the strictly boundary forced tide. You might consider activating #define TIDE_GENERATING_FORCES
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

tao
Posts: 13
Joined: Tue Aug 13, 2024 3:09 pm
Location: south China university of technology

Re: The residual current is inconsistent after adding the tide

#6 Unread post by tao »

Thanks to MoeinDst for the index and wilkin for your patient explanation, you really helped me a lot. :D

I chose to modify my tide input file to keep only the values for the boundary grid points and set all the data for the internal points to 0. Everything looked much better, except for the tide itself. Right now my tides are far too small compared to TPXO's predictions, which I've been running my model for 60 to 80 days, and the elevation is only half as high as expected, with even more depressing results in the Taiwan Strait(B).
水位验证2021.jpg

User avatar
wilkin
Posts: 924
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: The residual current is inconsistent after adding the tide

#7 Unread post by wilkin »

If you look in set_tides.F you'll see how the 2-D harmonics are used in conjunction with the Flather open boundary condition ... If you have set the harmonic amplitudes to zero inside the domain, the averaging to u,v points will halve the values.

Code: Select all

!  If appropriate, load tidal forcing into boundary arrays.  The "zeta"
!  boundary arrays are important for the Flather or reduced physics
!  boundary conditions for 2D momentum. To avoid having two boundary
!  points for these arrays, the values of "zeta_west" and "zeta_east"
!  are averaged at u-points.  Similarly, the values of "zeta_south"
!  and "zeta_north" is averaged at v-points. Noticed that these
!  arrays are also used for the clamped conditions for free-surface.
!  This averaging is less important for that type ob boundary
!  conditions.
!
        IF (LBC(iwest,isFsur,ng)%acquire.or.                            &
     &      LBC(iwest,isUbar,ng)%acquire.or.                            &
     &      LBC(iwest,isVbar,ng)%acquire) THEN
          update=.FALSE.
          IF (DOMAIN(ng)%Western_Edge(tile)) THEN
            DO j=JstrR,JendR
#  ifdef ADD_FSOBC
              BOUNDARY(ng)%zeta_west(j)=BOUNDARY(ng)%zeta_west(j)+      &
     &                                  0.5_r8*(Etide(Istr-1,j)+        &
     &                                          Etide(Istr  ,j))
#  else
              BOUNDARY(ng)%zeta_west(j)=0.5_r8*(Etide(Istr-1,j)+        &
     &                                          Etide(Istr  ,j))
#  endif
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply