@@ -967,36 +967,57 @@ subroutine ocn_surface_bulk_forcing_freshwater_tracers(meshPool, forcingPool, tr
967
967
call mpas_pool_get_array(forcingPool, ' landIceFreshwaterFlux' , landIceFreshwaterFlux)
968
968
969
969
nCells = nCellsArray( 3 )
970
- do iCell= 1 ,nCells
970
+ if (associated(indexRain) .and. associated(rainFlux)) then
971
+ do iCell= 1 ,nCells
971
972
freshwaterSurfaceFlux(indexRain, iCell) = rainFlux(iCell) / rho_sw
973
+ enddo ! iCell
974
+ else
975
+ call mpas_log_write(' indexRain is not associated' )
976
+ endif
977
+ if (associated(indexSnow) .and. associated(snowFlux)) then
978
+ do iCell= 1 ,nCells
972
979
freshwaterSurfaceFlux(indexSnow, iCell) = snowFlux(iCell) / rho_sw
980
+ enddo ! iCell
981
+ else
982
+ call mpas_log_write(' indexSnow is not associated' )
983
+ endif
984
+ if (associated(indexIceRunoff) .and. associated(iceRunoffFlux)) then
985
+ do iCell= 1 ,nCells
973
986
freshwaterSurfaceFluxRunoff(indexIceRunoff, iCell) = iceRunoffFlux(iCell) / rho_sw
987
+ enddo ! iCell
988
+ else
989
+ call mpas_log_write(' indexIceRunoff is not associated' )
990
+ endif
991
+ if (associated(indexRiverRunoff) .and. associated(riverRunoffFlux)) then
992
+ do iCell= 1 ,nCells
974
993
freshwaterSurfaceFluxRunoff(indexRiverRunoff, iCell) = riverRunoffFlux(iCell) / rho_sw
975
- enddo ! iCell
976
- if (associated(indexSeaIceFreshWater)) then
994
+ enddo ! iCell
995
+ else
996
+ if (.not. associated(indexRiverRunoff)) call mpas_log_write(' indexRiverRunoff is not associated' )
997
+ if (.not. associated(riverRunoffFlux)) call mpas_log_write(' riverRunoffFlux is not associated' )
998
+ endif
999
+ if (associated(indexSeaIceFreshWater) .and. associated(seaIceFreshWaterFlux)) then
977
1000
do iCell= 1 ,nCells
978
1001
freshwaterSurfaceFlux(indexSeaIceFreshWater, iCell) = seaIceFreshWaterFlux(iCell) / rho_sw
979
1002
enddo ! iCell
980
1003
else
981
1004
call mpas_log_write(' indexSeaIceFreshWater is not associated' )
982
- freshwaterSurfaceFlux(indexSeaIceFreshWater, :) = 0.0_RKIND
983
1005
endif
984
- if (associated(indexIcebergFreshWater)) then
1006
+ if (associated(indexIcebergFreshWater) .and. associated(icebergFreshWaterFlux) ) then
985
1007
do iCell= 1 ,nCells
986
1008
freshwaterSurfaceFlux(indexIcebergFreshWater, iCell) = icebergFreshWaterFlux(iCell) / rho_sw
987
1009
enddo ! iCell
988
1010
else
989
1011
call mpas_log_write(' indexIcebergFreshWater is not associated' )
990
- freshwaterSurfaceFlux(indexIcebergFreshWater, :) = 0.0_RKIND
991
1012
endif
992
1013
if (associated(indexLandIceFreshwater) .and. associated(landIceFreshwaterFlux)) then
993
1014
do iCell= 1 ,nCells
994
1015
freshwaterSurfaceFlux(indexLandIceFreshwater, iCell) = landIceFreshwaterFlux(iCell) / rho_sw
995
1016
enddo ! iCell
996
1017
else
997
1018
call mpas_log_write(' indexLandIceFreshwater or landIceFreshwaterFlux is not associated' )
998
- freshwaterSurfaceFlux(indexLandIceFreshwater, :) = 0.0_RKIND
999
1019
endif
1020
+ call mpas_log_write(' end fw assign sflux' )
1000
1021
1001
1022
end subroutine ocn_surface_bulk_forcing_freshwater_tracers !}}}
1002
1023
0 commit comments