Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cryo terms to coupler budget #74

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion components/mpas-ocean/driver/mpaso_cpl_indices.F
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ module mpaso_cpl_indices
integer :: index_o2x_Faoo_fco2_ocn
integer :: index_o2x_Faoo_fdms_ocn
integer :: index_o2x_So_ssh

integer :: index_o2x_Foxo_ismw
integer :: index_o2x_Foxo_rrofl
integer :: index_o2x_Foxo_rrofi
integer :: index_o2x_Foxo_ismh
integer :: index_o2x_Foxo_rrofih

! ocn -> drv for calculation of ocean-ice sheet interactions

Expand Down Expand Up @@ -188,6 +192,13 @@ subroutine mpaso_cpl_indices_set( )
index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet')
index_o2x_So_ssh = mct_avect_indexra(o2x,'So_ssh')

index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'Foxo_ismw')
index_o2x_Foxo_rrofl = mct_avect_indexra(o2x,'Foxo_rrofl')
index_o2x_Foxo_rrofi = mct_avect_indexra(o2x,'Foxo_rrofi')

index_o2x_Foxo_ismh = mct_avect_indexra(o2x,'Foxo_ismh')
index_o2x_Foxo_rrofih = mct_avect_indexra(o2x,'Foxo_rrofih')

index_o2x_So_blt = mct_avect_indexra(o2x,'So_blt')
index_o2x_So_bls = mct_avect_indexra(o2x,'So_bls')
index_o2x_So_htv = mct_avect_indexra(o2x,'So_htv')
Expand Down
62 changes: 59 additions & 3 deletions components/mpas-ocean/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -2694,7 +2694,12 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
avgOceanSurfaceDOCSemiLabile, &
avgOceanSurfaceFeParticulate, &
avgOceanSurfaceFeDissolved, &
ssh
ssh, &
avgLandIceFreshwaterFlux, &
avgRemovedRiverRunoffFlux, &
avgRemovedIceRunoffFlux, &
avgLandIceHeatFlux, &
avgRemovedIceRunoffHeatFlux

real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, &
avgSSHGradient, avgOceanSurfacePhytoC, &
Expand All @@ -2703,6 +2708,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
real (kind=RKIND) :: surfaceFreezingTemp

logical, pointer :: frazilIceActive, &
config_remove_AIS_coupler_runoff, &
config_use_ecosysTracers, &
config_use_DMSTracers, &
config_use_MacroMoleculesTracers, &
Expand All @@ -2719,6 +2725,7 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
call mpas_pool_get_package(domain % packages, 'frazilIceActive', frazilIceActive)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers', config_use_ecosysTracers)
call mpas_pool_get_config(domain % configs, 'config_land_ice_flux_mode', config_land_ice_flux_mode)
call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff)
call mpas_pool_get_config(domain % configs, 'config_use_DMSTracers', config_use_DMSTracers)
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers', config_use_MacroMoleculesTracers)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers_sea_ice_coupling', &
Expand Down Expand Up @@ -2761,6 +2768,17 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{
call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1)
end if

! Cryo fields
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)
call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux)
endif
if (config_remove_AIS_coupler_runoff) then
call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux)
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux)
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux)
endif

! BGC fields
if (config_use_ecosysTracers) then

Expand Down Expand Up @@ -2812,6 +2830,17 @@ subroutine ocn_export_mct(o2x_o, errorCode) !{{{

o2x_o % rAttr(index_o2x_Faoo_h2otemp, n) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw

! Cryo fields
if (trim(config_land_ice_flux_mode) == 'standalone' .or. trim(config_land_ice_flux_mode) == 'data') then
o2x_o % rAttr(index_o2x_Foxo_ismw, n) = avgLandIceFreshwaterFlux(i)
o2x_o % rAttr(index_o2x_Foxo_ismh, n) = avgLandIceHeatFlux(i)
endif
if (config_remove_AIS_coupler_runoff) then
o2x_o % rAttr(index_o2x_Foxo_rrofl, n) = avgRemovedRiverRunoffFlux(i)
o2x_o % rAttr(index_o2x_Foxo_rrofi, n) = avgRemovedIceRunoffFlux(i)
o2x_o % rAttr(index_o2x_Foxo_rrofih, n) = avgRemovedIceRunoffHeatFlux(i)
endif

if ( frazilIceActive ) then
! negative when frazil ice can be melted
keepFrazil = .true.
Expand Down Expand Up @@ -3975,7 +4004,12 @@ subroutine ocn_export_moab(EClock) !{{{
avgOceanSurfaceDOCSemiLabile, &
avgOceanSurfaceFeParticulate, &
avgOceanSurfaceFeDissolved, &
ssh
ssh, &
avgLandIceFreshwaterFlux, &
avgRemovedRiverRunoffFlux, &
avgRemovedIceRunoffFlux, &
avgLandIceHeatFlux, &
avgRemovedIceRunoffHeatFlux

real (kind=RKIND), dimension(:,:), pointer :: avgTracersSurfaceValue, avgSurfaceVelocity, &
avgSSHGradient, avgOceanSurfacePhytoC, &
Expand All @@ -3984,6 +4018,7 @@ subroutine ocn_export_moab(EClock) !{{{
real (kind=RKIND) :: surfaceFreezingTemp

logical, pointer :: frazilIceActive, &
config_remove_AIS_coupler_runoff, &
config_use_ecosysTracers, &
config_use_DMSTracers, &
config_use_MacroMoleculesTracers, &
Expand All @@ -4000,6 +4035,7 @@ subroutine ocn_export_moab(EClock) !{{{
call mpas_pool_get_package(domain % packages, 'frazilIceActive', frazilIceActive)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers', config_use_ecosysTracers)
call mpas_pool_get_config(domain % configs, 'config_land_ice_flux_mode', config_land_ice_flux_mode)
call mpas_pool_get_config(domain % configs, 'config_remove_AIS_coupler_runoff', config_remove_AIS_coupler_runoff)
call mpas_pool_get_config(domain % configs, 'config_use_DMSTracers', config_use_DMSTracers)
call mpas_pool_get_config(domain % configs, 'config_use_MacroMoleculesTracers', config_use_MacroMoleculesTracers)
call mpas_pool_get_config(domain % configs, 'config_use_ecosysTracers_sea_ice_coupling', &
Expand Down Expand Up @@ -4041,6 +4077,16 @@ subroutine ocn_export_moab(EClock) !{{{
call mpas_pool_get_array(forcingPool, 'frazilSurfacePressure', frazilSurfacePressure)
call mpas_pool_get_array(statePool, 'accumulatedFrazilIceMass', accumulatedFrazilIceMass, 1)
end if

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)
call mpas_pool_get_array(forcingPool, 'avgLandIceHeatFlux', avgLandIceHeatFlux)
endif
if (config_remove_AIS_coupler_runoff) then
call mpas_pool_get_array(forcingPool, 'avgRemovedRiverRunoffFlux', avgRemovedRiverRunoffFlux)
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffFlux', avgRemovedIceRunoffFlux)
call mpas_pool_get_array(forcingPool, 'avgRemovedIceRunoffHeatFlux', avgRemovedIceRunoffHeatFlux)
endif

! BGC fields
if (config_use_ecosysTracers) then
Expand Down Expand Up @@ -4092,7 +4138,17 @@ subroutine ocn_export_moab(EClock) !{{{
o2x_om(n, index_o2x_So_dhdy) = avgSSHGradient(index_avgMeridionalSSHGradient, i)

o2x_om(n, index_o2x_Faoo_h2otemp) = avgTotalFreshWaterTemperatureFlux(i) * rho_sw * cp_sw


if (trim(config_land_ice_flux_mode == 'standalone') .or. trim(config_land_ice_flux_mode) == 'data') then
o2x_om(n, index_o2x_Foxo_ismw) = avgLandIceFreshwaterFlux(i)
o2x_om(n, index_o2x_Foxo_ismh) = avgLandIceHeatFlux(i)
endif
if (config_remove_AIS_coupler_runoff) then
o2x_om(n, index_o2x_Foxo_rrofl) = avgRemovedRiverRunoffFlux(i)
o2x_om(n, index_o2x_Foxo_rrofi) = avgRemovedIceRunoffFlux(i)
o2x_om(n, index_o2x_Foxo_rrofih) = avgRemovedIceRunoffHeatFlux(i)
endif

if ( frazilIceActive ) then
! negative when frazil ice can be melted
keepFrazil = .true.
Expand Down
16 changes: 16 additions & 0 deletions components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3608,6 +3608,7 @@
packages="activeTracersBulkRestoringPKG;thicknessBulkPKG"
/>


<!-- Misc. coupling fields -->
<var name="iceFraction" type="real" dimensions="nCells Time" units="fractional"
description="Fraction of sea ice coverage at cell centers from coupler. Positive into the ocean."
Expand Down Expand Up @@ -3689,6 +3690,21 @@
<var name="avgTotalFreshWaterTemperatureFlux" type="real" dimensions="nCells Time" units="C m s^-1"
description="Sum of heat fluxes associated with water fluxes cell centers sent to coupler. Positive into the ocean."
/>
<var name="avgLandIceFreshwaterFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Time-averaged sum of freshwater fluxes associated with ice shelf basal melt fluxes cell centers sent to coupler. Positive into the ocean."
/>
<var name="avgLandIceHeatFlux" type="real" dimensions="nCells Time" units="W m^-2"
description="Time-averaged sum of heat fluxes associated with ice shelf basal melt fluxes cell centers sent to coupler. Positive into the ocean."
/>
<var name="avgRemovedRiverRunoffFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Time-averaged sum of freshwater fluxes associated with removed liquid runoff fluxes cell centers sent to coupler. Positive into the ocean."
/>
<var name="avgRemovedIceRunoffFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Time-averaged sum of freshwater fluxes associated with removed ice runoff fluxes cell centers sent to coupler. Positive into the ocean."
/>
<var name="avgRemovedIceRunoffHeatFlux" type="real" dimensions="nCells Time" units="W m^-2"
description="Time-averaged sum of heat fluxes associated with removed ice runoff fluxes cell centers sent to coupler. Positive into the ocean."
/>

<!-- Input fields from coupler or initial condition for forcing under land ice -->
<var name="landIceFraction" type="real" dimensions="nCells Time" units="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,43 +129,43 @@
<var name="relativeMassError" type="real" dimensions="Time" units="1"
description="Relative mass conservation error"
/>
<var name="accumulatedRainFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedRainFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from rain from coupler. Positive into the ocean."
/>
<var name="accumulatedSnowFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedSnowFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from snow from coupler. Positive into the ocean."
/>
<var name="accumulatedEvaporationFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedEvaporationFlux" type="real" dimensions="Time" units="kg s^-1"
description="Evaporation flux from coupler. Positive into the ocean."
/>
<var name="accumulatedSeaIceFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedSeaIceFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from sea ice from coupler. Positive into the ocean."
/>
<var name="accumulatedRiverRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedRiverRunoffFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from river runoff from coupler. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="accumulatedIceRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedIceRunoffFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from ice runoff from coupler. Positive into the ocean."
/>
<var name="accumulatedRemovedRiverRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedRemovedRiverRunoffFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from river runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="accumulatedRemovedIceRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedRemovedIceRunoffFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from ice runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
packages="thicknessBulkPKG;activeTracersBulkRestoringPKG"
/>
<var name="accumulatedIcebergFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedIcebergFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from iceberg melt from coupler. Positive into the ocean."
/>
<var name="accumulatedFrazilFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedFrazilFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from frazil freezing under sea ice. Positive into the ocean."
/>
<var name="accumulatedLandIceFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedLandIceFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from land ice melt from coupler. Positive into the ocean."
/>
<var name="accumulatedLandIceFrazilFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
<var name="accumulatedLandIceFrazilFlux" type="real" dimensions="Time" units="kg s^-1"
description="Fresh water flux from frazil freezing under land ice. Positive into the ocean."
/>
</var_struct>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2432,7 +2432,8 @@ subroutine ocn_restart_conservation_check(domain, err)!{{{
err = 0

if ( trim(config_land_ice_flux_mode) == 'standalone' .or. &
trim(config_land_ice_flux_mode) == 'coupled' ) then
trim(config_land_ice_flux_mode) == 'coupled' .or. &
trim(config_land_ice_flux_mode) == 'data' ) then
landIceFreshwaterFluxesOn = .true.
end if

Expand Down
Loading