Skip to content

Commit

Permalink
+Deprecate the use of G%ke, using GV%ke instead
Browse files Browse the repository at this point in the history
  Use GV%ke instead of G%ke everywhere in the MOM6 code to get the number of
layers in a configuration.  This required the addition of new vertical_grid_type
arguments to a number of subroutines, and some unused variables were deleted.
This is one of the final steps in a very long-term project to separate the
vertical and horizontal grid types.  All answers are bitwise identical, but
there are new (non-optional) arguments to 51 subroutines.
  • Loading branch information
Hallberg-NOAA committed Dec 2, 2020
1 parent a8e6a54 commit 4ab93b6
Show file tree
Hide file tree
Showing 94 changed files with 815 additions and 799 deletions.
4 changes: 2 additions & 2 deletions src/ALE/MOM_ALE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ subroutine ALE_offline_inputs(CS, G, GV, h, tv, Reg, uhtr, vhtr, Kd, debug, OBC)
dzRegrid(:,:,:) = 0.0
h_new(:,:,:) = 0.0

if (debug) call MOM_tracer_chkinv("Before ALE_offline_inputs", G, h, Reg%Tr, Reg%ntr)
if (debug) call MOM_tracer_chkinv("Before ALE_offline_inputs", G, GV, h, Reg%Tr, Reg%ntr)

! Build new grid from the Zstar state onto the requested vertical coordinate. The new grid is stored
! in h_new. The old grid is h. Both are needed for the subsequent remapping of variables. Convective
Expand Down Expand Up @@ -526,7 +526,7 @@ subroutine ALE_offline_inputs(CS, G, GV, h, tv, Reg, uhtr, vhtr, Kd, debug, OBC)
call ALE_remap_scalar(CS%remapCS, G, GV, nk, h, tv%T, h_new, tv%T, answers_2018=CS%answers_2018)
call ALE_remap_scalar(CS%remapCS, G, GV, nk, h, tv%S, h_new, tv%S, answers_2018=CS%answers_2018)

if (debug) call MOM_tracer_chkinv("After ALE_offline_inputs", G, h_new, Reg%Tr, Reg%ntr)
if (debug) call MOM_tracer_chkinv("After ALE_offline_inputs", G, GV, h_new, Reg%Tr, Reg%ntr)

! Copy over the new layer thicknesses
do k = 1,nk ; do j = jsc-1,jec+1 ; do i = isc-1,iec+1
Expand Down
18 changes: 9 additions & 9 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
integer :: turns ! Number of quarter turns from input to model indexing

G => CS%G ; G_in => CS%G_in ; GV => CS%GV ; US => CS%US
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
Expand Down Expand Up @@ -982,7 +982,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB

G => CS%G ; GV => CS%GV ; US => CS%US ; IDs => CS%IDs
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
Expand Down Expand Up @@ -1237,7 +1237,7 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
integer :: halo_sz ! The size of a halo where data must be valid.
integer :: i, j, k, is, ie, js, je, nz

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
showCallTree = callTree_showQuery()
if (showCallTree) call callTree_enter("step_MOM_thermo(), MOM.F90")

Expand Down Expand Up @@ -2400,7 +2400,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
endif

if (associated(ALE_sponge_in_CSp)) then
call rotate_ALE_sponge(ALE_sponge_in_CSp, G_in, CS%ALE_sponge_CSp, G, turns, param_file)
call rotate_ALE_sponge(ALE_sponge_in_CSp, G_in, CS%ALE_sponge_CSp, G, GV, turns, param_file)
call update_ALE_sponge_field(CS%ALE_sponge_CSp, T_in, G, GV, CS%T)
call update_ALE_sponge_field(CS%ALE_sponge_CSp, S_in, G, GV, CS%S)
endif
Expand Down Expand Up @@ -2535,8 +2535,8 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
call diag_update_remap_grids(diag)

! Setup the diagnostic grid storage types
call diag_grid_storage_init(CS%diag_pre_sync, G, diag)
call diag_grid_storage_init(CS%diag_pre_dyn, G, diag)
call diag_grid_storage_init(CS%diag_pre_sync, G, GV, diag)
call diag_grid_storage_init(CS%diag_pre_dyn, G, GV, diag)

! Calculate masks for diagnostics arrays in non-native coordinates
! This step has to be done after set_axes_info() because the axes needed
Expand Down Expand Up @@ -2630,7 +2630,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
endif

call tracer_advect_init(Time, G, US, param_file, diag, CS%tracer_adv_CSp)
call tracer_hor_diff_init(Time, G, US, param_file, diag, CS%tv%eqn_of_state, CS%diabatic_CSp, &
call tracer_hor_diff_init(Time, G, GV, US, param_file, diag, CS%tv%eqn_of_state, CS%diabatic_CSp, &
CS%tracer_diff_CSp)

call lock_tracer_registry(CS%tracer_Reg)
Expand Down Expand Up @@ -2748,7 +2748,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &

CS%nstep_tot = 0
if (present(count_calls)) CS%count_calls = count_calls
call MOM_sum_output_init(G_in, US, param_file, dirs%output_directory, &
call MOM_sum_output_init(G_in, GV, US, param_file, dirs%output_directory, &
CS%ntrunc, Time_init, CS%sum_output_CSp)

! Flag whether to save initial conditions in finish_MOM_initialization() or not.
Expand Down Expand Up @@ -3343,7 +3343,7 @@ subroutine extract_surface_state(CS, sfc_state_in)
endif

if (associated(CS%tracer_flow_CSp)) then
call call_tracer_surface_state(sfc_state, h, G, CS%tracer_flow_CSp)
call call_tracer_surface_state(sfc_state, h, G, GV, CS%tracer_flow_CSp)
endif

if (CS%check_bad_sfc_vals) then
Expand Down
17 changes: 9 additions & 8 deletions src/core/MOM_CoriolisAdv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS)
if (.not.associated(CS)) call MOM_error(FATAL, &
"MOM_CoriolisAdv: Module must be initialized before it is used.")
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB ; nz = G%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB ; nz = GV%ke
h_neglect = GV%H_subroundoff
eps_vel = 1.0e-10*US%m_s_to_L_T
h_tiny = GV%Angstrom_H ! Perhaps this should be set to h_neglect instead.
Expand Down Expand Up @@ -580,7 +580,7 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS)
endif

! Calculate KE and the gradient of KE
call gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, US, CS)
call gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, GV, US, CS)

! Calculate the tendencies of zonal velocity due to the Coriolis
! force and momentum advection. On a Cartesian grid, this is
Expand Down Expand Up @@ -848,15 +848,15 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS)
! 3D diagnostics hf_gKEu etc. are commented because there is no clarity on proper remapping grid option.
! The code is retained for degugging purposes in the future.
!if (CS%id_hf_gKEu > 0) then
! allocate(hf_gKEu(G%IsdB:G%IedB,G%jsd:G%jed,G%ke))
! allocate(hf_gKEu(G%IsdB:G%IedB,G%jsd:G%jed,GV%ke))
! do k=1,nz ; do j=js,je ; do I=Isq,Ieq
! hf_gKEu(I,j,k) = AD%gradKEu(I,j,k) * AD%diag_hfrac_u(I,j,k)
! enddo ; enddo ; enddo
! call post_data(CS%id_hf_gKEu, hf_gKEu, CS%diag)
!endif

!if (CS%id_hf_gKEv > 0) then
! allocate(hf_gKEv(G%isd:G%ied,G%JsdB:G%JedB,G%ke))
! allocate(hf_gKEv(G%isd:G%ied,G%JsdB:G%JedB,GV%ke))
! do k=1,nz ; do J=Jsq,Jeq ; do i=is,ie
! hf_gKEv(i,J,k) = AD%gradKEv(i,J,k) * AD%diag_hfrac_v(i,J,k)
! enddo ; enddo ; enddo
Expand Down Expand Up @@ -884,15 +884,15 @@ subroutine CorAdCalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS)
endif

!if (CS%id_hf_rvxv > 0) then
! allocate(hf_rvxv(G%IsdB:G%IedB,G%jsd:G%jed,G%ke))
! allocate(hf_rvxv(G%IsdB:G%IedB,G%jsd:G%jed,GV%ke))
! do k=1,nz ; do j=js,je ; do I=Isq,Ieq
! hf_rvxv(I,j,k) = AD%rv_x_v(I,j,k) * AD%diag_hfrac_u(I,j,k)
! enddo ; enddo ; enddo
! call post_data(CS%id_hf_rvxv, hf_rvxv, CS%diag)
!endif

!if (CS%id_hf_rvxu > 0) then
! allocate(hf_rvxu(G%isd:G%ied,G%JsdB:G%JedB,G%ke))
! allocate(hf_rvxu(G%isd:G%ied,G%JsdB:G%JedB,GV%ke))
! do k=1,nz ; do J=Jsq,Jeq ; do i=is,ie
! hf_rvxu(i,J,k) = AD%rv_x_u(i,J,k) * AD%diag_hfrac_v(i,J,k)
! enddo ; enddo ; enddo
Expand Down Expand Up @@ -924,8 +924,9 @@ end subroutine CorAdCalc


!> Calculates the acceleration due to the gradient of kinetic energy.
subroutine gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, US, CS)
subroutine gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, GV, US, CS)
type(ocean_grid_type), intent(in) :: G !< Ocen grid structure
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: u !< Zonal velocity [L T-1 ~> m s-1]
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v !< Meridional velocity [L T-1 ~> m s-1]
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2]
Expand All @@ -944,7 +945,7 @@ subroutine gradKE(u, v, h, KE, KEx, KEy, k, OBC, G, US, CS)
real :: um2a, up2a, vm2a, vp2a ! Temporary variables [L4 T-2 ~> m4 s-2].
integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, n

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB


Expand Down
4 changes: 2 additions & 2 deletions src/core/MOM_PressureForce_FV.F90
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ subroutine PressureForce_FV_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_
integer, dimension(2) :: EOSdom ! The i-computational domain for the equation of state
integer :: i, j, k

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
nkmb=GV%nk_rho_varies
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
EOSdom(1) = Isq - (G%isd-1) ; EOSdom(2) = G%iec+1 - (G%isd-1)
Expand Down Expand Up @@ -490,7 +490,7 @@ subroutine PressureForce_FV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp, p_atm
integer :: is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, nkmb
integer :: i, j, k

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
nkmb=GV%nk_rho_varies
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
EOSdom(1) = Isq - (G%isd-1) ; EOSdom(2) = G%iec+1 - (G%isd-1)
Expand Down
12 changes: 6 additions & 6 deletions src/core/MOM_PressureForce_Montgomery.F90
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ subroutine PressureForce_Mont_nonBouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pb
integer, dimension(2) :: EOSdom ! The computational domain for the equation of state
integer :: is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, nkmb
integer :: i, j, k
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
nkmb=GV%nk_rho_varies
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
EOSdom(1) = Isq - (G%isd-1) ; EOSdom(2) = G%iec+1 - (G%isd-1)
Expand Down Expand Up @@ -415,7 +415,7 @@ subroutine PressureForce_Mont_Bouss(h, tv, PFu, PFv, G, GV, US, CS, p_atm, pbce,
integer :: is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, nkmb
integer :: i, j, k

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
nkmb=GV%nk_rho_varies
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
EOSdom(1) = Isq - (G%isd-1) ; EOSdom(2) = G%iec+1 - (G%isd-1)
Expand Down Expand Up @@ -638,7 +638,7 @@ subroutine Set_pbce_Bouss(e, tv, G, GV, US, Rho0, GFS_scale, pbce, rho_star)
integer, dimension(2) :: EOSdom ! The computational domain for the equation of state
integer :: Isq, Ieq, Jsq, Jeq, nz, i, j, k

Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB ; nz = G%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB ; nz = GV%ke
EOSdom(1) = Isq - (G%isd-1) ; EOSdom(2) = G%iec+1 - (G%isd-1)

Rho0xG = Rho0 * GV%g_Earth
Expand Down Expand Up @@ -740,7 +740,7 @@ subroutine Set_pbce_nonBouss(p, tv, G, GV, US, GFS_scale, pbce, alpha_star)
integer, dimension(2) :: EOSdom ! The computational domain for the equation of state
integer :: Isq, Ieq, Jsq, Jeq, nz, i, j, k

Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB ; nz = G%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB ; nz = GV%ke
EOSdom(1) = Isq - (G%isd-1) ; EOSdom(2) = G%iec+1 - (G%isd-1)

use_EOS = associated(tv%eqn_of_state)
Expand Down Expand Up @@ -864,11 +864,11 @@ subroutine PressureForce_Mont_init(Time, G, GV, US, param_file, diag, CS, tides_
CS%id_PFv_bc = register_diag_field('ocean_model', 'PFv_bc', diag%axesCvL, Time, &
'Density Gradient Meridional Pressure Force Accel.', "meter second-2", conversion=US%L_T2_to_m_s2)
if (CS%id_PFu_bc > 0) then
call safe_alloc_ptr(CS%PFu_bc,G%IsdB,G%IedB,G%jsd,G%jed,G%ke)
call safe_alloc_ptr(CS%PFu_bc,G%IsdB,G%IedB,G%jsd,G%jed,GV%ke)
CS%PFu_bc(:,:,:) = 0.0
endif
if (CS%id_PFv_bc > 0) then
call safe_alloc_ptr(CS%PFv_bc,G%isd,G%ied,G%JsdB,G%JedB,G%ke)
call safe_alloc_ptr(CS%PFv_bc,G%isd,G%ied,G%JsdB,G%JedB,GV%ke)
CS%PFv_bc(:,:,:) = 0.0
endif
endif
Expand Down
16 changes: 8 additions & 8 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
if (.not.associated(CS)) call MOM_error(FATAL, &
"btstep: Module MOM_barotropic must be initialized before it is used.")
if (.not.CS%split) return
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
Expand Down Expand Up @@ -2696,7 +2696,7 @@ subroutine set_dtbt(G, GV, US, CS, eta, pbce, BT_cont, gtot_est, SSH_add)
if (.not.associated(CS)) call MOM_error(FATAL, &
"set_dtbt: Module MOM_barotropic must be initialized before it is used.")
if (.not.CS%split) return
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
MS%isdw = G%isd ; MS%iedw = G%ied ; MS%jsdw = G%jsd ; MS%jedw = G%jed

if (.not.(present(pbce) .or. present(gtot_est))) call MOM_error(FATAL, &
Expand Down Expand Up @@ -3006,7 +3006,7 @@ subroutine set_up_BT_OBC(OBC, eta, BT_OBC, BT_Domain, G, GV, US, MS, halo, use_B
type(OBC_segment_type), pointer :: segment !< Open boundary segment

is = G%isc-halo ; ie = G%iec+halo ; js = G%jsc-halo ; je = G%jec+halo
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed ; nz = G%ke
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed ; nz = GV%ke
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
isdw = MS%isdw ; iedw = MS%iedw ; jsdw = MS%jsdw ; jedw = MS%jedw

Expand Down Expand Up @@ -3249,7 +3249,7 @@ subroutine btcalc(h, G, GV, CS, h_u, h_v, may_use_default, OBC)
apply_OBCs = (OBC%number_of_segments > 0)
endif ; endif ; endif

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
h_neglect = GV%H_subroundoff

Expand Down Expand Up @@ -4168,7 +4168,7 @@ subroutine bt_mass_source(h, eta, set_cor, G, GV, CS)
"Module MOM_barotropic must be initialized before it is used.")
if (.not.CS%split) return

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke

!$OMP parallel do default(shared) private(eta_h,h_tot,d_eta)
do j=js,je
Expand Down Expand Up @@ -4271,7 +4271,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
integer :: wd_halos(2), bt_halo_sz
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB
MS%isdw = G%isd ; MS%iedw = G%ied ; MS%jsdw = G%jsd ; MS%jedw = G%jed

Expand Down Expand Up @@ -4580,7 +4580,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
call do_group_pass(pass_a_polarity, CS%BT_domain)

if (use_BT_cont_type) &
call alloc_BT_cont_type(BT_cont, G, (CS%hvel_scheme == FROM_BT_CONT))
call alloc_BT_cont_type(BT_cont, G, GV, (CS%hvel_scheme == FROM_BT_CONT))

if (CS%debug) then ! Make a local copy of loop ranges for chksum calls
allocate(CS%debug_BT_HI)
Expand Down Expand Up @@ -4698,7 +4698,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,

! Estimate the maximum stable barotropic time step.
gtot_estimate = 0.0
do k=1,G%ke ; gtot_estimate = gtot_estimate + GV%g_prime(K) ; enddo
do k=1,GV%ke ; gtot_estimate = gtot_estimate + GV%g_prime(K) ; enddo
call set_dtbt(G, GV, US, CS, gtot_est=gtot_estimate, SSH_add=SSH_extra)

if (dtbt_input > 0.0) then
Expand Down
22 changes: 4 additions & 18 deletions src/core/MOM_boundary_update.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module MOM_boundary_update
use MOM_open_boundary, only : OBC_registry_type, file_OBC_CS
use MOM_open_boundary, only : register_file_OBC, file_OBC_end
use MOM_unit_scaling, only : unit_scale_type
use MOM_verticalGrid, only : verticalGrid_type
use MOM_tracer_registry, only : tracer_registry_type
use MOM_variables, only : thermo_var_ptrs
use MOM_verticalGrid, only : verticalGrid_type
use tidal_bay_initialization, only : tidal_bay_set_OBC_data, register_tidal_bay_OBC
use tidal_bay_initialization, only : tidal_bay_OBC_end, tidal_bay_OBC_CS
use Kelvin_initialization, only : Kelvin_set_OBC_data, register_Kelvin_OBC
Expand Down Expand Up @@ -120,31 +120,17 @@ subroutine update_OBC_data(OBC, G, GV, US, tv, h, CS, Time)
type(update_OBC_CS), pointer :: CS !< Control structure for OBCs
type(time_type), intent(in) :: Time !< Model time

! Local variables
logical :: read_OBC_eta = .false.
logical :: read_OBC_uv = .false.
logical :: read_OBC_TS = .false.
integer :: i, j, k, itt, is, ie, js, je, isd, ied, jsd, jed, nz
integer :: isd_off, jsd_off
integer :: IsdB, IedB, JsdB, JedB
character(len=40) :: mdl = "update_OBC_data" ! This subroutine's name.
character(len=200) :: filename, OBC_file, inputdir ! Strings for file/path

is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = G%ke
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB

! Something here... with CS%file_OBC_CSp?
! if (CS%use_files) &
! call update_OBC_segment_data(G, GV, OBC, tv, h, Time)
if (CS%use_tidal_bay) &
call tidal_bay_set_OBC_data(OBC, CS%tidal_bay_OBC_CSp, G, h, Time)
call tidal_bay_set_OBC_data(OBC, CS%tidal_bay_OBC_CSp, G, GV, h, Time)
if (CS%use_Kelvin) &
call Kelvin_set_OBC_data(OBC, CS%Kelvin_OBC_CSp, G, GV, US, h, Time)
if (CS%use_shelfwave) &
call shelfwave_set_OBC_data(OBC, CS%shelfwave_OBC_CSp, G, h, Time)
call shelfwave_set_OBC_data(OBC, CS%shelfwave_OBC_CSp, G, GV, h, Time)
if (CS%use_dyed_channel) &
call dyed_channel_update_flow(OBC, CS%dyed_channel_OBC_CSp, G, Time)
call dyed_channel_update_flow(OBC, CS%dyed_channel_OBC_CSp, G, GV, Time)
if (OBC%needs_IO_for_data .or. OBC%add_tide_constituents) &
call update_OBC_segment_data(G, GV, US, OBC, tv, h, Time)

Expand Down
Loading

0 comments on commit 4ab93b6

Please sign in to comment.