diff --git a/esmvalcore/cmor/_fixes/native6/emac.py b/esmvalcore/cmor/_fixes/native6/emac.py new file mode 100644 index 0000000000..9938a88859 --- /dev/null +++ b/esmvalcore/cmor/_fixes/native6/emac.py @@ -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 + + diff --git a/esmvalcore/cmor/tables/custom/CMOR_awhea.dat b/esmvalcore/cmor/tables/custom/CMOR_awhea.dat new file mode 100644 index 0000000000..5388203a2e --- /dev/null +++ b/esmvalcore/cmor/tables/custom/CMOR_awhea.dat @@ -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 +!---------------------------------- +! \ No newline at end of file diff --git a/esmvalcore/config-developer.yml b/esmvalcore/config-developer.yml index a0a242e6a1..875f03a606 100644 --- a/esmvalcore/config-developer.yml +++ b/esmvalcore/config-developer.yml @@ -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_'