From a0ee5d8250c2c2f0c343fde2e6db91289f7055b7 Mon Sep 17 00:00:00 2001 From: Luke Van Roekel Date: Sat, 23 Nov 2024 23:27:53 -0600 Subject: [PATCH] Fixes bug in nonlocal tend for brine --- .../mpas-ocean/src/shared/mpas_ocn_tracer_nonlocalflux.F | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/mpas-ocean/src/shared/mpas_ocn_tracer_nonlocalflux.F b/components/mpas-ocean/src/shared/mpas_ocn_tracer_nonlocalflux.F index 55194be6ea9e..43988fbfdc92 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_tracer_nonlocalflux.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_tracer_nonlocalflux.F @@ -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