Skip to content

Commit

Permalink
Adding dt factor to nudging (required).
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Jan 11, 2017
1 parent e791b48 commit fbaa8d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/core/MOM_dynamics_legacy_split.F90
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call radiation_open_bdry_conds(CS%OBC, u_av, u_old_rad_OBC, v_av, &
v_old_rad_OBC, hp, h_old_rad_OBC, G)
v_old_rad_OBC, hp, h_old_rad_OBC, G, dt)
endif

! h_av = (h + hp)/2
Expand Down Expand Up @@ -1005,7 +1005,7 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call radiation_open_bdry_conds(CS%OBC, u, u_old_rad_OBC, v, &
v_old_rad_OBC, h, h_old_rad_OBC, G)
v_old_rad_OBC, h, h_old_rad_OBC, G, dt)
endif

! h_av = (h_in + h_out)/2 . Going in to this line, h_av = h_in.
Expand Down
4 changes: 2 additions & 2 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call radiation_open_bdry_conds(CS%OBC, u_av, u_old_rad_OBC, v_av, &
v_old_rad_OBC, hp, h_old_rad_OBC, G)
v_old_rad_OBC, hp, h_old_rad_OBC, G, dt)
endif

! h_av = (h + hp)/2
Expand Down Expand Up @@ -855,7 +855,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &

if (associated(CS%OBC)) then
call radiation_open_bdry_conds(CS%OBC, u, u_old_rad_OBC, v, &
v_old_rad_OBC, h, h_old_rad_OBC, G)
v_old_rad_OBC, h, h_old_rad_OBC, G, dt)
endif

! h_av = (h_in + h_out)/2 . Going in to this line, h_av = h_in.
Expand Down
11 changes: 6 additions & 5 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ end subroutine open_boundary_impose_land_mask

!> Apply radiation conditions to 3D u,v (,h) at open boundaries
subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, &
h_new, h_old, G)
h_new, h_old, G, dt)
type(ocean_grid_type), intent(inout) :: G !< Ocean grid structure
type(ocean_OBC_type), pointer :: OBC !< Open boundary control structure
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: u_new !< New u values on open boundaries
Expand All @@ -1110,6 +1110,7 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, &
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v_old !< Original unadjusted v
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(inout) :: h_new !< New h values on open boundaries
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h_old !< Original h values
real, intent(in) :: dt !< Appropriate timestep
! Local variables
real, dimension(SZI_(G),SZJ_(G)) :: grad
real :: dhdt, dhdx, dhdy, gamma_u, gamma_h, gamma_v
Expand Down Expand Up @@ -1174,7 +1175,7 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, &
else
tau = OBC%OBC_segment_number(OBC%OBC_segment_u(I,j))%Tnudge_out
endif
u_new(I,j,k) = u_new(I,j,k) + tau*(OBC%u(I,j,k) - u_old(I,j,k))
u_new(I,j,k) = u_new(I,j,k) + dt*tau*(OBC%u(I,j,k) - u_old(I,j,k))
endif
endif

Expand Down Expand Up @@ -1223,7 +1224,7 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, &
else
tau = OBC%OBC_segment_number(OBC%OBC_segment_u(I,j))%Tnudge_out
endif
u_new(I,j,k) = u_new(I,j,k) + tau*(OBC%u(I,j,k) - u_old(I,j,k))
u_new(I,j,k) = u_new(I,j,k) + dt*tau*(OBC%u(I,j,k) - u_old(I,j,k))
endif
endif

Expand Down Expand Up @@ -1328,7 +1329,7 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, &
else
tau = OBC%OBC_segment_number(OBC%OBC_segment_v(i,J))%Tnudge_out
endif
v_new(i,J,k) = v_new(i,J,k) + tau*(OBC%v(i,J,k) - v_old(i,J,k))
v_new(i,J,k) = v_new(i,J,k) + dt*tau*(OBC%v(i,J,k) - v_old(i,J,k))
endif
endif

Expand Down Expand Up @@ -1377,7 +1378,7 @@ subroutine radiation_open_bdry_conds(OBC, u_new, u_old, v_new, v_old, &
else
tau = OBC%OBC_segment_number(OBC%OBC_segment_v(i,J))%Tnudge_out
endif
v_new(i,J,k) = v_new(i,J,k) + tau*(OBC%v(i,J,k) - v_old(i,J,k))
v_new(i,J,k) = v_new(i,J,k) + dt*tau*(OBC%v(i,J,k) - v_old(i,J,k))
endif
endif

Expand Down

0 comments on commit fbaa8d9

Please sign in to comment.