@@ -351,6 +351,7 @@ module MOM_barotropic
351
351
integer :: id_BTC_vbt_NN = - 1 , id_BTC_vbt_SS = - 1
352
352
integer :: id_BTC_FA_u_rat0 = - 1 , id_BTC_FA_v_rat0 = - 1 , id_BTC_FA_h_rat0 = - 1
353
353
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
354
355
! >@}
355
356
356
357
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,
1680
1681
unscale= GV% m_to_H, scalar_pair= .true. )
1681
1682
call uvchksum(" BT visc_rem_[uv]" , visc_rem_u, visc_rem_v, G% HI, &
1682
1683
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
1683
1698
endif
1684
1699
1685
1700
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,
2098
2113
call post_data(CS% id_BTC_FA_h_rat0, tmp_h, CS% diag)
2099
2114
endif
2100
2115
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)
2101
2121
else
2102
2122
if (CS% id_frhatu1 > 0 ) CS% frhatu1(:,:,:) = CS% frhatu(:,:,:)
2103
2123
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, &
6035
6055
' Barotropic zonal transport difference' , ' m3 s-1' , conversion= GV% H_to_m* US% L_to_m** 2 * US% s_to_T)
6036
6056
CS% id_vhbt0 = register_diag_field(' ocean_model' , ' vhbt0' , diag% axesCv1, Time, &
6037
6057
' 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
6038
6070
6039
6071
if (CS% id_frhatu1 > 0 ) allocate (CS% frhatu1(IsdB:IedB,jsd:jed,nz), source= 0 .)
6040
6072
if (CS% id_frhatv1 > 0 ) allocate (CS% frhatv1(isd:ied,JsdB:JedB,nz), source= 0 .)
0 commit comments