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:
- 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.
- 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.
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
MCTpreprocessor directive. Currently this does not work.Further details of the issue.
The
MCTpreprocessor 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:MCTis unset. This is not currently the case. For example: incoupler_exchange_2d_mod.F90, the routineis_coupling_time()returns the variableis_coupling- but ifMCTis unset,is_couplingis never set to any value by the code - which leads to a compiler error. There may be other routines with bugs like this.MCTwas supposed to be used to eliminate any calls to the Oasis3-MCT library andCOUPLEDwas 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 removeCOUPLEDand replace it with simple run-time Fortran if-then blocks.