Skip to content

Commit

Permalink
Dimensional rescaling in MOM_open_boundary.F90
Browse files Browse the repository at this point in the history
  Added rescaling for dimensional consistency testing in MOM_open_boundary.F90,
including splitting variables with different units that had previously shared
the same variable and adding more extensive documentation of variables.  Also
changed the dimensions of the timesteps passed to radiation_open_bdry_conds and
update_segment_tracer_reservoirs to [T] and added vertical_grid_type and
unit_scale_type arguments to open_boundary_init and open_boundary_test_extern_h.
All answers are bitwise identical, although some probably bugs have been noted
in comments and there are new or altered arguments to several routines.
  • Loading branch information
Hallberg-NOAA committed Nov 25, 2019
1 parent ba45244 commit aaa58ca
Show file tree
Hide file tree
Showing 4 changed files with 469 additions and 391 deletions.
4 changes: 2 additions & 2 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ subroutine step_MOM_tracer_dyn(CS, G, GV, US, h, Time_local)
CS%tracer_diff_CSp, CS%tracer_Reg, CS%tv)
if (showCallTree) call callTree_waypoint("finished tracer advection/diffusion (step_MOM)")
call update_segment_tracer_reservoirs(G, GV, CS%uhtr, CS%vhtr, h, CS%OBC, &
US%T_to_s*CS%t_dyn_rel_adv, CS%tracer_Reg)
CS%t_dyn_rel_adv, CS%tracer_Reg)
call cpu_clock_end(id_clock_tracer) ; call cpu_clock_end(id_clock_thermo)

call cpu_clock_begin(id_clock_other) ; call cpu_clock_begin(id_clock_diagnostics)
Expand Down Expand Up @@ -1277,7 +1277,7 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
else ! complement of "if (.not.CS%adiabatic)"

call cpu_clock_begin(id_clock_adiabatic)
call adiabatic(h, tv, fluxes, US%T_to_s*dtdia, G, GV, US, CS%diabatic_CSp)
call adiabatic(h, tv, fluxes, dtdia, G, GV, US, CS%diabatic_CSp)
fluxes%fluxes_used = .true.
call cpu_clock_end(id_clock_adiabatic)

Expand Down
8 changes: 4 additions & 4 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
endif

if (associated(CS%OBC)) then
if (CS%debug_OBC) call open_boundary_test_extern_h(G, CS%OBC, h)
if (CS%debug_OBC) call open_boundary_test_extern_h(G, GV, CS%OBC, h)

do k=1,nz ; do j=G%jsd,G%jed ; do I=G%IsdB,G%IedB
u_old_rad_OBC(I,j,k) = u_av(I,j,k)
Expand Down Expand Up @@ -611,7 +611,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
if (CS%debug) &
call uvchksum("Pre OBC avg [uv]", u_av, v_av, G%HI, haloshift=1, symmetric=sym, scale=US%L_T_to_m_s)

call radiation_open_bdry_conds(CS%OBC, u_av, u_old_rad_OBC, v_av, v_old_rad_OBC, G, US, US%T_to_s*dt_pred)
call radiation_open_bdry_conds(CS%OBC, u_av, u_old_rad_OBC, v_av, v_old_rad_OBC, G, US, dt_pred)

if (CS%debug) &
call uvchksum("Post OBC avg [uv]", u_av, v_av, G%HI, haloshift=1, symmetric=sym, scale=US%L_T_to_m_s)
Expand Down Expand Up @@ -819,7 +819,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
endif

if (associated(CS%OBC)) then
call radiation_open_bdry_conds(CS%OBC, u, u_old_rad_OBC, v, v_old_rad_OBC, G, US, US%T_to_s*dt)
call radiation_open_bdry_conds(CS%OBC, u, u_old_rad_OBC, v, v_old_rad_OBC, G, US, dt)
endif

! h_av = (h_in + h_out)/2 . Going in to this line, h_av = h_in.
Expand Down Expand Up @@ -1170,7 +1170,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, US, param
elseif ( (US%s_to_T_restart * US%m_to_L_restart /= 0.0) .and. &
((US%m_to_L * US%s_to_T_restart) /= (US%m_to_L_restart * US%s_to_T)) ) then
vel_rescale = (US%m_to_L * US%s_to_T_restart) / (US%m_to_L_restart * US%s_to_T)
do k=1,nz ; do j=jsd,jed ; do I=IsdB,IeDB ; CS%u_av(I,j,k) = vel_rescale * CS%u_av(I,j,k) ; enddo ; enddo ; enddo
do k=1,nz ; do j=jsd,jed ; do I=IsdB,IedB ; CS%u_av(I,j,k) = vel_rescale * CS%u_av(I,j,k) ; enddo ; enddo ; enddo
do k=1,nz ; do J=JsdB,JedB ; do i=isd,ied ; CS%v_av(i,J,k) = vel_rescale * CS%v_av(i,J,k) ; enddo ; enddo ; enddo
endif

Expand Down
Loading

0 comments on commit aaa58ca

Please sign in to comment.