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

Implement EMAC cmorizers as fixes #894

Closed
wants to merge 8 commits into from
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
32 changes: 32 additions & 0 deletions esmvalcore/cmor/_fixes/native6/emac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import logging
from ..fix import Fix


logger = logging.getLogger(__name__)


class AllVars(Fix):

var_mappings = { # EMAC : CMOR
"awhea_ave" : "awhea"
}


"""
def fix_file(self, var1, var2):
# It seems it's only useful to correct filenames
logger.info(f"\nFix file\n=========\n{var1}\n{var2}")
return var1, var2
"""


def fix_metadata(self, cubes):
# logger.info(f"\nFix metadata\n==================\n{cubes}\n")
for cube in cubes:
logger.info(f"{cube.var_name}")
if cube.var_name in self.var_mappings.keys():
logger.info(f"{cube.var_name} = {self.var_mappings[cube.var_name]}")
cube.var_name = self.var_mappings[cube.var_name]
return cubes


22 changes: 22 additions & 0 deletions esmvalcore/cmor/tables/custom/CMOR_awhea.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SOURCE: CMIP5
!============
variable_entry: awhea
!============
modeling_realm: atmos
!----------------------------------
! Variable attributes:
!----------------------------------
standard_name:
units: W m-2
cell_methods: time: mean
cell_measures: area: areacella
long_name: Global Mean Net Surface Heat Flux Over Open Water
comment: global mean net surface heat flux over open water
!----------------------------------
! Additional variable information:
!----------------------------------
dimensions: longitude latitude time
out_name: awhea
type: real
!----------------------------------
!
2 changes: 2 additions & 0 deletions esmvalcore/config-developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ native6:
cmor_strict: false
input_dir:
default: 'Tier{tier}/{dataset}/{latestversion}/{frequency}/{short_name}'
EMAC: '{type}/{mip}' # TODO This is a temporary fix, a proper solution should be implemented
input_file:
default: '*.nc'
EMAC: '*.nc'
output_file: '{project}_{dataset}_{type}_{version}_{mip}_{short_name}'
cmor_type: 'CMIP6'
cmor_default_table_prefix: 'CMIP6_'
Expand Down