Skip to content

Commit

Permalink
Fixes bug in nonlocal tend for brine
Browse files Browse the repository at this point in the history
  • Loading branch information
vanroekel committed Nov 24, 2024
1 parent be5c95a commit a0ee5d8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ subroutine ocn_brine_rejection_tendency(tend, layerThickness, seaIceSalinityFlux
do iCell = 1, nCells
if (seaIceSalinityFlux(iCell) > 0) then !only compute for salinity into ocean
!this is set to 1 such that across the BLD we don't have a huge salt flux divergence.
sis_flux(:) = 1.0_RKIND
sis_flux(:) = 1.0_RKIND*seaIceSalinityFlux(iCell)
D = boundaryLayerDepth(iCell)
z = 0.0_RKIND
A = (config_brine_param_n + 1) / D**(config_brine_param_n+1)
k = minLevelCell(iCell)
! need a salinity flux top and bottom and the flux into a cell is the divergence??
do while (z < D)
sis_flux(k) = A*z**config_brine_param_n*seaIceSalinityFlux(iCell)
sis_flux(k) = min(1.0_RKIND,A*z**config_brine_param_n)*seaIceSalinityFlux(iCell)
z = z + layerThickness(k,iCell)
k = k + 1
end do
! need to pick up the last bit that goes over
sis_flux(k) = 1.0_RKIND ! this should finish
sis_flux(k) = 1.0_RKIND*seaIceSalinityFlux(iCell) ! this should finish
do k=minLevelCell(iCell),maxLevelCell(iCell)
! need to flip over so we take k+1 - k
Expand Down

0 comments on commit a0ee5d8

Please sign in to comment.