MetOffice / MetOffice/lfric_apps

Improve Stochastic Physics PSyclone Scripts by Grouping Functionalities into Reusable Functions

Open
#167 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Fortran
Stars
31
Forks
118
Avg merge
2d 4h
Merged PRs (30d)
8

Description

### Are there any linked Issues or Pull Requests?

_No response_

### Brief description

During the review of PR #65 , the code reviewer has pointed out that functionalities in Stochastic Physics Psyclone scripts can be grouped into functions and relocated to https://github.com/MetOffice/lfric_core/blob/main/infrastructure/build/psyclone/psyclone_tools.py , for reuse by different PSyclone scripts. This can improve the modularity and reduce the length and duplication of the Psyclone script.

### Further details of the issue.

The details are in the conversations of PR #65 during the code review stage. Specifically, the current issues of the Stochastic Physics Psyclone scripts are:
1. Duplication of codes between different Stochastic Physics Psyclone scripts.
2. Logics of initializing different transforms based on `OFFLOAD_DIRECTIVES` can be grouped into a function.
3. Some parts of the codes can be replaced by calling `redundant_computation__setval` and `colour_loops`.
4. GPU-related transformation codes can be grouped into a function with better if and try logic.
5. OpenMP transformation codes can also be grouped into a function.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the conversations on PR #65 and locating the Stochastic Physics PSyclone scripts. Compare their repeated transformation logic with infrastructure/build/psyclone/psyclone_tools.py, including OFFLOAD_DIRECTIVES, redundant_computation__setval, colour_loops, GPU, and OpenMP handling. Done means the shared functionality is reusable and duplication is reduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, python
Domain
build-system, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.