Skip to content
Draft
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
19 changes: 9 additions & 10 deletions polaris/ocean/ice_shelf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from typing import Dict as Dict

from polaris import (
Step as Step,
)
from polaris import (
Task as Task,
from polaris import Task
from polaris.ocean.ice_shelf.freeze import ( # noqa: F401
compute_freezing_temperature,
)
from polaris.ocean.ice_shelf.ssh_adjustment import (
SshAdjustment as SshAdjustment,
from polaris.ocean.ice_shelf.pressure import ( # noqa: F401
compute_land_ice_draft_from_pressure,
compute_land_ice_pressure_from_draft,
compute_land_ice_pressure_from_thickness,
)
from polaris.ocean.ice_shelf.ssh_adjustment import SshAdjustment
from polaris.ocean.ice_shelf.ssh_forward import SshForward as SshForward


Expand Down Expand Up @@ -100,7 +99,7 @@ def setup_ssh_adjustment_steps(
yaml_filename : str, optional
the yaml filename used for ssh_forward steps

yaml_replacements : Dict, optional
yaml_replacements : dict, optional
key, string combinations for templated replacements in the yaml
file

Expand Down
14 changes: 14 additions & 0 deletions polaris/ocean/ice_shelf/freeze.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Options related to freezing temperature below ice shelves
[ice_shelf_freeze]

# The freezing temperature (C) at zero pressure and salinity
coeff_0 = 6.22e-2

# The coefficient (1e3 C) for the term proportional to salinity
coeff_S = -5.63e-2

# The coefficient (C Pa^-1) for the term proportional to the pressure
coeff_p = -7.43e-8

# The coefficient (1e3 C Pa^-1) for the term proportional to salinity times pressure
coeff_pS = -1.74e-10
35 changes: 35 additions & 0 deletions polaris/ocean/ice_shelf/freeze.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
def compute_freezing_temperature(config, salinity, pressure):
"""
Get the freezing temperature in an ice-shelf cavity using the same equation
of state as in the ocean model

Parameters
----------
config : polaris.config.PolarisConfigParser
Config options

salinity : xarray.DataArray
The salinity field

pressure
The pressure field

Returns
-------
freezing_temp : xarray.DataArray
The freezing temperature
"""
section = config['ice_shelf_freeze']
coeff_0 = section.getfloat('coeff_0')
coeff_S = section.getfloat('coeff_S')
coeff_p = section.getfloat('coeff_p')
coeff_pS = section.getfloat('coeff_pS')

freezing_temp = (
coeff_0
+ coeff_S * salinity
+ coeff_p * pressure
+ coeff_pS * pressure * salinity
)

return freezing_temp
96 changes: 96 additions & 0 deletions polaris/ocean/ice_shelf/pressure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import numpy as np
from mpas_tools.cime.constants import constants


def compute_land_ice_pressure_from_thickness(
land_ice_thickness, modify_mask, land_ice_density=None
):
"""
Compute the pressure from an overlying ice shelf from ice thickness

Parameters
----------
land_ice_thickness: xarray.DataArray
The ice thickness

modify_mask : xarray.DataArray
A mask that is 1 where ``landIcePressure`` can be deviate from 0

land_ice_density : float, optional
A reference density for land ice

Returns
-------
land_ice_pressure : xarray.DataArray
The pressure from the overlying land ice on the ocean
"""
gravity = constants['SHR_CONST_G']
if land_ice_density is None:
land_ice_density = constants['SHR_CONST_RHOICE']
land_ice_pressure = modify_mask * np.maximum(
land_ice_density * gravity * land_ice_thickness, 0.0
)
return land_ice_pressure


def compute_land_ice_pressure_from_draft(
land_ice_draft, modify_mask, ref_density=None
):
"""
Compute the pressure from an overlying ice shelf from ice draft

Parameters
----------
land_ice_draft : xarray.DataArray
The ice draft (sea surface height)

modify_mask : xarray.DataArray
A mask that is 1 where ``landIcePressure`` can be deviate from 0

ref_density : float, optional
A reference density for seawater displaced by the ice shelf

Returns
-------
land_ice_pressure : xarray.DataArray
The pressure from the overlying land ice on the ocean
"""
gravity = constants['SHR_CONST_G']
if ref_density is None:
ref_density = constants['SHR_CONST_RHOSW']
land_ice_pressure = modify_mask * np.maximum(
-ref_density * gravity * land_ice_draft, 0.0
)
return land_ice_pressure


def compute_land_ice_draft_from_pressure(
land_ice_pressure, modify_mask, ref_density=None
):
"""
Compute the ice-shelf draft associated with the pressure from an overlying
ice shelf

Parameters
----------
land_ice_pressure : xarray.DataArray
The pressure from the overlying land ice on the ocean

modify_mask : xarray.DataArray
A mask that is 1 where ``landIcePressure`` can be deviate from 0

ref_density : float, optional
A reference density for seawater displaced by the ice shelf

Returns
-------
land_ice_draft : xarray.DataArray
The ice draft
"""
gravity = constants['SHR_CONST_G']
if ref_density is None:
ref_density = constants['SHR_CONST_RHOSW']
land_ice_draft = -(
modify_mask * land_ice_pressure / (ref_density * gravity)
)
return land_ice_draft
47 changes: 35 additions & 12 deletions polaris/ocean/tasks/isomip_plus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,26 @@ def add_isomip_plus_tasks(component, mesh_type):
mesh_type, resolution, mesh_name, resdir, component, config
)

for experiment in [
'ocean0',
'ocean1',
'ocean2',
'ocean3',
'ocean4',
'inception',
'wetting',
'drying',
]:
for vertical_coordinate in ['z-star']:
basic_expts = ['ocean0', 'ocean1', 'ocean2', 'ocean3', 'ocean4']
extra_expts = ['wetting', 'drying']
vert_coords = ['z-star', 'sigma']

for experiment in basic_expts:
vertical_coordinate = 'z-star'
task = IsomipPlusTest(
component=component,
resdir=resdir,
resolution=resolution,
experiment=experiment,
vertical_coordinate=vertical_coordinate,
planar=planar,
shared_steps=shared_steps[experiment],
)
component.add_task(task)

if planar and resolution >= 2.0:
for experiment in extra_expts:
vertical_coordinate = 'z-star'
task = IsomipPlusTest(
component=component,
resdir=resdir,
Expand All @@ -94,6 +103,20 @@ def add_isomip_plus_tasks(component, mesh_type):
)
component.add_task(task)

for vertical_coordinate in vert_coords:
for experiment in ['ocean0'] + extra_expts:
task = IsomipPlusTest(
component=component,
resdir=resdir,
resolution=resolution,
experiment=experiment,
vertical_coordinate=vertical_coordinate,
planar=planar,
shared_steps=shared_steps[experiment],
thin_film=True,
)
component.add_task(task)


def _get_shared_steps(
mesh_type, resolution, mesh_name, resdir, component, config
Expand Down Expand Up @@ -193,7 +216,7 @@ def _get_shared_steps(
# ocean0 and ocean1 use the same topography
shared_steps['ocean0'] = shared_steps['ocean1']

for experiment in ['inception', 'wetting', 'drying']:
for experiment in ['wetting', 'drying']:
shared_steps[experiment] = dict(shared_steps['ocean1'])
subdir = f'{resdir}/topo/scale/{experiment}'
topo_scale = TopoScale(
Expand Down
2 changes: 2 additions & 0 deletions polaris/ocean/tasks/isomip_plus/init/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from polaris.ocean.tasks.isomip_plus.init.forcing import Forcing as Forcing
from polaris.ocean.tasks.isomip_plus.init.init import Init as Init
Loading
Loading