Skip to content

Commit

Permalink
Fix surface layer average for Stokes Most
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Oct 23, 2024
1 parent a8cb1d8 commit 0197ae9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/parameterizations/vertical/MOM_CVMix_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1158,14 +1158,17 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
surfHu = (uE_H(ksfc) + uSbar_SLD) * delH
surfHv = (vE_H(ksfc) + vSbar_SLD) * delH
hTot = delH
do ktmp = 1,ksfc-1 ! if ksfc >=2
delH = h(i,j,ktmp)*GV%H_to_Z
hTot = hTot + delH
surfHtemp = surfHtemp + Temp(i,j,ktmp) * delH
surfHsalt = surfHsalt + Salt(i,j,ktmp) * delH
surfHu = surfHu + (uE_H(ktmp) + uSbar_H(ktmp)) * delH
surfHv = surfHv + (vE_H(ktmp) + vSbar_H(ktmp)) * delH
enddo
! only loop if ksfc >=2
if (ksfc >=2) then
do ktmp = 1,ksfc-1
delH = h(i,j,ktmp)*GV%H_to_Z
hTot = hTot + delH
surfHtemp = surfHtemp + Temp(i,j,ktmp) * delH
surfHsalt = surfHsalt + Salt(i,j,ktmp) * delH
surfHu = surfHu + (uE_H(ktmp) + uSbar_H(ktmp)) * delH
surfHv = surfHv + (vE_H(ktmp) + vSbar_H(ktmp)) * delH
enddo
endif
I_hTot = 1./hTot
surfTemp = surfHtemp * I_hTot
surfSalt = surfHsalt * I_hTot
Expand Down

0 comments on commit 0197ae9

Please sign in to comment.