Skip to content

Commit

Permalink
Only initialize some arrays in kappa shear if they are used
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon.reichl authored and brandon.reichl committed Mar 5, 2025
1 parent 9fa3d3d commit 14455e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/parameterizations/vertical/MOM_kappa_shear.F90
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,6 @@ subroutine Calc_kappa_shear_vertex(u_in, v_in, h, T_in, S_in, tv, p_surf, kappa_
if (CS%id_N2_mean>0) diag_N2_mean(:,:,:) = 0.0
if (CS%id_S2_mean>0) diag_S2_mean(:,:,:) = 0.0
kappa_vertex(:,:,:) = 0.0
hweight_ul(:,:,:) = 0.0
hweight_ur(:,:,:) = 0.0
hweight_ll(:,:,:) = 0.0
hweight_lr(:,:,:) = 0.0
h_int_mask(:,:,:) = 0.0

use_temperature = associated(tv%T)

Expand All @@ -537,6 +532,11 @@ subroutine Calc_kappa_shear_vertex(u_in, v_in, h, T_in, S_in, tv, p_surf, kappa_
call thickness_to_dz(h, tv, dz_3d, G, GV, US, halo_size=1)

if (CS%VS_ThicknessMean) then
hweight_ul(:,:,:) = 0.0
hweight_ur(:,:,:) = 0.0
hweight_ll(:,:,:) = 0.0
hweight_lr(:,:,:) = 0.0
h_int_mask(:,:,:) = 0.0
!Loop over halo and pre compute a masked thickness around each interface
! (excluding the top and bottom boundary)
do j=G%jsc-1,G%jec+1; do K=2,nz; do i=G%isc-1,G%iec+1
Expand Down

0 comments on commit 14455e6

Please sign in to comment.