Skip to content

Add a directory and filename template with facets stored in directory for OBS and OBS6? #1944

@bouweandela

Description

@bouweandela

At the moment, all facets are contained in the filename instead of in the directory for OBS and OBS6 data. This prevents the facets from being read from the directory name. Therefore wildcards in the recipe do not work as well as expected for these projects, e.g. automatically adding supplementary variables does not work. See the section Backward incompatible changes in #1609 (comment).

We could add an extra directory and filename template to config-developer.yml that contains the facets in the directory instead of in the file. For example, we could add a default2 (or a better name if someone knows it), that is the same as for native6:

OBS:
  cmor_strict: false
  input_dir:
    default: 'Tier{tier}/{dataset}'
    default2: 'Tier{tier}/{dataset}/{version}/{frequency}/{short_name}'
    BSC: '{type}/{institute.lower}/{dataset.lower}/{freq_folder}/{short_name}{freq_base}'
    RCAST: '{dataset}'
  input_file:
    default: '{project}_{dataset}_{type}_{version}_{mip}_{short_name}[_.]*nc'
    default2: '*.nc'
    BSC: '{short_name}_*.nc'
    RCAST: '{short_name}_{mip}_{type}_{dataset}_*.nc'
  output_file: '{project}_{dataset}_{type}_{version}_{mip}_{short_name}'
  cmor_type: 'CMIP5'

OBS6:
  cmor_strict: false
  input_dir:
    default: 'Tier{tier}/{dataset}'
    default2: 'Tier{tier}/{dataset}/{version}/{frequency}/{short_name}'
    BSC: '{type}/{institute.lower}/{dataset.lower}/{freq_folder}/{short_name}{freq_base}'
  input_file:
    default: '{project}_{dataset}_{type}_{version}_{mip}_{short_name}[_.]*nc'
    default2: '*.nc'
    BSC: '{short_name}_*.nc'
  output_file: '{project}_{dataset}_{type}_{version}_{mip}_{short_name}'
  cmor_type: 'CMIP6'

native6:
  cmor_strict: false
  input_dir:
    default: 'Tier{tier}/{dataset}/{version}/{frequency}/{short_name}'
  input_file:
    default: '*.nc'
  output_file: '{project}_{dataset}_{type}_{version}_{mip}_{short_name}'
  cmor_type: 'CMIP6'
  cmor_default_table_prefix: 'CMIP6_'

That would allow users to set

drs:
  OBS: default2
  OBS6: default2

in their config-user.yml file and reorganize their OBS data accordingly and then automatic addition of supplementary files would work for the OBS and OBS6 projects without any changes to the recipe.

This would make it easier to upgrade if we add it to v2.8.0. If anyone likes this idea, please comment @ESMValGroup/esmvaltool-coreteam. If not, we can close the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions