psyclone.domain.lfric.lfric_constants

This module provides a class with all LFRic related constants.

Classes

  • LFRicConstants: This class stores all LFRic constants. Note that some constants

class psyclone.domain.lfric.lfric_constants.LFRicConstants

This class stores all LFRic constants. Note that some constants depend on values in the config file, so this class can only be used after the config file has been read. It stores all values in class variables (to avoid re-evaluating them).

Inheritance

Inheritance diagram of LFRicConstants
precision_for_type(data_type)

This function returns the precision required for the various LFRic types.

Parameters:

data_type (str) – the name of the data type.

Returns:

the precision as defined in domain.lfric.lfric_types (one of R_SOLVER, R_TRAN, R_DEF).

Return type:

psyclone.psyir.symbols.DataSymbol

Raises:

InternalError – if an unknown data_type is specified.

static specific_function_space(name)

Maps from a valid kernel metadata function-space name to one that exists within the LFRic infrastructure. This is necessary because meta-data can contain ‘generic’ names such as ‘any_w2’ but, when generating code, we need the name of a specific function space that is recognised by the LFRic infrastructure.

Parameters:

name (str) – the name of the function space in metadata.

Returns:

the name of a specific function space.

Return type:

str

Raises:
  • ValueError – if the supplied name is not a valid LFRic function-space name.

  • InternalError – if an unrecognised wildcard function-space name is supplied.