Skip to content

Commit

Permalink
Adds bug fix in net_FW reported by travissluka
Browse files Browse the repository at this point in the history
See following PR:
NOAA-GFDL#664

Some of the code in ocn_comp_mct was copied from MOM_surface_forcing. Therefore this bug also affects dev/ncar. Since dev/ncar does not use MOM_surface_forcing, this fix should also be applied in ocn_comp_mct.
  • Loading branch information
gustavo-marques committed Nov 28, 2017
1 parent f5f2166 commit 36be39a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2198,15 +2198,15 @@ subroutine ocn_import(forces, fluxes, Time, G, CS, state, x2o_o, ind, sw_decomp,
! is constant.
! To do this correctly we will need a sea-ice melt field added to IOB. -AJA
if (ASSOCIATED(fluxes%salt_flux) .and. (CS%ice_salt_concentration>0.0)) &
net_FW(i,j) = net_FW(i,j) - G%areaT(i,j) * &
net_FW(i,j) = net_FW(i,j) + G%areaT(i,j) * &
(fluxes%salt_flux(i,j) / CS%ice_salt_concentration)
net_FW2(i,j) = net_FW(i,j)
net_FW2(i,j) = net_FW(i,j)/G%areaT(i,j)
enddo ; enddo

if (CS%adjust_net_fresh_water_by_scaling) then
call adjust_area_mean_to_zero(net_FW2, G, fluxes%netFWGlobalScl)
do j=js,je ; do i=is,ie
fluxes%vprec(i,j) = fluxes%vprec(i,j) + (net_FW2(i,j) - net_FW(i,j)) * G%mask2dT(i,j)
fluxes%vprec(i,j) = fluxes%vprec(i,j) + (net_FW2(i,j) - net_FW(i,j)/G%areaT(i,j)) * G%mask2dT(i,j)
enddo; enddo
else
fluxes%netFWGlobalAdj = reproducing_sum(net_FW(:,:), isr, ier, jsr, jer) / CS%area_surf
Expand Down

0 comments on commit 36be39a

Please sign in to comment.