Skip to content

Commit

Permalink
Merge pull request #25 from NOAA-GFDL/dev/gfdl
Browse files Browse the repository at this point in the history
merge in latest dev/gfdl updates
  • Loading branch information
wrongkindofdoctor authored Jul 31, 2019
2 parents 5589d8c + 0c1a1e8 commit 5772083
Show file tree
Hide file tree
Showing 8 changed files with 532 additions and 508 deletions.
912 changes: 464 additions & 448 deletions src/core/MOM_barotropic.F90

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/core/MOM_continuity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module MOM_continuity
use MOM_string_functions, only : uppercase
use MOM_grid, only : ocean_grid_type
use MOM_open_boundary, only : ocean_OBC_type
use MOM_unit_scaling, only : unit_scale_type
use MOM_variables, only : BT_cont_type
use MOM_verticalGrid, only : verticalGrid_type

Expand All @@ -38,7 +39,7 @@ module MOM_continuity

!> Time steps the layer thicknesses, using a monotonically limited, directionally split PPM scheme,
!! based on Lin (1994).
subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, &
subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, US, CS, uhbt, vhbt, OBC, &
visc_rem_u, visc_rem_v, u_cor, v_cor, &
uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, BT_cont)
type(ocean_grid_type), intent(inout) :: G !< Ocean grid structure.
Expand All @@ -58,6 +59,7 @@ subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, &
intent(out) :: vh !< Volume flux through meridional faces =
!! v*h*dx [H m2 s-1 ~> m3 s-1 or kg s-1].
real, intent(in) :: dt !< Time increment [s].
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
type(continuity_CS), pointer :: CS !< Control structure for mom_continuity.
real, dimension(SZIB_(G),SZJ_(G)), &
optional, intent(in) :: uhbt !< The vertically summed volume
Expand Down Expand Up @@ -117,7 +119,7 @@ subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, &
" or neither.")

if (CS%continuity_scheme == PPM_SCHEME) then
call continuity_PPM(u, v, hin, h, uh, vh, dt, G, GV, CS%PPM_CSp, uhbt, vhbt, OBC, &
call continuity_PPM(u, v, hin, h, uh, vh, dt, G, GV, US, CS%PPM_CSp, uhbt, vhbt, OBC, &
visc_rem_u, visc_rem_v, u_cor, v_cor, &
uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, BT_cont)
else
Expand Down
76 changes: 41 additions & 35 deletions src/core/MOM_continuity_PPM.F90

Large diffs are not rendered by default.

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 @@ -518,7 +518,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
! u_accel_bt = layer accelerations due to barotropic solver
if (associated(CS%BT_cont) .or. CS%BT_use_layer_fluxes) then
call cpu_clock_begin(id_clock_continuity)
call continuity(u, v, h, hp, uh_in, vh_in, dt, G, GV, &
call continuity(u, v, h, hp, uh_in, vh_in, dt, G, GV, US, &
CS%continuity_CSp, OBC=CS%OBC, visc_rem_u=CS%visc_rem_u, &
visc_rem_v=CS%visc_rem_v, BT_cont=CS%BT_cont)
call cpu_clock_end(id_clock_continuity)
Expand Down Expand Up @@ -607,7 +607,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
! uh = u_av * h
! hp = h + dt * div . uh
call cpu_clock_begin(id_clock_continuity)
call continuity(up, vp, h, hp, uh, vh, dt, G, GV, CS%continuity_CSp, &
call continuity(up, vp, h, hp, uh, vh, dt, G, GV, US, CS%continuity_CSp, &
CS%uhbt, CS%vhbt, CS%OBC, CS%visc_rem_u, CS%visc_rem_v, &
u_av, v_av, BT_cont=CS%BT_cont)
call cpu_clock_end(id_clock_continuity)
Expand Down Expand Up @@ -811,7 +811,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
! h = h + dt * div . uh
! u_av and v_av adjusted so their mass transports match uhbt and vhbt.
call cpu_clock_begin(id_clock_continuity)
call continuity(u, v, h, h, uh, vh, dt, G, GV, &
call continuity(u, v, h, h, uh, vh, dt, G, GV, US, &
CS%continuity_CSp, CS%uhbt, CS%vhbt, CS%OBC, &
CS%visc_rem_u, CS%visc_rem_v, u_av, v_av)
call cpu_clock_end(id_clock_continuity)
Expand Down Expand Up @@ -1162,7 +1162,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, US, param
if (.not. query_initialized(uh,"uh",restart_CS) .or. &
.not. query_initialized(vh,"vh",restart_CS)) then
h_tmp(:,:,:) = h(:,:,:)
call continuity(u, v, h, h_tmp, uh, vh, dt, G, GV, CS%continuity_CSp, OBC=CS%OBC)
call continuity(u, v, h, h_tmp, uh, vh, dt, G, GV, US, CS%continuity_CSp, OBC=CS%OBC)
call pass_var(h_tmp, G%Domain, clock=id_clock_pass_init)
CS%h_av(:,:,:) = 0.5*(h(:,:,:) + h_tmp(:,:,:))
else
Expand Down
6 changes: 3 additions & 3 deletions src/core/MOM_dynamics_unsplit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ subroutine step_MOM_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, &
! uh = u*h
! hp = h + dt/2 div . uh
call cpu_clock_begin(id_clock_continuity)
call continuity(u, v, h, hp, uh, vh, dt*0.5, G, GV, CS%continuity_CSp, &
call continuity(u, v, h, hp, uh, vh, dt*0.5, G, GV, US, CS%continuity_CSp, &
OBC=CS%OBC)
call cpu_clock_end(id_clock_continuity)
call pass_var(hp, G%Domain, clock=id_clock_pass)
Expand Down Expand Up @@ -356,7 +356,7 @@ subroutine step_MOM_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, &
! h_av = hp + dt/2 div . uh
call cpu_clock_begin(id_clock_continuity)
call continuity(up, vp, hp, h_av, uh, vh, &
(0.5*dt), G, GV, CS%continuity_CSp, OBC=CS%OBC)
(0.5*dt), G, GV, US, CS%continuity_CSp, OBC=CS%OBC)
call cpu_clock_end(id_clock_continuity)
call pass_var(h_av, G%Domain, clock=id_clock_pass)
call pass_vector(uh, vh, G%Domain, clock=id_clock_pass)
Expand Down Expand Up @@ -420,7 +420,7 @@ subroutine step_MOM_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, &
! h = hp + dt/2 div . uh
call cpu_clock_begin(id_clock_continuity)
call continuity(upp, vpp, hp, h, uh, vh, &
(dt*0.5), G, GV, CS%continuity_CSp, OBC=CS%OBC)
(dt*0.5), G, GV, US, CS%continuity_CSp, OBC=CS%OBC)
call cpu_clock_end(id_clock_continuity)
call pass_var(h, G%Domain, clock=id_clock_pass)
call pass_vector(uh, vh, G%Domain, clock=id_clock_pass)
Expand Down
6 changes: 3 additions & 3 deletions src/core/MOM_dynamics_unsplit_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ subroutine step_MOM_dyn_unsplit_RK2(u_in, v_in, h_in, tv, visc, Time_local, dt,
call cpu_clock_begin(id_clock_continuity)
! This is a duplicate calculation of the last continuity from the previous step
! and could/should be optimized out. -AJA
call continuity(u_in, v_in, h_in, hp, uh, vh, dt_pred, G, GV, CS%continuity_CSp, &
call continuity(u_in, v_in, h_in, hp, uh, vh, dt_pred, G, GV, US, CS%continuity_CSp, &
OBC=CS%OBC)
call cpu_clock_end(id_clock_continuity)
call pass_var(hp, G%Domain, clock=id_clock_pass)
Expand Down Expand Up @@ -352,7 +352,7 @@ subroutine step_MOM_dyn_unsplit_RK2(u_in, v_in, h_in, tv, visc, Time_local, dt,
! h_av = h + dt div . uh
call cpu_clock_begin(id_clock_continuity)
call continuity(up, vp, h_in, hp, uh, vh, &
dt, G, GV, CS%continuity_CSp, OBC=CS%OBC)
dt, G, GV, US, CS%continuity_CSp, OBC=CS%OBC)
call cpu_clock_end(id_clock_continuity)
call pass_var(hp, G%Domain, clock=id_clock_pass)
call pass_vector(uh, vh, G%Domain, clock=id_clock_pass)
Expand Down Expand Up @@ -410,7 +410,7 @@ subroutine step_MOM_dyn_unsplit_RK2(u_in, v_in, h_in, tv, visc, Time_local, dt,
! h[n+1] = h[n] + dt div . uh
call cpu_clock_begin(id_clock_continuity)
call continuity(up, vp, h_in, h_in, uh, vh, &
dt, G, GV, CS%continuity_CSp, OBC=CS%OBC)
dt, G, GV, US, CS%continuity_CSp, OBC=CS%OBC)
call cpu_clock_end(id_clock_continuity)
call pass_var(h_in, G%Domain, clock=id_clock_pass)
call pass_vector(uh, vh, G%Domain, clock=id_clock_pass)
Expand Down
24 changes: 12 additions & 12 deletions src/core/MOM_variables.F90
Original file line number Diff line number Diff line change
Expand Up @@ -265,28 +265,28 @@ module MOM_variables
!! and how they will vary as the barotropic velocity is changed.
type, public :: BT_cont_type
real, allocatable :: FA_u_EE(:,:) !< The effective open face area for zonal barotropic transport
!! drawing from locations far to the east [H m ~> m2 or kg m-1].
!! drawing from locations far to the east [H L ~> m2 or kg m-1].
real, allocatable :: FA_u_E0(:,:) !< The effective open face area for zonal barotropic transport
!! drawing from nearby to the east [H m ~> m2 or kg m-1].
!! drawing from nearby to the east [H L ~> m2 or kg m-1].
real, allocatable :: FA_u_W0(:,:) !< The effective open face area for zonal barotropic transport
!! drawing from nearby to the west [H m ~> m2 or kg m-1].
!! drawing from nearby to the west [H L ~> m2 or kg m-1].
real, allocatable :: FA_u_WW(:,:) !< The effective open face area for zonal barotropic transport
!! drawing from locations far to the west [H m ~> m2 or kg m-1].
real, allocatable :: uBT_WW(:,:) !< uBT_WW is the barotropic velocity [m s-1], beyond which the marginal
!! drawing from locations far to the west [H L ~> m2 or kg m-1].
real, allocatable :: uBT_WW(:,:) !< uBT_WW is the barotropic velocity [L T-1 ~> m s-1], beyond which the marginal
!! open face area is FA_u_WW. uBT_WW must be non-negative.
real, allocatable :: uBT_EE(:,:) !< uBT_EE is a barotropic velocity [m s-1], beyond which the marginal
real, allocatable :: uBT_EE(:,:) !< uBT_EE is a barotropic velocity [L T-1 ~> m s-1], beyond which the marginal
!! open face area is FA_u_EE. uBT_EE must be non-positive.
real, allocatable :: FA_v_NN(:,:) !< The effective open face area for meridional barotropic transport
!! drawing from locations far to the north [H m ~> m2 or kg m-1].
!! drawing from locations far to the north [H L ~> m2 or kg m-1].
real, allocatable :: FA_v_N0(:,:) !< The effective open face area for meridional barotropic transport
!! drawing from nearby to the north [H m ~> m2 or kg m-1].
!! drawing from nearby to the north [H L ~> m2 or kg m-1].
real, allocatable :: FA_v_S0(:,:) !< The effective open face area for meridional barotropic transport
!! drawing from nearby to the south [H m ~> m2 or kg m-1].
!! drawing from nearby to the south [H L ~> m2 or kg m-1].
real, allocatable :: FA_v_SS(:,:) !< The effective open face area for meridional barotropic transport
!! drawing from locations far to the south [H m ~> m2 or kg m-1].
real, allocatable :: vBT_SS(:,:) !< vBT_SS is the barotropic velocity, [m s-1], beyond which the marginal
!! drawing from locations far to the south [H L ~> m2 or kg m-1].
real, allocatable :: vBT_SS(:,:) !< vBT_SS is the barotropic velocity, [L T-1 ~> m s-1], beyond which the marginal
!! open face area is FA_v_SS. vBT_SS must be non-negative.
real, allocatable :: vBT_NN(:,:) !< vBT_NN is the barotropic velocity, [m s-1], beyond which the marginal
real, allocatable :: vBT_NN(:,:) !< vBT_NN is the barotropic velocity, [L T-1 ~> m s-1], beyond which the marginal
!! open face area is FA_v_NN. vBT_NN must be non-positive.
real, allocatable :: h_u(:,:,:) !< An effective thickness at zonal faces [H ~> m or kg m-2].
real, allocatable :: h_v(:,:,:) !< An effective thickness at meridional faces [H ~> m or kg m-2].
Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/lateral/MOM_hor_visc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US,
! call pass_var(boundary_mask, G%Domain, complete=.true.)

! Get barotropic velocities and their gradients
call barotropic_get_tav(BT, ubtav, vbtav, G)
call barotropic_get_tav(BT, ubtav, vbtav, G, US)
call pass_vector(ubtav, vbtav, G%Domain)

!#GME# The following loop range should be: do j=js-1,je+1 ; do i=is-1,ie+1
Expand Down

0 comments on commit 5772083

Please sign in to comment.