diff --git a/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F b/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F index 8840853196db..b714a6a2e091 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F @@ -245,7 +245,7 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel avgLandIceBoundaryLayerTracers, avgLandIceTracerTransferVelocities real (kind=RKIND), dimension(:), pointer :: effectiveDensityInLandIce, avgEffectiveDensityInLandIce, & totalFreshWaterTemperatureFlux, avgTotalFreshWaterTemperatureFlux, & - landIceFreshwaterFlux, avgLandIceFreshwaterFlux, & + landIceFreshwaterFlux, dataLandIceFreshwaterFlux, avgLandIceFreshwaterFlux, & removedRiverRunoffFlux, avgRemovedRiverRunoffFlux, & removedIceRunoffFlux, avgRemovedIceRunoffFlux @@ -347,24 +347,33 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel if(trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then call mpas_pool_get_array(forcingPool, 'avgLandIceFreshwaterFlux', avgLandIceFreshwaterFlux) + ! load prognostic melt rates if(trim(config_land_ice_flux_mode) == 'standalone') then call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) - endif - ! load data melt rates if used - if(trim(config_land_ice_flux_mode) == 'data') then -! call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', landIceFreshwaterFlux) - call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) - endif - - !$omp parallel - !$omp do schedule(runtime) - do iCell = 1, nCells - avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & - + landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) - end do - !$omp end do - !$omp end parallel + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & + + landIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) + end do + !$omp end do + !$omp end parallel + end if + + ! load data melt rates if used + if(trim(config_land_ice_flux_mode) == 'data') then + call mpas_pool_get_array(forcingPool, 'dataLandIceFreshwaterFlux', dataLandIceFreshwaterFlux) + + !$omp parallel + !$omp do schedule(runtime) + do iCell = 1, nCells + avgLandIceFreshwaterFlux(iCell) = ( avgLandIceFreshwaterFlux(iCell) * nAccumulatedCoupled & + + dataLandIceFreshwaterFlux(iCell) ) / ( nAccumulatedCoupled + 1) + end do + !$omp end do + !$omp end parallel + end if end if if (config_remove_AIS_coupler_runoff) then