Skip to content

Commit 86e0260

Browse files
committed
Making barotropic fix look symmetric.
1 parent 8ffb6f8 commit 86e0260

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

src/core/MOM.F90

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ module MOM
114114
use MOM_open_boundary, only : register_temp_salt_segments, update_segment_tracer_reservoirs
115115
use MOM_open_boundary, only : open_boundary_register_restarts, remap_OBC_fields
116116
use MOM_open_boundary, only : open_boundary_setup_vert, update_OBC_segment_data
117+
use MOM_open_boundary, only : initialize_segment_data
117118
use MOM_open_boundary, only : rotate_OBC_config, rotate_OBC_init
118119
use MOM_porous_barriers, only : porous_widths_layer, porous_widths_interface, porous_barriers_init
119120
use MOM_porous_barriers, only : porous_barrier_CS
@@ -3025,13 +3026,8 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
30253026
call update_ALE_sponge_field(CS%ALE_sponge_CSp, S_in, G, GV, CS%S)
30263027
endif
30273028

3028-
if (associated(OBC_in)) then
3029+
if (associated(OBC_in)) &
30293030
call rotate_OBC_init(OBC_in, G, GV, US, param_file, CS%tv, restart_CSp, CS%OBC)
3030-
if (CS%OBC%some_need_no_IO_for_data) then
3031-
call calc_derived_thermo(CS%tv, CS%h, G, GV, US)
3032-
call update_OBC_segment_data(G, GV, US, CS%OBC, CS%tv, CS%h, Time)
3033-
endif
3034-
endif
30353031

30363032
deallocate(u_in)
30373033
deallocate(v_in)

src/core/MOM_barotropic.F90

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,16 +2466,33 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
24662466

24672467
! Update factor so that nothing changes outside of the OBC (problem for interior OBCs only)
24682468
if (associated(OBC)) then ; if (OBC%OBC_pe) then
2469-
do j=jsv,jev
2469+
! do j=jsv,jev
2470+
! if (OBC%specified_u_BCs_exist_globally .or. OBC%open_u_BCs_exist_globally) then
2471+
! do i=isv,iev-1 ; if (OBC%segnum_u(I,j) /= OBC_NONE) then
2472+
! if (OBC%segment(OBC%segnum_u(I,j))%direction == OBC_DIRECTION_E) then
2473+
! factor(i+1,j) = 0.0
2474+
! elseif (OBC%segment(OBC%segnum_u(I,j))%direction == OBC_DIRECTION_W) then
2475+
! factor(i,j) = 0.0
2476+
! endif
2477+
! endif ; enddo
2478+
! endif
2479+
do i=isv,iev
24702480
if (OBC%specified_u_BCs_exist_globally .or. OBC%open_u_BCs_exist_globally) then
2471-
do i=isv,iev-1 ; if (OBC%segnum_u(I,j) /= OBC_NONE) then
2472-
if (OBC%segment(OBC%segnum_u(I,j))%direction == OBC_DIRECTION_E) then
2473-
factor(i+1,j) = 0.0
2474-
elseif (OBC%segment(OBC%segnum_u(I,j))%direction == OBC_DIRECTION_W) then
2475-
factor(i,j) = 0.0
2481+
do j=jsv,jev
2482+
if (OBC%segnum_u(I-1,j) /= OBC_NONE) then
2483+
if (OBC%segment(OBC%segnum_u(I-1,j))%direction == OBC_DIRECTION_E) then
2484+
factor(i,j) = 0.0
2485+
endif
2486+
endif
2487+
if (OBC%segnum_u(I,j) /= OBC_NONE) then
2488+
if (OBC%segment(OBC%segnum_u(I,j))%direction == OBC_DIRECTION_W) then
2489+
factor(i,j) = 0.0
2490+
endif
24762491
endif
2477-
endif ; enddo
2492+
enddo
24782493
endif
2494+
enddo
2495+
do j=jsv,jev
24792496
if (OBC%specified_v_BCs_exist_globally .or. OBC%open_v_BCs_exist_globally) then
24802497
do i=isv,iev
24812498
if (OBC%segnum_v(i,J-1) /= OBC_NONE) then

src/core/MOM_open_boundary.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6055,13 +6055,13 @@ subroutine rotate_OBC_init(OBC_in, G, GV, US, param_file, tv, restart_CS, OBC)
60556055
"If true, Temperature and salinity are used as state "//&
60566056
"variables.", default=.true., do_not_log=.true.)
60576057

6058+
if (use_temperature) &
6059+
call fill_temp_salt_segments(G, GV, US, OBC, tv)
6060+
60586061
do l = 1, OBC%number_of_segments
60596062
call rotate_OBC_segment_data(OBC_in%segment(l), OBC%segment(l), G%HI%turns)
60606063
enddo
60616064

6062-
if (use_temperature) &
6063-
call fill_temp_salt_segments(G, GV, US, OBC, tv)
6064-
60656065
call open_boundary_init(G, GV, US, param_file, OBC, restart_CS)
60666066
end subroutine rotate_OBC_init
60676067

0 commit comments

Comments
 (0)