Skip to content

Commit

Permalink
add ocean depth fix for ipsl_cm6a_lr (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaslovato committed Apr 27, 2021
1 parent 8a3cf94 commit 7c256ae
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion esmvalcore/cmor/_fixes/cmip6/ipsl_cm6a_lr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
from iris.exceptions import ConstraintMismatchError

from ..fix import Fix
from ..shared import (set_ocean_depth_coord)


class AllVars(Fix):
"""Fixes for thetao."""
"""Common fixes."""

def fix_metadata(self, cubes):
"""
Expand Down Expand Up @@ -46,6 +47,32 @@ def fix_metadata(self, cubes):
return CubeList(new_list)


class Omon(Fix):
"""Fixes for ocean variables."""

def fix_metadata(self, cubes):
"""
Fix ocean depth coordinate.
Parameters
----------
cubes: iris CubeList
List of cubes to fix
Returns
-------
iris.cube.CubeList
"""
new_list = CubeList()
for cube in cubes:
if cube.coords(axis='Z'):
if cube.coord(axis='Z').var_name == 'olevel':
cube = set_ocean_depth_coord(cube)
new_list.append(cube)
return CubeList(new_list)


class Clcalipso(Fix):
"""Fixes for ``clcalipso``."""

Expand Down

0 comments on commit 7c256ae

Please sign in to comment.