Skip to content

Commit

Permalink
Bug fix (bug #44)
Browse files Browse the repository at this point in the history
Doug Jacobsen points out that MPAS-O differentiates between total number of
vertical levels and active number of vertical levels... so the array
CVmix_vars%Mdiff_iface may have more than CVmix_vars%nlev+1 elements. The
subroutine cvmix_coeffs_kpp_low did not consider the situation where Mdiff_out
was a smaller array than old_Mdiff.
  • Loading branch information
mnlevy1981 committed Sep 25, 2014
1 parent aa73911 commit 9394113
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/shared/cvmix_kpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,13 @@ subroutine cvmix_coeffs_kpp_low(Mdiff_out, Tdiff_out, Sdiff_out, zw, zt, &
interp_type2 = CVmix_kpp_params_in%interp_type2
MatchTechnique = CVmix_kpp_params_in%MatchTechnique

nlev_p1 = size(Mdiff_out)
nlev = nlev_p1 - 1

! Output values should be set to input values
Mdiff_out = old_Mdiff
Tdiff_out = old_Tdiff
Sdiff_out = old_Sdiff
Mdiff_out = old_Mdiff(1:nlev_p1)
Tdiff_out = old_Tdiff(1:nlev_p1)
Sdiff_out = old_Sdiff(1:nlev_p1)

! (1) Column-specific parameters
!
Expand All @@ -609,9 +612,6 @@ subroutine cvmix_coeffs_kpp_low(Mdiff_out, Tdiff_out, Sdiff_out, zw, zt, &
kwup = floor(kOBL_depth)
ktup = nint(kOBL_depth)-1

nlev_p1 = size(zw)
nlev = size(zt)

if (ktup.eq.nlev) then
! OBL_depth between bottom cell center and ocean bottom, assume
! zt(ktup+1) = ocn_bottom (which is zw(nlev+1)
Expand Down

0 comments on commit 9394113

Please sign in to comment.