Skip to content

Commit c458e2b

Browse files
committed
+Add SSH_u_OBC and ubt_OBC diagnostics
Added 4 new diagnostics (SSH_u_OBC, SSH_v_OBC, ubt_OBC and vbt_OBC) to diagnose the outer barotropic forcing forcing fields at Flather open boundary condition points. Also added 4 paired checksum calls for 8 OBC-related 2d arrays when OBCs are in use and DEBUG is true. All answers are bitwise identical but there are new diagnostics in the available_diags files.
1 parent dcc88ef commit c458e2b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/core/MOM_barotropic.F90

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ module MOM_barotropic
351351
integer :: id_BTC_vbt_NN = -1, id_BTC_vbt_SS = -1
352352
integer :: id_BTC_FA_u_rat0 = -1, id_BTC_FA_v_rat0 = -1, id_BTC_FA_h_rat0 = -1
353353
integer :: id_uhbt0 = -1, id_vhbt0 = -1
354+
integer :: id_SSH_u_OBC = -1, id_SSH_v_OBC = -1, id_ubt_OBC = -1, id_vbt_OBC = -1
354355
!>@}
355356

356357
end type barotropic_CS
@@ -1680,6 +1681,20 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
16801681
unscale=GV%m_to_H, scalar_pair=.true.)
16811682
call uvchksum("BT visc_rem_[uv]", visc_rem_u, visc_rem_v, G%HI, &
16821683
haloshift=1, scalar_pair=.true.)
1684+
1685+
if (apply_OBCs) then
1686+
call uvchksum("BT_OBC%[uv]bt_outer", CS%BT_OBC%ubt_outer, CS%BT_OBC%vbt_outer, CS%debug_BT_HI, &
1687+
symmetric=.true., omit_corners=.true., unscale=US%L_T_to_m_s)
1688+
if (allocated(CS%BT_OBC%SSH_outer_u) .and. allocated(CS%BT_OBC%SSH_outer_v)) &
1689+
call uvchksum("BT_OBC%SSH_outer[uv]", CS%BT_OBC%SSH_outer_u, CS%BT_OBC%SSH_outer_v, CS%debug_BT_HI, &
1690+
symmetric=.true., omit_corners=.true., unscale=US%Z_to_m, scalar_pair=.true.)
1691+
if (allocated(CS%BT_OBC%Cg_u) .and. allocated(CS%BT_OBC%Cg_v)) &
1692+
call uvchksum("BT_OBC%Cg_[uv]", CS%BT_OBC%Cg_u, CS%BT_OBC%Cg_v, CS%debug_BT_HI, &
1693+
symmetric=.true., omit_corners=.true., unscale=US%L_T_to_m_s, scalar_pair=.true.)
1694+
if (allocated(CS%BT_OBC%dZ_u) .and. allocated(CS%BT_OBC%dZ_v)) &
1695+
call uvchksum("BT_OBC%dZ_[uv]", CS%BT_OBC%dZ_u, CS%BT_OBC%dZ_v, CS%debug_BT_HI, &
1696+
symmetric=.true., omit_corners=.true., unscale=US%Z_to_m, scalar_pair=.true.)
1697+
endif
16831698
endif
16841699

16851700
if (CS%id_ubtdt > 0) then
@@ -2098,6 +2113,11 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
20982113
call post_data(CS%id_BTC_FA_h_rat0, tmp_h, CS%diag)
20992114
endif
21002115
endif
2116+
2117+
if (CS%id_SSH_u_OBC > 0) call post_data(CS%id_SSH_u_OBC, CS%BT_OBC%SSH_outer_u(IsdB:IedB,jsd:jed), CS%diag)
2118+
if (CS%id_SSH_v_OBC > 0) call post_data(CS%id_SSH_v_OBC, CS%BT_OBC%SSH_outer_v(isd:ied,JsdB:JedB), CS%diag)
2119+
if (CS%id_ubt_OBC > 0) call post_data(CS%id_ubt_OBC, CS%BT_OBC%ubt_outer(IsdB:IedB,jsd:jed), CS%diag)
2120+
if (CS%id_vbt_OBC > 0) call post_data(CS%id_vbt_OBC, CS%BT_OBC%vbt_outer(isd:ied,JsdB:JedB), CS%diag)
21012121
else
21022122
if (CS%id_frhatu1 > 0) CS%frhatu1(:,:,:) = CS%frhatu(:,:,:)
21032123
if (CS%id_frhatv1 > 0) CS%frhatv1(:,:,:) = CS%frhatv(:,:,:)
@@ -6035,6 +6055,18 @@ subroutine barotropic_init(u, v, h, Time, G, GV, US, param_file, diag, CS, &
60356055
'Barotropic zonal transport difference', 'm3 s-1', conversion=GV%H_to_m*US%L_to_m**2*US%s_to_T)
60366056
CS%id_vhbt0 = register_diag_field('ocean_model', 'vhbt0', diag%axesCv1, Time, &
60376057
'Barotropic meridional transport difference', 'm3 s-1', conversion=GV%H_to_m*US%L_to_m**2*US%s_to_T)
6058+
if (associated(OBC)) then
6059+
if (OBC%Flather_u_BCs_exist_globally .or. OBC%Flather_v_BCs_exist_globally) then
6060+
CS%id_SSH_u_OBC = register_diag_field('ocean_model', 'SSH_u_OBC', diag%axesCu1, Time, &
6061+
'Outer sea surface height at u OBC points', 'm', conversion=US%Z_to_m)
6062+
CS%id_SSH_v_OBC = register_diag_field('ocean_model', 'SSH_v_OBC', diag%axesCv1, Time, &
6063+
'Outer sea surface height at v OBC points', 'm', conversion=US%Z_to_m)
6064+
CS%id_ubt_OBC = register_diag_field('ocean_model', 'ubt_OBC', diag%axesCu1, Time, &
6065+
'Outer u velocity at OBC points', 'm', conversion=US%L_T_to_m_s)
6066+
CS%id_vbt_OBC = register_diag_field('ocean_model', 'vbt_OBC', diag%axesCv1, Time, &
6067+
'Outer v velocity at OBC points', 'm', conversion=US%L_T_to_m_s)
6068+
endif
6069+
endif
60386070

60396071
if (CS%id_frhatu1 > 0) allocate(CS%frhatu1(IsdB:IedB,jsd:jed,nz), source=0.)
60406072
if (CS%id_frhatv1 > 0) allocate(CS%frhatv1(isd:ied,JsdB:JedB,nz), source=0.)

0 commit comments

Comments
 (0)