MetOffice / MetOffice/lfric_apps

Use dummy write method for empty fields

Open
#696 0 comments 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?

_NA_

### Brief description

**Gungho** should make use of the `write_empty_field` wherever the code attempts to write an empty field.

### Further details of the issue.

When fields are created they can be assigned a write method. For example, lfric_atm uses the write_method which sends data to XIOS.

Fields can be created as "empty" fields, though. These can be required where the field needs to be passed through the PSy layer - they must be initialised to enable PSy layer code to work, but by not containing data it means they use less memory.

But if they are accidentally written out, it would be better to assign a dummy method rather than have the call result in an error from lfric_xios.

The code for initialising fields is in "science/gungho/source/driver/field_maker_mod.F90". The empty flag is used for initialising the field data but could also be used when it comes to assigning the write method.

-----

This work had been started in https://code.metoffice.gov.uk/trac/lfric_apps/ticket/705.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in science/gungho/source/driver/field_maker_mod.F90 and trace how the empty flag initializes fields and how write methods are assigned. Use the existing write_empty_field method for fields that would otherwise attempt to write empty data, then verify that accidental writes no longer reach lfric_xios and instead use the dummy method.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.