Skip to content

Commit

Permalink
Merge pull request #1031 from cbegeman/ocn-fixup-conservation-land-ic…
Browse files Browse the repository at this point in the history
…e-frazil

Fix land ice frazil in ocean conservation task
  • Loading branch information
xylar authored Nov 6, 2024
2 parents cf1c0ab + 144ac00 commit 2b081b8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mpas_analysis/ocean/conservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def setup_and_check(self):
'land_ice_ssh_change': ['landIceSshChange'],
'land_ice_mass_flux': ['landIceMassFlux'],
'land_ice_mass_flux_components': ['accumulatedIcebergFlux',
'accumulatedLandIceFlux',
'accumulatedLandIceFluxTotal',
'accumulatedRemovedRiverRunoffFlux',
'accumulatedRemovedIceRunoffFlux']}

Expand All @@ -208,16 +208,21 @@ def setup_and_check(self):
'massAnomaly': ['massChange', 'netMassFlux'],
'energyAnomaly': ['energyChange', 'netEnergyFlux'],
'saltAnomaly': ['saltChange', 'netSaltFlux'],
'accumulatedLandIceFluxTotal': ['accumulatedLandIceFlux',
'accumulatedLandIceFrazilFlux'],
'landIceMassFlux': ['accumulatedIcebergFlux',
'accumulatedLandIceFlux',
'accumulatedLandIceFrazilFlux',
'accumulatedRemovedRiverRunoffFlux',
'accumulatedRemovedIceRunoffFlux'],
'landIceSshChange': ['accumulatedIcebergFlux',
'accumulatedLandIceFlux',
'accumulatedLandIceFrazilFlux',
'accumulatedRemovedRiverRunoffFlux',
'accumulatedRemovedIceRunoffFlux'],
'landIceMassChange': ['accumulatedIcebergFlux',
'accumulatedLandIceFlux',
'accumulatedLandIceFrazilFlux',
'accumulatedRemovedRiverRunoffFlux',
'accumulatedRemovedIceRunoffFlux']}

Expand Down Expand Up @@ -537,9 +542,14 @@ def _get_variable(self, ds, varname, mks=False):
# Convert from kg/month to kg
variable = np.cumsum(land_ice_mass_flux)

elif varname == 'accumulatedLandIceFluxTotal':
variable = self._get_variable(ds, 'accumulatedLandIceFlux', mks=True) + \
self._get_variable(ds, 'accumulatedLandIceFrazilFlux', mks=True)

elif varname == 'landIceMassFlux':
variable = self._get_variable(ds, 'accumulatedIcebergFlux', mks=True) + \
self._get_variable(ds, 'accumulatedLandIceFlux', mks=True) + \
self._get_variable(ds, 'accumulatedLandIceFrazilFlux', mks=True) + \
self._get_variable(ds, 'accumulatedRemovedRiverRunoffFlux', mks=True) + \
self._get_variable(ds, 'accumulatedRemovedIceRunoffFlux', mks=True)

Expand Down

0 comments on commit 2b081b8

Please sign in to comment.