Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .fortitude.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[check]
file-extensions = [
"f90",
"F90",
"x90",
"X90",
"pf",
]
select = ["S101"]
# select = [
# "E", # error rules
# "C", # correctness rules
# "S", # style rules
# "PORT", # portability rules
# "OB", # obsolescence rules
# "MOD", # modernisation rules
# ]
ignore = [
"C003"
]
line-length = 132
output-format = "grouped"
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This CODEOWNERS file includes a primary codeowner and a deputy for each section.
# This CODEOWNERS file includes a primary codeowner and a deputy for each section.
# Codeowners who are not in a comment will be automatically notified of changes
# to the listed files. All codeowners listed are valid points of contact
# for discussing changes and seeking approval for work.
# for discussing changes and seeking approval for work.

# Applications
**/adjoint_tests @DrTVockerodtMO # @mo-joshuacolclough
Expand Down Expand Up @@ -76,5 +76,5 @@ build/ @MetOffice/ssdteam @hiker
# Other areas
documentation # @MetOffice/ssdteam
.github/ @MetOffice/ssdteam
LICENSE @yaswant
LICENCE @yaswant
README.md @MetOffice/ssdteam
4 changes: 2 additions & 2 deletions .github/workflows/ru_build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
name: Install Python packages
run: |
python3 -m pip install --upgrade pip
python3 -m pip install sphinx==8.1.0 pydata-sphinx-theme==0.16.1 sphinx-sitemap==2.6.0 sphinx_design==0.6.1
python3 -m pip install .[docs]
- id: sphinx
name: Build Sphinx HTML docs
working-directory: ./documentation
run: make html
run: make clean html
- id: permissions
name: Set permissions
run: |
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ interfaces/**/bin
interfaces/**/documents
interfaces/**/working
interfaces/**/test

# venv
.venv/
uv.lock
*.egg-info/
74 changes: 61 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,33 @@

Welcome to LFRic Apps!

This repository is home to the LFRic-based science applications and libraries such as
the Momentum® Atmosphere model application and the GungHo dynamical core.
This repository is home to the LFRic-based science applications and libraries
such as the Momentum® Atmosphere model application and the GungHo dynamical
core.

LFRic applications are based on the infrastructure developed in the [LFRic
Core](https://github.com/MetOffice/lfric_core) repository.
LFRic applications are based on the infrastructure developed in the
[LFRic Core](https://github.com/MetOffice/lfric_core) repository.

| | |
|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|:repeat: CI| [![Documentation](https://github.com/MetOffice/lfric_apps/actions/workflows/ci_docs.yml/badge.svg)](https://github.com/MetOffice/lfric_apps/actions/workflows/ci_docs.yml) |
|:speech_balloon: Community| [![Static Badge](https://img.shields.io/badge/GitHub-discussions-gold)](https://github.com/MetOffice/simulation-systems/discussions/categories/lfric) |
|:package: Repo | [![GitHub License](https://img.shields.io/github/license/metoffice/lfric_apps)](https://github.com/MetOffice/lfric_apps?tab=BSD-3-Clause-1-ov-file#readme) [![GitHub Release](https://img.shields.io/github/v/release/metoffice/lfric_apps?color=purple)](https://github.com/MetOffice/lfric_apps/releases) ![GitHub commits since latest release (branch)](https://img.shields.io/github/commits-since/metoffice/lfric_apps/latest/main) |
| | |
| | |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| :repeat: CI | [![Documentation](https://github.com/MetOffice/lfric_apps/actions/workflows/ci_docs.yml/badge.svg)](https://github.com/MetOffice/lfric_apps/actions/workflows/ci_docs.yml) |
| :speech_balloon: Community | [![Static Badge](https://img.shields.io/badge/GitHub-discussions-gold)](https://github.com/MetOffice/simulation-systems/discussions/categories/lfric) |
| :package: Repo | [![GitHub License](https://img.shields.io/github/license/metoffice/lfric_apps)](https://github.com/MetOffice/lfric_apps?tab=BSD-3-Clause-1-ov-file#readme) [![GitHub Release](https://img.shields.io/github/v/release/metoffice/lfric_apps?color=purple)](https://github.com/MetOffice/lfric_apps/releases) ![GitHub commits since latest release (branch)](https://img.shields.io/github/commits-since/metoffice/lfric_apps/latest/main) |
| | |

## Getting Started

In development documentation for LFRic Apps is available at:
[https://metoffice.github.io/lfric_apps](https://metoffice.github.io/lfric_apps)

The LFRic Apps release schedule and deadlines can be viewed in the [milestones](https://github.com/metoffice/lfric_apps/milestones).
The LFRic Apps release schedule and deadlines can be viewed in the
[milestones](https://github.com/metoffice/lfric_apps/milestones).

Example standalone scientific suites for use with Met Office systems are
available at:

* [u-dn674 - MetOffice Azure SPICE](https://code.metoffice.gov.uk/trac/roses-u/browser/d/n/6/7/4/trunk)
* [u-dn704 - MetOffice EX HPC](https://code.metoffice.gov.uk/trac/roses-u/browser/d/n/7/0/4/trunk)
- [u-dn674 - MetOffice Azure SPICE](https://code.metoffice.gov.uk/trac/roses-u/browser/d/n/6/7/4/trunk)
- [u-dn704 - MetOffice EX HPC](https://code.metoffice.gov.uk/trac/roses-u/browser/d/n/7/0/4/trunk)

These both run a low resolution LFRic Atm NWP GAL9 job and are setup to run
using git sources. Advice on switching a suite from using fcm to git sources is
Expand Down Expand Up @@ -64,3 +66,49 @@ Questions are encouraged in the Simulation Systems

Please be aware of and follow the Simulation Systems
[AI Policy.](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html)

## Virtual Environment for Sanity Checks

Dependencies for documentation builds and Fortran/Python linting are defined in
`pyproject.toml`. You can use either `uv` or `venv` + `pip`; on Met Office
systems, `venv` + `pip` is recommended to ensure packages come from the Met
Office Artifactory.

### Option 1: `venv` + `pip`

```bash
# Create virtual environment
python3.12 -m venv .venv
# Install dependencies
.venv/bin/pip install ".[dev,docs]"
# Activate virtual environment
source .venv/bin/activate
```

### Option 2: `uv`

```bash
uv sync --all-extras
source .venv/bin/activate
```

### Check and Build Documentation

```bash
cd documentation
make lint # Lint Restructured text
make clean html # build Sphinx documentation
```

### Lint Fortran

```bash
fortitude check [DIR]
```

### Check/Format Python

```bash
ruff check --preview [DIR]
ruff format --check --preview [DIR]
```
2 changes: 2 additions & 0 deletions documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ clean:
@echo "***** Removing, $(BUILDDIR) directory *****"
@rm -rf $(BUILDDIR)

lint:
sphinx-lint --d "horizontal-tab" --max-line-length 80 "$(SOURCEDIR)"
65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[project]
name = "lfric_apps"
version = "2026.3.1"
description = "LFRic-based science applications and libraries"
license = {file = 'LICENCE'}
requires-python = ">=3.12"

[project.urls]
repository = "https://github.com/MetOffice/lfric_apps"
documentation = "https://metoffice.github.io/lfric_apps/"
discussion = "https://github.com/MetOffice/simulation-systems/discussions"

[project.optional-dependencies]
dev = [
"pytest==9.0.2",
"ruff==0.15.4",
"ty==0.0.20",
"fortitude-lint==0.8.0",
]
docs = [
"sphinx==8.1.0",
"pydata-sphinx-theme==0.16.1",
"sphinx-sitemap==2.6.0",
"sphinx_design==0.6.1",
"sphinx-lint==1.0.2",
]

[tool.setuptools]
packages = []

[tool.ruff]
line-length = 88
target-version = "py312"

[tool.ruff.lint]
select = [
"B", # flake8-bugbear: Code quality issues
"CPY", # flake8-copyright: Copyright notice issues
"E", # pycodestyle errors: Basic PEP 8 violations
"F", # pyflakes errors: Logical errors in code
"I", # isort errors: Import sorting issues
"N", # pep8-naming: Naming convention issues
"NPY", # flake8-numpy: NumPy-specific rules
"UP", # pyupgrade: Modernisation rules, enforce f-strings for formatting
"W", # pycodestyle warnings: PEP 8 warnings
# "PL", # pylint rules: Various code quality and style issues
]
ignore = [
"E501", # line-too-long
"I001", # unsorted-imports
"UP030", # format-literals
"F401", # unused-import
"F403", # undefined-local-with-import-star
"B905", # zip-without-explicit-strict
]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# preview = true

# [tool.ty.environment]
# root = [
# ".",
# ]