Skip to content

Commit

Permalink
Merge branch 'irenavankova/ocn/add-frazil-to-iceshelf' (PR #6300)
Browse files Browse the repository at this point in the history
Add frazil to ice-shelf melt rates

New variable frazilIceFreshwaterFlux is introduced to keep track of
frazil ice formation instanatenously (and not only commulatively over
coupling timestep as before)

New variable landIceFreshwaterFluxTotal is introduced to keep track of
total melt rates that includes both interface melt/freeze and frazil ice
formation, so that landIceFreshwaterFluxTotal = landIceFreshwaterFlux
                                              + frazilIceFreshwaterFlux

The changes here affect diagnostics only.

[BFB]
  • Loading branch information
jonbob committed Apr 24, 2024
2 parents 35b65ce + dcb1ad8 commit 56f7f6c
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 10 deletions.
10 changes: 9 additions & 1 deletion components/mpas-ocean/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ def buildnml(case, caseroot, compname):
lines.append(' <var name="maxLevelEdgeBot"/>')
lines.append(' <var name="columnIntegratedSpeed"/>')
lines.append(' <var name="landIceFreshwaterFlux"/>')
lines.append(' <var name="landIceFreshwaterFluxTotal"/>')
lines.append(' <var name="frazilIceFreshwaterFlux"/>')
lines.append(' <var name="landIceHeatFlux"/>')
lines.append(' <var name="heatFluxToLandIce"/>')
if ocn_bgc in ['eco_only', 'eco_and_dms', 'eco_and_macromolecules', 'eco_and_dms_and_macromolecules']:
Expand Down Expand Up @@ -873,7 +875,7 @@ def buildnml(case, caseroot, compname):
lines.append(' <var name="tThreshMLD"/>')
lines.append(' <var name="columnIntegratedSpeed"/>')
lines.append(' <var name="barotropicSpeed"/>')
lines.append(' <var name="landIceFreshwaterFlux"/>')
lines.append(' <var name="landIceFreshwaterFluxTotal"/>')
lines.append(' <var name="pressureAdjustedSSH"/>')
lines.append(' <var name="atmosphericPressure"/>')
if ocn_bgc in ['eco_only', 'eco_and_dms', 'eco_and_macromolecules', 'eco_and_dms_and_macromolecules']:
Expand Down Expand Up @@ -1297,6 +1299,8 @@ def buildnml(case, caseroot, compname):
lines.append(' <var name="boundaryLayerDepth"/>')
lines.append(' <var name="columnIntegratedSpeed"/>')
lines.append(' <var name="landIceFreshwaterFlux"/>')
lines.append(' <var name="landIceFreshwaterFluxTotal"/>')
lines.append(' <var name="frazilIceFreshwaterFlux"/>')
lines.append(' <var name="landIceHeatFlux"/>')
lines.append(' <var name="heatFluxToLandIce"/>')
lines.append(' <var name="landIceFrictionVelocity"/>')
Expand Down Expand Up @@ -1475,6 +1479,8 @@ def buildnml(case, caseroot, compname):
lines.append(' <var name="snowFlux"/>')
lines.append(' <var name="boundaryLayerDepth"/>')
lines.append(' <var name="landIceFreshwaterFlux"/>')
lines.append(' <var name="landIceFreshwaterFluxTotal"/>')
lines.append(' <var name="frazilIceFreshwaterFlux"/>')
lines.append(' <var name="landIceHeatFlux"/>')
lines.append(' <var name="heatFluxToLandIce"/>')
lines.append(' <var name="surfaceBuoyancyForcing"/>')
Expand Down Expand Up @@ -1537,6 +1543,8 @@ def buildnml(case, caseroot, compname):
lines.append(' <var name="snowFlux"/>')
lines.append(' <var name="boundaryLayerDepth"/>')
lines.append(' <var name="landIceFreshwaterFlux"/>')
lines.append(' <var name="landIceFreshwaterFluxTotal"/>')
lines.append(' <var name="frazilIceFreshwaterFlux"/>')
lines.append(' <var name="landIceHeatFlux"/>')
lines.append(' <var name="heatFluxToLandIce"/>')
lines.append(' <var name="surfaceBuoyancyForcing"/>')
Expand Down
7 changes: 2 additions & 5 deletions components/mpas-ocean/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -753,13 +753,12 @@ end subroutine xml_stream_get_attributes
call mpas_pool_get_subpool(block_ptr % structs, 'scratch', scratchPool)

call ocn_forcing_build_fraction_absorbed_array(meshPool, statePool, forcingPool, ierr, 1)
call ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, statePool, ierr)
call mpas_timer_start("land_ice_build_arrays", .false.)
call ocn_surface_land_ice_fluxes_build_arrays(meshPool, forcingPool, scratchPool, &
statePool, err=ierr)
call mpas_timer_stop("land_ice_build_arrays")

call ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, statePool, ierr)

block_ptr => block_ptr % next
end do

Expand Down Expand Up @@ -1095,16 +1094,14 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)!{{{
call mpas_pool_get_subpool(block_ptr % structs, 'scratch', scratchPool)

call ocn_forcing_build_fraction_absorbed_array(meshPool, statePool, forcingPool, ierr, 1)

call ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, statePool, ierr)
call mpas_timer_start("land_ice_build_arrays", .false.)
call ocn_surface_land_ice_fluxes_build_arrays(meshPool, &
forcingPool, scratchPool, statePool, ierr)
call mpas_timer_stop("land_ice_build_arrays")
call ocn_surface_land_ice_fluxes_accumulate_fluxes(meshPool, forcingPool, &
statePool, dt, ierr)

call ocn_frazil_forcing_build_arrays(domain, meshPool, forcingPool, statePool, ierr)

call ocn_eddy_compute_mixed_layer_depth(statePool, forcingPool)
if (config_use_GM .or. config_submesoscale_enable) then
call ocn_eddy_compute_buoyancy_gradient()
Expand Down
10 changes: 9 additions & 1 deletion components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3760,7 +3760,11 @@
/>
</var_array>
<var name="landIceFreshwaterFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Flux of mass through the ocean surface. Positive into ocean."
description="Flux of mass through the ocean surface due to interface melt/freeze. Positive into ocean."
packages="landIceFluxesPKG;dataLandIceFluxesPKG"
/>
<var name="landIceFreshwaterFluxTotal" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Total flux of mass through the ocean surface that includes interface melt freeze and column averaged frazil freeze rate. Positive into ocean."
packages="landIceFluxesPKG;dataLandIceFluxesPKG"
/>
<var name="landIceHeatFlux" type="real" dimensions="nCells Time" units="W m^-2"
Expand Down Expand Up @@ -3859,6 +3863,10 @@
description="surface pressure forcing due to weight of frazil ice"
packages="frazilIce"
/>
<var name="frazilIceFreshwaterFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1"
description="Flux of frazil ice mass through the ocean surface. Negative is defined as mass leaving the ocean."
packages="frazilIce"
/>

<!-- Fields for tidal potential forcing -->
<var name="tidalPotentialEta" type="real" dimensions="nCells Time" units="m"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
<var name="landIceFreshwaterFluxMin" array_group="mins" units="kg m^-2 s^-1"
description="Minimum global value of landIceFreshwaterFlux in ocean cells."
/>
<var name="landIceFreshwaterFluxTotalMin" array_group="mins" units="kg m^-2 s^-1"
description="Minimum global value of landIceFreshwaterFluxTotal in ocean cells."
/>
<var name="accumulatedLandIceMassMin" array_group="mins" units="kg m^-2"
description="Minimum global value of accumulatedLandIceMass in ocean cells."
/>
Expand All @@ -157,6 +160,9 @@
<var name="accumulatedLandIceFrazilMassMin" array_group="mins" units="kg m^-2"
description="Minimum global value of accumulatedLandIceFrazilMass in ocean cells."
/>
<var name="frazilIceFreshwaterFluxMin" array_group="mins" units="kg m^-2"
description="Minimum global value of frazilIceFreshwaterFlux in ocean cells."
/>
</var_array>

<var_array name="maxGlobalStats" type="real" dimensions="Time">
Expand Down Expand Up @@ -247,6 +253,9 @@
<var name="landIceFreshwaterFluxMax" array_group="maxes" units="kg m^-2 s^-1"
description="Maximum global value of landIceFreshwaterFlux in ocean cells."
/>
<var name="landIceFreshwaterFluxTotalMax" array_group="maxes" units="kg m^-2 s^-1"
description="Maximum global value of landIceFreshwaterFluxTotal in ocean cells."
/>
<var name="accumulatedLandIceMassMax" array_group="maxes" units="kg m^-2"
description="Maximum global value of accumulatedLandIceMass in ocean cells."
/>
Expand All @@ -256,6 +265,9 @@
<var name="accumulatedLandIceFrazilMassMax" array_group="maxes" units="kg m^-2"
description="Maximum global value of accumulatedLandIceFrazilMass in ocean cells."
/>
<var name="frazilIceFreshwaterFluxMax" array_group="maxes" units="kg m^-2"
description="Maximum global value of frazilIceFreshwaterFlux in ocean cells."
/>
</var_array>

<var_array name="sumGlobalStats" type="real" dimensions="Time">
Expand Down Expand Up @@ -346,6 +358,9 @@
<var name="landIceFreshwaterFluxSum" array_group="sums" units="kg s^-1"
description="Accumulated global value of landIceFreshwaterFlux in ocean cells."
/>
<var name="landIceFreshwaterFluxTotalSum" array_group="sums" units="kg s^-1"
description="Accumulated global value of landIceFreshwaterFluxTotal in ocean cells."
/>
<var name="accumulatedLandIceMassSum" array_group="sums" units="kg"
description="Accumulated global value of accumulatedLandIceMass in ocean cells."
/>
Expand All @@ -355,6 +370,9 @@
<var name="accumulatedLandIceFrazilMassSum" array_group="sums" units="kg"
description="Accumulated global value of accumulatedLandIceFrazilMass in ocean cells."
/>
<var name="frazilIceFreshwaterFluxSum" array_group="sums" units="kg"
description="Accumulated global value of frazilIceFreshwaterFlux in ocean cells."
/>
</var_array>

<var_array name="rmsGlobalStats" type="real" dimensions="Time">
Expand Down Expand Up @@ -445,6 +463,9 @@
<var name="landIceFreshwaterFluxRms" array_group="rms" units="kg m^-2 s^-1"
description="Global root mean square value of landIceFreshwaterFlux in ocean cells."
/>
<var name="landIceFreshwaterFluxTotalRms" array_group="rms" units="kg m^-2 s^-1"
description="Global root mean square value of landIceFreshwaterFluxTotal in ocean cells."
/>
<var name="accumulatedLandIceMassRms" array_group="rms" units="kg m^-2"
description="Global root mean square value of accumulatedLandIceMass in ocean cells."
/>
Expand All @@ -454,6 +475,9 @@
<var name="accumulatedLandIceFrazilMassRms" array_group="rms" units="kg m^-2"
description="Global root mean square value of accumulatedLandIceFrazilMass in ocean cells."
/>
<var name="frazilIceFreshwaterFluxRms" array_group="rms" units="kg m^-2"
description="Global root mean square value of frazilIceFreshwaterFlux in ocean cells."
/>
</var_array>

<var_array name="avgGlobalStats" type="real" dimensions="Time">
Expand Down Expand Up @@ -544,6 +568,9 @@
<var name="landIceFreshwaterFluxAvg" array_group="avg" units="kg m^-2 s^-1"
description="Average value of landIceFreshwaterFlux in ocean cells."
/>
<var name="landIceFreshwaterFluxTotalAvg" array_group="avg" units="kg m^-2 s^-1"
description="Average value of landIceFreshwaterFluxTotal in ocean cells."
/>
<var name="accumulatedLandIceMassAvg" array_group="avg" units="kg m^-2"
description="Average value of accumulatedLandIceMass in ocean cells."
/>
Expand All @@ -553,6 +580,9 @@
<var name="accumulatedLandIceFrazilMassAvg" array_group="avg" units="kg m^-2"
description="Average value of accumulatedLandIceFrazilMass in ocean cells."
/>
<var name="frazilIceFreshwaterFluxAvg" array_group="avg" units="kg m^-2"
description="Average value of frazilIceFreshwaterFlux in ocean cells."
/>
</var_array>

<var_array name="vertSumMinGlobalStats" type="real" dimensions="Time">
Expand Down Expand Up @@ -643,6 +673,9 @@
<var name="landIceFreshwaterFluxMinVertSum" array_group="vertSumMin" units="kg m^-2 s^-1"
description="Minimum vertical sum of landIceFreshwaterFlux in ocean cells."
/>
<var name="landIceFreshwaterFluxTotalMinVertSum" array_group="vertSumMin" units="kg m^-2 s^-1"
description="Minimum vertical sum of landIceFreshwaterFluxTotal in ocean cells."
/>
<var name="accumulatedLandIceMassMinVertSum" array_group="vertSumMin" units="kg m^-2"
description="Minimum vertical sum of accumulatedLandIceMass in ocean cells."
/>
Expand All @@ -652,6 +685,9 @@
<var name="accumulatedLandIceFrazilMassMinVertSum" array_group="vertSumMin" units="kg m^-2"
description="Minimum vertical sum of accumulatedLandIceFrazilMass in ocean cells."
/>
<var name="frazilIceFreshwaterFluxMinVertSum" array_group="vertSumMin" units="kg m^-2"
description="Minimum vertical sum of frazilIceFreshwaterFlux in ocean cells."
/>
</var_array>

<var_array name="vertSumMaxGlobalStats" type="real" dimensions="Time">
Expand Down Expand Up @@ -742,6 +778,9 @@
<var name="landIceFreshwaterFluxMaxVertSum" array_group="vertSumMax" units="kg m^-2 s^-1m"
description="Maximum vertical sum of landIceFreshwaterFlux in ocean cells."
/>
<var name="landIceFreshwaterFluxTotalMaxVertSum" array_group="vertSumMax" units="kg m^-2 s^-1m"
description="Maximum vertical sum of landIceFreshwaterFluxTotal in ocean cells."
/>
<var name="accumulatedLandIceMassMaxVertSum" array_group="vertSumMax" units="kg m^-2"
description="Maximum vertical sum of accumulatedLandIceMass in ocean cells."
/>
Expand All @@ -751,6 +790,9 @@
<var name="accumulatedLandIceFrazilMassMaxVertSum" array_group="vertSumMax" units="kg m^-2"
description="Maximum vertical sum of accumulatedLandIceFrazilMass in ocean cells."
/>
<var name="frazilIceFreshwaterFluxMaxVertSum" array_group="vertSumMax" units="kg m^-2"
description="Maximum vertical sum of frazilIceFreshwaterFlux in ocean cells."
/>
</var_array>
<var name="totalVolumeChange" type="real" dimensions="Time" units="m"
description="Total volume change of the ocean relative to previous timestep"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@
<var name="snowFlux"/>
<var name="boundaryLayerDepth"/>
<var name="landIceFreshwaterFlux"/>
<var name="landIceFreshwaterFluxTotal"/>
<var name="frazilIceFreshwaterFlux"/>
<var name="landIceHeatFlux"/>
<var name="heatFluxToLandIce"/>
<var name="surfaceBuoyancyForcing"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
<var name="boundaryLayerDepth"/>
<var name="columnIntegratedSpeed"/>
<var name="landIceFreshwaterFlux"/>
<var name="landIceFreshwaterFluxTotal"/>
<var name="frazilIceFreshwaterFlux"/>
<var name="landIceHeatFlux"/>
<var name="heatFluxToLandIce"/>
<var name="landIceFrictionVelocity"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
<var name="snowFlux"/>
<var name="boundaryLayerDepth"/>
<var name="landIceFreshwaterFlux"/>
<var name="landIceFreshwaterFluxTotal"/>
<var name="frazilIceFreshwaterFlux"/>
<var name="landIceHeatFlux"/>
<var name="heatFluxToLandIce"/>
<var name="surfaceBuoyancyForcing"/>
Expand Down
57 changes: 55 additions & 2 deletions components/mpas-ocean/src/analysis_members/mpas_ocn_global_stats.F
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{

real (kind=RKIND), dimension(:), pointer :: evaporationFlux, snowFlux
real (kind=RKIND), dimension(:), pointer :: seaIceFreshWaterFlux, icebergFreshWaterFlux, riverRunoffFlux, iceRunoffFlux
real (kind=RKIND), dimension(:), pointer :: rainFlux, landIceFreshwaterFlux
real (kind=RKIND), dimension(:), pointer :: rainFlux, landIceFreshwaterFlux, landIceFreshwaterFluxTotal
real (kind=RKIND), dimension(:), pointer :: accumulatedLandIceMass, accumulatedLandIceHeat, &
accumulatedLandIceFrazilMass
accumulatedLandIceFrazilMass, frazilIceFreshwaterFlux

real (kind=RKIND), dimension(:,:), pointer :: frazilLayerThicknessTendency

Expand Down Expand Up @@ -364,6 +364,8 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
call mpas_pool_get_array(forcingPool, 'rainFlux', rainFlux)
call mpas_pool_get_array(forcingPool, 'frazilLayerThicknessTendency', frazilLayerThicknessTendency)
call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux)
call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFluxTotal', landIceFreshwaterFluxTotal)
call mpas_pool_get_array(forcingPool, 'frazilIceFreshwaterFlux', frazilIceFreshwaterFlux)
call mpas_pool_get_array(forcingPool, 'landIceFloatingMask', landIceFloatingMask)

call mpas_pool_get_array(tracersSurfaceFluxPool, 'activeTracersSurfaceFlux', activeTracersSurfaceFlux)
Expand All @@ -377,6 +379,7 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
call mpas_pool_get_array(statePool, 'accumulatedLandIceHeat', accumulatedLandIceHeat, 1)
call mpas_pool_get_array(statePool, 'accumulatedLandIceFrazilMass', accumulatedLandIceFrazilMass, 1)


allocate(areaEdge(1:nEdgesSolve))
areaEdge = dcEdge(1:nEdgesSolve)*dvEdge(1:nEdgesSolve)

Expand Down Expand Up @@ -958,6 +961,21 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
maxes_tmp(variableIndex) = 0.0_RKIND
end if

! landIceFreshwaterFluxTotal
variableIndex = variableIndex + 1
if ( associated(landIceFreshwaterFluxTotal) ) then
call ocn_compute_field_area_weighted_local_stats_surface(dminfo, nCellsSolve, &
landIceFloatingArea, &
landIceFreshwaterFluxTotal(1:nCellsSolve), sums_tmp(variableIndex), &
sumSquares_tmp(variableIndex), mins_tmp(variableIndex), &
maxes_tmp(variableIndex))
else
sums_tmp(variableIndex) = 0.0_RKIND
sumSquares_tmp(variableIndex) = 0.0_RKIND
mins_tmp(variableIndex) = 0.0_RKIND
maxes_tmp(variableIndex) = 0.0_RKIND
end if

sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
sumSquares(variableIndex) = sumSquares(variableIndex) + sumSquares_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
Expand Down Expand Up @@ -1024,6 +1042,21 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
maxes_tmp(variableIndex) = 0.0_RKIND
end if

! frazilIceFreshwaterFlux
variableIndex = variableIndex + 1
if ( associated(frazilIceFreshwaterFlux) ) then
call ocn_compute_field_area_weighted_local_stats_surface(dminfo, nCellsSolve, &
areaCell(1:nCellsSolve), &
frazilIceFreshwaterFlux(1:nCellsSolve), sums_tmp(variableIndex), &
sumSquares_tmp(variableIndex), mins_tmp(variableIndex), &
maxes_tmp(variableIndex))
else
sums_tmp(variableIndex) = 0.0_RKIND
sumSquares_tmp(variableIndex) = 0.0_RKIND
mins_tmp(variableIndex) = 0.0_RKIND
maxes_tmp(variableIndex) = 0.0_RKIND
end if

sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
sumSquares(variableIndex) = sumSquares(variableIndex) + sumSquares_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
Expand Down Expand Up @@ -1299,6 +1332,16 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
rms(variableIndex) = 0.0_RKIND
end if

! landIceFreshwaterFluxTotal
variableIndex = variableIndex + 1
if (associated(landIceFreshwaterFluxTotal) .and. landIceFloatingAreaSum > 0.0_RKIND) then
averages(variableIndex) = sums(variableIndex)/(landIceFloatingAreaSum)
rms(variableIndex) = sqrt(sumSquares(variableIndex)/(landIceFloatingAreaSum))
else
averages(variableIndex) = 0.0_RKIND
rms(variableIndex) = 0.0_RKIND
end if

! continue accumulating fresh water inputs
netFreshwaterInput = netFreshwaterInput + sums(variableIndex) * dt/rho_sw

Expand Down Expand Up @@ -1332,6 +1375,16 @@ subroutine ocn_compute_global_stats(domain, timeLevel, err)!{{{
rms(variableIndex) = 0.0_RKIND
end if

! frazilIceFreshwaterFlux
variableIndex = variableIndex + 1
if (frazilIcePkgActive) then
averages(variableIndex) = sums(variableIndex)/(areaCellGlobal)
rms(variableIndex) = sqrt(sumSquares(variableIndex)/(areaCellGlobal))
else
averages(variableIndex) = 0.0_RKIND
rms(variableIndex) = 0.0_RKIND
end if

! calculate fresh water conservation check quantities
absoluteFreshWaterConservation = totalVolumeChange - netFreshwaterInput
if (abs(totalVolumeChange) < 1e-12_RKIND) then
Expand Down
Loading

0 comments on commit 56f7f6c

Please sign in to comment.