Skip to content

Commit aefec49

Browse files
herrwang0Hallberg-NOAA
authored andcommitted
Merge [uv]bt_st and [uv]bt_first in btstep
The two pairs are used for different purposes. `[uv]bt_st`` are used for diagnosing barotropic momentum tendency and `[uv]bt_first` are used for OBC. But they are equivalent (initial BT velocity) and neither uses wide halo. This commit merges the two. Extra halo points in assigning `[uv]bt_st` are also removed.
1 parent 412c177 commit aefec49

1 file changed

Lines changed: 7 additions & 17 deletions

File tree

src/core/MOM_barotropic.F90

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
600600
uhbt0, & ! The difference between the sum of the layer zonal thickness
601601
! fluxes and the barotropic thickness flux using the same
602602
! velocity [H L2 T-1 ~> m3 s-1 or kg s-1].
603-
ubt_first, & ! The starting value of ubt in a series of barotropic steps [L T-1 ~> m s-1].
604603
Cor_ref_u, & ! The zonal barotropic Coriolis acceleration due
605604
! to the reference velocities [L T-2 ~> m s-2].
606605
Rayleigh_u, & ! A Rayleigh drag timescale operating at u-points for drag parameterizations
@@ -623,7 +622,6 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
623622
vhbt0, & ! The difference between the sum of the layer meridional
624623
! thickness fluxes and the barotropic thickness flux using
625624
! the same velocities [H L2 T-1 ~> m3 s-1 or kg s-1].
626-
vbt_first, & ! The starting value of vbt in a series of barotropic steps [L T-1 ~> m s-1].
627625
Cor_ref_v, & ! The meridional barotropic Coriolis acceleration due
628626
! to the reference velocities [L T-2 ~> m s-2].
629627
Rayleigh_v, & ! A Rayleigh drag timescale operating at v-points for drag parameterizations
@@ -1316,8 +1314,11 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
13161314
uhbt(:,:) = 0.0 ; vhbt(:,:) = 0.0
13171315
u_accel_bt(:,:) = 0.0 ; v_accel_bt(:,:) = 0.0
13181316

1319-
if (apply_OBCs) then
1320-
ubt_first(:,:) = ubt(:,:) ; vbt_first(:,:) = vbt(:,:)
1317+
if (apply_OBCs .or. (CS%id_ubtdt > 0)) then
1318+
do j=js,je ; do I=is-1,ie ; ubt_st(I,j) = ubt(I,j) ; enddo ; enddo
1319+
endif
1320+
if (apply_OBCs .or. (CS%id_vbtdt > 0)) then
1321+
do J=js-1,je ; do i=is,ie ; vbt_st(i,J) = vbt(i,J) ; enddo ; enddo
13211322
endif
13221323

13231324
! Here the vertical average accelerations due to the Coriolis, advective,
@@ -1788,17 +1789,6 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
17881789
endif
17891790
endif
17901791

1791-
if (CS%id_ubtdt > 0) then
1792-
do j=js-1,je+1 ; do I=is-1,ie
1793-
ubt_st(I,j) = ubt(I,j)
1794-
enddo ; enddo
1795-
endif
1796-
if (CS%id_vbtdt > 0) then
1797-
do J=js-1,je ; do i=is-1,ie+1
1798-
vbt_st(i,J) = vbt(i,J)
1799-
enddo ; enddo
1800-
endif
1801-
18021792
if (query_averaging_enabled(CS%diag)) then
18031793
if (CS%id_eta_st > 0) call post_data(CS%id_eta_st, eta(isd:ied,jsd:jed), CS%diag)
18041794
if (CS%id_ubt_st > 0) call post_data(CS%id_ubt_st, ubt(IsdB:IedB,jsd:jed), CS%diag)
@@ -2014,13 +2004,13 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
20142004
! symmetric-memory computational domain, not in the wide halo regions.
20152005
if (CS%BT_OBC%u_OBCs_on_PE) then ; do j=js,je ; do I=is-1,ie
20162006
if (CS%BT_OBC%u_OBC_type(I,j) /= 0) then
2017-
u_accel_bt(I,j) = (ubt_wtd(I,j) - ubt_first(I,j)) / dt
2007+
u_accel_bt(I,j) = (ubt_wtd(I,j) - ubt_st(I,j)) / dt
20182008
do k=1,nz ; accel_layer_u(I,j,k) = u_accel_bt(I,j) ; enddo
20192009
endif
20202010
enddo ; enddo ; endif
20212011
if (CS%BT_OBC%v_OBCs_on_PE) then ; do J=js-1,je ; do i=is,ie
20222012
if (CS%BT_OBC%v_OBC_type(i,J) /= 0) then
2023-
v_accel_bt(i,J) = (vbt_wtd(i,J) - vbt_first(i,J)) / dt
2013+
v_accel_bt(i,J) = (vbt_wtd(i,J) - vbt_st(i,J)) / dt
20242014
do k=1,nz ; accel_layer_v(i,J,k) = v_accel_bt(i,J) ; enddo
20252015
endif
20262016
enddo ; enddo ; endif

0 commit comments

Comments
 (0)