MetOffice / MetOffice/lfric_apps

Truncation in specified profile interpolation kernel for profile_size>100

Open
#695 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
When using the `specified_profiles` initialisation option, `profile_interp_kernel_mod` stores profile values in fixed-size arrays:

- `profile_data(100)`
- `profile_heights(100)`

This imposes a hard limit of 100 profile points and can silently truncate larger profiles.

### Why this matters
While 100 profile points are usually sufficient for standard setups, this limit restricts high-resolution configurations (>100 vertical layers) that require a direct, non-interpolated mapping of the input profile.

### Current behavior
Profiles with more than 100 points are cut off by the fixed-size arrays in:
`science/gungho/source/kernel/initialisation/profile_interp_kernel_mod.F90`.

### Proposed fix / workaround
- Ideally replace fixed-size arrays with dynamically-sized arrays (allocated?), or pass the arrays directly (PSyclone issue [#1312](https://github.com/stfc/PSyclone/issues/1312)), or simply increase the array size to something more reasonable while waiting for [#1312](https://github.com/stfc/PSyclone/issues/1312)).

### Further details of the issue.

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in science/gungho/source/kernel/initialisation/profile_interp_kernel_mod.F90 and inspect how specified_profiles populates profile_data(100) and profile_heights(100). Determine how profiles larger than 100 points are handled, then verify that a profile with more than 100 points is no longer silently truncated without relying on an undefined allocation approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.