Skip to content

Commit

Permalink
Check for association of all fw fluxes in bulk forcing
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Sep 25, 2024
1 parent d1febf3 commit 8690ea8
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions components/mpas-ocean/src/shared/mpas_ocn_surface_bulk_forcing.F
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,38 @@ subroutine ocn_surface_bulk_forcing_freshwater_tracers(meshPool, forcingPool, tr
call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux)

nCells = nCellsArray( 3 )
do iCell=1,nCells
if (associated(indexRain)) then
do iCell=1,nCells
freshwaterSurfaceFlux(indexRain, iCell) = rainFlux(iCell) / rho_sw
enddo ! iCell
else
call mpas_log_write('indexRain is not associated')
freshwaterSurfaceFlux(indexRain, :) = 0.0_RKIND
endif
if (associated(indexSnow)) then
do iCell=1,nCells
freshwaterSurfaceFlux(indexSnow, iCell) = snowFlux(iCell) / rho_sw
enddo ! iCell
else
call mpas_log_write('indexSnow is not associated')
freshwaterSurfaceFlux(indexSnow, :) = 0.0_RKIND
endif
if (associated(indexIceRunoff)) then
do iCell=1,nCells
freshwaterSurfaceFluxRunoff(indexIceRunoff, iCell) = iceRunoffFlux(iCell) / rho_sw
enddo ! iCell
else
call mpas_log_write('indexIceRunoff is not associated')
freshwaterSurfaceFlux(indexIceRunoff, :) = 0.0_RKIND
endif
if (associated(indexRiverRunoff)) then
do iCell=1,nCells
freshwaterSurfaceFluxRunoff(indexRiverRunoff, iCell) = riverRunoffFlux(iCell) / rho_sw
enddo ! iCell
enddo ! iCell
else
call mpas_log_write('indexRiverRunoff is not associated')
freshwaterSurfaceFlux(indexRiverRunoff, :) = 0.0_RKIND
endif
if (associated(indexSeaIceFreshWater)) then
do iCell=1,nCells
freshwaterSurfaceFlux(indexSeaIceFreshWater, iCell) = seaIceFreshWaterFlux(iCell) / rho_sw
Expand Down

0 comments on commit 8690ea8

Please sign in to comment.