Handling first basis/differential basis array dimension for any_*_space

Open
#461 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
fortran, python
Domain
compilers

Research direction

Start with the kernel stub generator and the PSy layer handling of basis and differential-basis arrays for any_*_space. Read compute_total_aam_kernel_mod.F90 and compare its hard-coded first dimension with the generated allocation example in the issue. Done requires a decided approach for passing or hard-coding the dimension in PSy, kernels, and stub-generator naming, including any required LFRic changes.

Written by the indexing model from the issue text.

Description

enhancement LFRic question

Kernel stub generator does not support basis/differential basis function arrays on any_*_space because it is not possible to explicitly determine the first array dimension (1 for scalar function spaces and 3 for vector function spaces). PSy layer obtains it from the LFRic infrastructure, e.g.

      dim_any_space_9_chi = chi_proxy(1)%vspace%get_dim_space()
      ALLOCATE (basis_any_space_9_chi_qr(dim_any_space_9_chi, ndf_any_space_9_chi, np_xy_qr, np_z_qr))

but does not pass it to kernels. Also, the first array dimension is currently hard-coded in LFRic kernels even when they use any_space metadata for fields (e.g. compute_total_aam_kernel_mod.F90).

The question is how to handle the first dimension in
a) PSy layer - pass or not (requires LFRic changes)
b) Kernels - pass or hardcode (requires LFRic changes)
c) Stub generator - how to name it for generation.

Dominant language
Python
Stars
137
Forks
36
Avg merge
6d 16h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stfc/PSyclone

All issues in stfc/PSyclone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.