Skip to content
Merged
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
18 changes: 7 additions & 11 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,14 @@ Code Reviewer: <!-- CR id, filled by SSD -->
- [ ] Performance of the code has been considered and, if applicable, suitable
performance measurements have been conducted

## Contributor License Agreement (CLA)

- [ ] **Required** - I confirm that I have read and agree to the project's
[Contributor License Agreement](todo-enter-link-to-cla)

## AI Assistance and Attribution

- [ ] Some of the content of this change has been produced with the assistance
of _Generative AI tool name_ (e.g., Met Office Github Copilot Enterprise,
Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the
[Simulation Systems AI policy](todo-enter-link-to-policy-page) (including
attribution labels)
[Simulation Systems AI policy](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html)(including attribution labels)

<!-- If AI has been used, please provide more details here -->

## Documentation

Expand All @@ -78,10 +74,10 @@ Code Reviewer: <!-- CR id, filled by SSD -->
<!-- To be completed by the Code Reviewer -->

- [ ] All dependencies have been resolved
- [ ] Related Issues are properly linked and addressed
- [ ] CLA compliance is confirmed
- [ ] Code quality standards are met
- [ ] Tests are adequate and passing
- [ ] Related Issues have been properly linked and addressed
- [ ] CLA compliance has been confirmed
- [ ] Code quality standards have been met
- [ ] Tests are adequate and have passed
- [ ] Documentation is complete and accurate
- [ ] Security considerations have been addressed
- [ ] Performance impact is acceptable
11 changes: 11 additions & 0 deletions .github/workflows/check-cr-approved.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Check CR approved

on:
pull_request_review:
types: [submitted, edited, dismissed]
workflow_dispatch:

jobs:
check_cr_approved:
if: ${{ github.event.pull_request.number }}
uses: MetOffice/growss/.github/workflows/check-cr-approved.yaml@main
4 changes: 4 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name: Quality

on: # yamllint disable-line rule:truthy
push:
branches:
- main
- 'releases/**'
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/cla-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Legal

on:
pull_request_target:

jobs:
cla:
uses: MetOffice/growss/.github/workflows/cla-check.yaml@main
with:
runner: 'ubuntu-24.04'
17 changes: 17 additions & 0 deletions .github/workflows/track-review-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Track Review Project

on:
workflow_run:
workflows: [Trigger Review Project]
types:
- completed

permissions:
actions: read
contents: read
pull-requests: write

jobs:
track_review_project:
uses: MetOffice/growss/.github/workflows/track-review-project.yaml@main
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/trigger-project-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Trigger Review Project

on:
pull_request_target:
types: ["opened", "synchronize", "reopened", "edited", "review_requested", "review_request_removed", "closed"]
pull_request_review:
pull_request_review_comment:

permissions:
actions: read
contents: read
pull-requests: write

jobs:
trigger_project_workflow:
uses: MetOffice/growss/.github/workflows/trigger-project-workflow.yaml@main
secrets: inherit
13 changes: 0 additions & 13 deletions CONTRIBUTING.md

This file was deleted.

7 changes: 7 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributors

| GitHub user | Real Name | Affiliation | Date |
| ----------- | --------- | ----------- | ---- |
| james-bruten-mo | James Bruten | Met Office | 2025-12-09 |
| t00sa | Sam Clarke-Green | Met Office | 2026-02-10 |
| jennyhickson | Jenny Hickson | Met Office | 2026-03-02 |
30 changes: 15 additions & 15 deletions LICENCE
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ BSD 3-Clause Licence

Crown Copyright (c) Met Office

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Expand All @@ -12,17 +12,17 @@ are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Shumlib

[![CI](https://github.com/MetOffice/shumlib/actions/workflows/docs.yaml/badge.svg)](https://github.com/MetOffice/shumlib/actions/workflows/docs.yaml)
[![CI](https://github.com/MetOffice/shumlib/actions/workflows/ci.yaml/badge.svg)](https://github.com/MetOffice/shumlib/actions/workflows/ci.yaml)
[![Docs](https://github.com/MetOffice/shumlib/actions/workflows/docs.yaml/badge.svg)](https://github.com/MetOffice/shumlib/actions/workflows/docs.yaml)
[![Quality](https://github.com/MetOffice/shumlib/actions/workflows/checks.yaml/badge.svg)](https://github.com/MetOffice/shumlib/actions/workflows/checks.yaml)

Shumlib is the collective name for a set of libraries which are used by the UM;
the UK Met Office's Unified Model, that may be of use to external tools or
Expand All @@ -9,5 +11,37 @@ is to enable developers to quickly and easily access parts of the UM code that
are commonly duplicated elsewhere, at the same time benefiting from any
improvements or optimisations that might be made in support of the UM itself.

Please follow the
[simulation-systems working practices](https://metoffice.github.io/simulation-systems/index.html)
## Contributing Guidelines

Welcome!

The following links are here to help set clear expectations for everyone
contributing to this project. By working together under a shared understanding,
we can continuously improve the project while creating a friendly, inclusive
space for all contributors.

### Contributors Licence Agreement

Please see the
[Momentum Contributors Licence Agreement](https://github.com/MetOffice/Momentum/blob/main/CLA.md)

Agreement of the CLA can be shown by adding yourself to the CONTRIBUTORS file
alongside this one, and is a requirement for contributing to this project.

### Code of Conduct

Please be aware of and follow the
[Momentum Code of Coduct](https://github.com/MetOffice/Momentum/blob/main/docs/CODE_OF_CONDUCT.md)

### Working Practices

This project is managed as part of the Simulation Systems group of repositories.

Please follow the Simulation Systems
[Working Practices.](https://metoffice.github.io/simulation-systems/index.html)

Questions are encouraged in the Simulation Systems
[Discussions.](https://github.com/MetOffice/simulation-systems/discussions)

Please be aware of and follow the Simulation Systems
[AI Policy.](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html)
14 changes: 5 additions & 9 deletions fortitude.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
[check]
exclude = ['.venv']
exclude = [
'.venv',
'fruit/fruit.f90',
'fruit/fruit_mpi.f90',
]
ignore = [
'C002', # interface-implicit-typing
'C003', # implicit-external-procedures
'C061', # missing-intent
'C071', # assumed-size
'C072', # assumed-size-character-intent
'C081', # initialisation-in-declaration
'C121', # use-all
'C141', # missing-exit-or-cycle-label
'E001', # syntax-error
'MOD011', # old-style-array-literal
'MOD021', # deprecated-relational-operator
'S061', # unnamed-end-statement
]
20 changes: 11 additions & 9 deletions fruit/fruit.f90
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function integer32Equal (number1, number2 ) result (resultValue)

resultValue = .false.

if ( number1 .eq. number2 ) then
if ( number1 == number2 ) then
resultValue = .true.
else
resultValue = .false.
Expand All @@ -243,7 +243,7 @@ function integer64Equal (number1, number2 ) result (resultValue)

resultValue = .false.

if ( number1 .eq. number2 ) then
if ( number1 == number2 ) then
resultValue = .true.
else
resultValue = .false.
Expand All @@ -256,7 +256,7 @@ function stringEqual (str1, str2 ) result (resultValue)

resultValue = .false.

if ( str1 .eq. str2 ) then
if ( str1 == str2 ) then
resultValue = .true.
end if
end function stringEqual
Expand Down Expand Up @@ -971,7 +971,8 @@ end subroutine fruit_hide_dots_
subroutine run_test_case_named_( tc, tc_name )
interface
subroutine tc()
end subroutine
implicit none
end subroutine tc
end interface
character(*), intent(in) :: tc_name

Expand All @@ -996,7 +997,7 @@ subroutine tc()

!$OMP BARRIER

if ( initial_failed_assert_count .eq. failed_assert_count ) then
if ( initial_failed_assert_count == failed_assert_count ) then
! If no additional assertions failed during the run of this test case
! then the test case was successful
successful_case_count = successful_case_count+1
Expand All @@ -1015,7 +1016,8 @@ end subroutine run_test_case_named_
subroutine run_test_case_( tc )
interface
subroutine tc()
end subroutine
implicit none
end subroutine tc
end interface

call run_test_case_named_( tc, '_unnamed_' )
Expand Down Expand Up @@ -1100,12 +1102,12 @@ end subroutine add_fail_unit_
subroutine obsolete_isAllSuccessful_(result)
logical, intent(out) :: result
call obsolete_ ('subroutine isAllSuccessful is changed to function is_all_successful.')
result = (failed_assert_count .eq. 0 )
result = (failed_assert_count == 0 )
end subroutine obsolete_isAllSuccessful_

subroutine is_all_successful(result)
logical, intent(out) :: result
result= (failed_assert_count .eq. 0 )
result= (failed_assert_count == 0 )
end subroutine is_all_successful

! Private, helper routine to wrap lines of success/failed marks
Expand All @@ -1117,7 +1119,7 @@ subroutine output_mark_( chr )

!$omp critical (FRUIT_OMP_ADD_OUTPUT_MARK)
linechar_count = linechar_count + 1
if ( linechar_count .lt. MAX_MARKS_PER_LINE ) then
if ( linechar_count < MAX_MARKS_PER_LINE ) then
write(stdout,"(A1)",ADVANCE='NO') chr
else
write(stdout,"(A1)",ADVANCE='YES') chr
Expand Down
24 changes: 22 additions & 2 deletions shum_byteswap/test/fruit_test_shum_byteswap.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,30 @@
!*******************************************************************************
MODULE fruit_test_shum_byteswap_mod

USE fruit
USE fruit, ONLY: assert_equals, assert_true, run_test_case, set_case_name
USE, INTRINSIC :: ISO_C_BINDING, ONLY: &
C_INT64_T, C_INT32_T, C_FLOAT, C_DOUBLE, C_BOOL
USE f_shum_ztables_mod
USE f_shum_ztables_mod, ONLY: &
z0000000000000040, z0000000000000840, z0000000000001040, &
z0000000000001440, z0000000000001840, z0000000000001C40, &
z0000000000002040, z0000000000002240, z0000000000002440, &
z000000000000F03F, z0000000001000000, z0000000002000000, &
z0000000003000000, z0000000004000000, z0000000005000000, &
z0000000006000000, z0000000007000000, z0000000008000000, &
z0000000009000000, z000000000A000000, z00000040, &
z0000004000000000, z00000041, z0000084000000000, &
z0000104000000000, z00001041, z0000144000000000, &
z0000184000000000, z00001C4000000000, z0000204000000000, &
z00002041, z0000224000000000, z0000244000000000, &
z00004040, z0000803F, z00008040, &
z0000A040, z0000C040, z0000E040, &
z0000F03F00000000, z01000000, z0100000000000000, &
z02000000, z0200000000000000, z03000000, &
z0300000000000000, z04000000, z0400000000000000, &
z05000000, z0500000000000000, z06000000, &
z0600000000000000, z07000000, z0700000000000000, &
z08000000, z0800000000000000, z09000000, &
z0900000000000000, z0A000000, z0A00000000000000

IMPLICIT NONE
PRIVATE
Expand Down
Loading