MetOffice / MetOffice/lfric_apps

RADAER full domain and segmentation and OpenMP

Open
#189 0 comments 0 reactions 1 assignee Claimed by @alanjhewitt 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

**Developments included in this ticket**

**RADAER FULL DOMAIN**

Reinitialise um_size: Set um_size to the number of horizontal cells before invoking the RADAER kernel, and reset it to 1 after the invocation.

Switch operation mode: Change the mode from column to domain in radaer_kernal_mod.F90 so that Psyclone can recognise the update, automatically generate the radaer_alg_mod_psy.f90 file, and provide suitable arguments for all subroutines. This enables the full horizontal and vertical domain data transfer to the RADAER code.

Update variable dimensions: Adjust variable sizes in radaer_kernal_mod.F90 to accept whole-domain data. A do loop was then introduced to initialise variables passed into key RADAER subroutines and to store the computed results, that involved a change of the data structure extents and associated loops from an "I-first" to a "K-first" approach.

**Bug fix**

Both the p_theta_levels and t_theta_levels pass the wrong number of dimensions to ukca_radaer_prepare.

**Rafactor radaer kernel**

In order to limit the number of times we switch from I-first to K-first addressing, I have made a UKCA side interface module that calls all of the UKCA side science code. I also reordered the sequence of I-first to K-first addressing.

**Segmentation**

All of the arrays passed to the UKCA side are now allocatable, so that correct segments can be passed with each iteration of the segmentation loop. The order of deallocation is the reverse order of allocation to prevent memory striding.

The I-first to K-first addressing changes from [#841](https://code.metoffice.gov.uk/trac/lfric_apps/ticket/841) full domain have been refactored so that the memory points to the part of memory associated with the segment for each iteration of the segment loop. This was complicated and is difficulty to describe in words, but I think will make sense when looking at the code change.

For short wave only, radaer_band_average does not need to be called for nightside segments, and this is a considerable cost save. We determine if any of the columns within each segment are on the dayside or not and pass that information to the UKCA interface code. This logical is calculated inside the segmentation loop.

Similirly, as the AOD diagnostics are optional, we only have to call the diagnostic modules if they are requested. I gather this information outside the segmentation loop.

### Further details of the issue.

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.