Skip to content

Commit

Permalink
move pass_var in KPP smoothing outside the do-loop
Browse files Browse the repository at this point in the history
  • Loading branch information
alperaltuntas committed Apr 17, 2020
1 parent 3dd70fe commit 49ab54a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/parameterizations/vertical/MOM_CVMix_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ logical function KPP_init(paramFile, G, GV, US, diag, Time, CS, passive, Waves)
'The number of times the 1-1-4-1-1 Laplacian filter is applied on '// &
'OBL depth.', &
default=0)
if ((CS%n_smooth > G%domain%nihalo) then
call MOM_error(FATAL,'KPP smoothing number (N_SMOOTH) cannot be greater than NIHALO.')
elseif ((CS%n_smooth > G%domain%njhalo) then
call MOM_error(FATAL,'KPP smoothing number (N_SMOOTH) cannot be greater than NJHALO.')
endif
if (CS%n_smooth > 0) then
call get_param(paramFile, mdl, 'DEEPEN_ONLY_VIA_SMOOTHING', CS%deepen_only, &
'If true, apply OBLdepth smoothing at a cell only if the OBLdepth '// &
Expand Down Expand Up @@ -1362,10 +1367,10 @@ subroutine KPP_smooth_BLD(CS,G,GV,h)
real :: pref
integer :: i, j, k, s

do s=1,CS%n_smooth
! Update halos
call pass_var(CS%OBLdepth, G%Domain, halo=CS%n_smooth)

! Update halos
call pass_var(CS%OBLdepth, G%Domain)
do s=1,CS%n_smooth

OBLdepth_original = CS%OBLdepth
if (CS%id_OBLdepth_original > 0) CS%OBLdepth_original = OBLdepth_original
Expand Down

0 comments on commit 49ab54a

Please sign in to comment.