Skip to content

Fix coupling component to work when there is no Oasis #498

@mike-hobson

Description

Are there any linked Issues or Pull Requests?

No response

Brief description

It should be possible to call into the LFRic Core coupling component even if the Oasis library is not present - by unsetting the MCT preprocessor directive. Currently this does not work.

Further details of the issue.

The MCT preprocessor directive is supposed to "switch off" all calls into the Oasis3-MCT library, so the coupling code can still be called, even if the Oasis library is not available. There are two issues with this:

  1. Data that should be returned from the Oasis library should be replaced by neutral answers if MCT is unset. This is not currently the case. For example: in coupler_exchange_2d_mod.F90, the routine is_coupling_time() returns the variable is_coupling - but if MCT is unset, is_coupling is never set to any value by the code - which leads to a compiler error. There may be other routines with bugs like this.
  2. Originally, two preprocessor directives were introduced: MCT was supposed to be used to eliminate any calls to the Oasis3-MCT library and COUPLED was supposed to be used to eliminate any calls into the LFRic coupling code. These directives have been (ab)used, so in most cases, they are now interchangeable. This needs sorting. In retrospect, it would have been better to keep it simple and only have one directive. We should remove COUPLED and replace it with simple run-time Fortran if-then blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions