MetOffice / MetOffice/lfric_core

Variable to read time value from netcdf files needs to be double precision regardless

Open
#236 0 comments 0 reactions 1 assignee Claimed by @EdHone View on GitHub
bug
Dominant language
Fortran
Stars
26
Forks
73
Avg merge
1d 8h
Merged PRs (30d)
4

Description

### Version

main

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

_No response_

### What happened?

Input ancillary files will have time coordinates with an arbitrary unit. In one particular use case the unit is `seconds since 1981-01-01 00:00:00`. The values for this are of the order 1e9 for current dates. When these are read in, the values are written to a float variable that could be single precision (defined by r_def), and in this case the numbers can lose their precision. For example, the integer `1371729600` is read in as `1371729664.0`.

The data type of the receiving variable needs to be of kind type `r_second` instead.

All this happens in the routine `read_time_data` in file `components/lfric-xios/source/lfric_xios_time_axis_mod.X90`

### Relevant log output

```shell

```

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.