Skip to content

Commit

Permalink
Merge branch 'breichl-user/bgr/EPBL_Len' into dev/master
Browse files Browse the repository at this point in the history
  • Loading branch information
adcroft committed Jan 7, 2017
2 parents 982263b + 57d36bd commit 63a59e8
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 94 deletions.
10 changes: 6 additions & 4 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,8 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS)
if (CS%use_energetic_PBL) then
call applyBoundaryFluxesInOut(CS%diabatic_aux_CSp, G, GV, dt, fluxes, CS%optics, &
h, tv, CS%aggregate_FW_forcing, cTKE, dSV_dT, dSV_dS)
call calculateBuoyancyFlux2d(G, GV, fluxes, CS%optics, h, tv%T, tv%S, tv, &
CS%KPP_buoy_flux, CS%KPP_temp_flux, CS%KPP_salt_flux)

if (CS%debug) then
call hchksum(ea, "after applyBoundaryFluxes ea",G%HI,haloshift=0)
Expand All @@ -753,7 +755,7 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS)

call find_uv_at_h(u, v, h, u_h, v_h, G, GV)
call energetic_PBL(h, u_h, v_h, tv, fluxes, dt, Kd_ePBL, G, GV, &
CS%energetic_PBL_CSp, dSV_dT, dSV_dS, cTKE)
CS%energetic_PBL_CSp, dSV_dT, dSV_dS, cTKE, CS%KPP_Buoy_Flux)

! If visc%MLD exists, copy the ePBL's MLD into it
if (associated(visc%MLD)) then
Expand Down Expand Up @@ -2029,13 +2031,13 @@ subroutine diabatic_driver_init(Time, G, GV, param_file, useALEalgorithm, diag,
! CS%useKPP is set to True if KPP-scheme is to be used, False otherwise.
! KPP_init() allocated CS%KPP_Csp and also sets CS%KPPisPassive
CS%useKPP = KPP_init(param_file, G, diag, Time, CS%KPP_CSp, passive=CS%KPPisPassive)
if (CS%useKPP) then
if (CS%useKPP .or. CS%use_energetic_PBL) then
allocate( CS%KPP_NLTheat(isd:ied,jsd:jed,nz+1) ) ; CS%KPP_NLTheat(:,:,:) = 0.
allocate( CS%KPP_NLTscalar(isd:ied,jsd:jed,nz+1) ) ; CS%KPP_NLTscalar(:,:,:) = 0.
allocate( CS%KPP_buoy_flux(isd:ied,jsd:jed,nz+1) ) ; CS%KPP_buoy_flux(:,:,:) = 0.
allocate( CS%KPP_temp_flux(isd:ied,jsd:jed) ) ; CS%KPP_temp_flux(:,:) = 0.
allocate( CS%KPP_salt_flux(isd:ied,jsd:jed) ) ; CS%KPP_salt_flux(:,:) = 0.
endif
endif

call get_param(param_file, mod, "SALT_REJECT_BELOW_ML", CS%salt_reject_below_ML, &
"If true, place salt from brine rejection below the mixed layer,\n"// &
Expand Down Expand Up @@ -2274,7 +2276,7 @@ subroutine diabatic_driver_end(CS)

call entrain_diffusive_end(CS%entrain_diffusive_CSp)
call set_diffusivity_end(CS%set_diff_CSp)
if (CS%useKPP) then
if (CS%useKPP .or. CS%use_energetic_PBL) then
deallocate( CS%KPP_NLTheat )
deallocate( CS%KPP_NLTscalar )
deallocate( CS%KPP_buoy_flux )
Expand Down
Loading

0 comments on commit 63a59e8

Please sign in to comment.