From 6292b9647c3365862f683badec0b6b5562e76f01 Mon Sep 17 00:00:00 2001 From: James Bruten <109733895+james-bruten-mo@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:17:43 +0000 Subject: [PATCH 1/3] Setup files (#1) Initial file changes for github. --- .github/pull_request_template.md | 97 +++++++++++++ .github/workflows/check-cr-approved.yaml | 11 ++ .gitignore | 5 + LICENCE | 28 ++++ README | 172 ----------------------- README.md | 122 ++++++++++++++++ 6 files changed, 263 insertions(+), 172 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/check-cr-approved.yaml create mode 100644 .gitignore create mode 100644 LICENCE delete mode 100644 README create mode 100644 README.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..1a8c61e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,97 @@ +# PR Summary + +Sci/Tech Reviewer: +Code Reviewer: + + + + + + + + + +## Code Quality Checklist + +(_Some checks are automatically carried out via the CI pipeline_) + +- [ ] I have performed a self-review of my own code +- [ ] My code follows the project's style guidelines +- [ ] Comments have been included that aid undertanding and enhance the + readability of the code +- [ ] My changes generate no new warnings + +## Testing + +- [ ] If shared files have been modified, I have run the UM and LFRic Apps rose + stem suites +- [ ] If any tests fail (rose-stem or CI) the reason is understood and + acceptable (eg. kgo changes) +- [ ] I have added tests to cover new functionality as appropriate (eg. system + tests, unit tests, etc.) + + + +### trac.log + + + +## Security Considerations + +- [ ] I have reviewed my changes for potential security issues +- [ ] Sensitive data is properly handled (if applicable) +- [ ] Authentication and authorisation are properly implemented (if applicable) + +## Performance Impact + +- [ ] Performance of the code has been considered and, if applicable, suitable + performance measurements have been conducted + +## 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](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html) + (including attribution labels) + + + +## Documentation + +- [ ] Where appropriate I have updated documentation related to this change and + confirmed that it builds correctly + +# Sci/Tech Review + + + + +- [ ] I understand this area of code and the changes being added +- [ ] The proposed changes correspond to the pull request description +- [ ] Documentation is sufficient (do documentation papers need updating) +- [ ] Sufficient testing has been completed + +_Please alert the code reviewer via a tag when you have approved the SR_ + +# Code Review + + + +- [ ] All dependencies have been resolved +- [ ] 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 diff --git a/.github/workflows/check-cr-approved.yaml b/.github/workflows/check-cr-approved.yaml new file mode 100644 index 0000000..9b66712 --- /dev/null +++ b/.github/workflows/check-cr-approved.yaml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..58d9166 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +__pycache__ +.vscode +.idea +*.pyc +.pytest_cache diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..5f36cd7 --- /dev/null +++ b/LICENCE @@ -0,0 +1,28 @@ +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: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + 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. + +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. diff --git a/README b/README deleted file mode 100644 index 0feb603..0000000 --- a/README +++ /dev/null @@ -1,172 +0,0 @@ - -SOCRATES -Suite Of Community RAdiative Transfer codes based on Edwards and Slingo ------------------------------------------------------------------------ - -Contents: - -0) Licence -1) What's included? -2) Compiling the source code within the Met Office -3) Compiling the source code externally -4) Compilation of scripts in sbin -5) Running the code -6) Tested compilers -7) Reporting bugs and receiving updates - - -0) BSD 3-Clause licence ------------------------ - -(C) Crown copyright Met Office. All rights reserved. -For further details please refer to the file COPYRIGHT.txt -which you should have received as part of this distribution. - - -1) What's included? -------------------- - -You should have received this package as a tar file containing the -directories: src/ make/ data/ examples/ idl/ python/ man/ sbin/ docs/ - -src/ contains the source code in Fortran 95 (.f90) and a few remaining -in Fortran 77 (.f). - -make/ contains the Makefile which then accesses the various Mk_* -files. - -sbin/ contains scripts that can be used to run the fortran routines. - -man/ contains man pages for scripts in sbin/. For example, running -'man Cl_run_cdf' will give options for that script. - -examples/ and data/ provide test input for the radiation code. -See the CONTENTS in each directory under examples/ for instructions. - -idl/ and python/ contain scripts to generate atmospheric profiles etc -in netCDF format to be used as input for the radiation code (l_run_cdf). - -docs/ contain the user guide and technical guide for the ES code. - - -2) Compiling the source code within the Met Office --------------------------------------------------- - -For users within the Met Office simply run the command: - -./build_code - -to compile the entire suite. To setup your path to the executables -and man pages you should then source the following file: - -. ./set_rad_env - -Individual programs can also be compiled using the build_code script -(build_code will take as an argument the target to pass to the makefile). - -For example, to build the routines that don't require netCDF: - -./build_code cdl - -To build just the two-stream/radiance code (netCDF version): - -./build_code l_run_cdf - - -3) Compiling the source code externally ---------------------------------------- - -For external users it should only be necessary to edit the file -make/Mk_cmd to allow compilation of the code on your system. FORTCOMP -and LINK can be changed to your local Fortran compiler. To use the netCDF -routines you must also change INCCDF_PATH and LIBCDF_PATH to point to -your local netCDF installation. - -The following commands can then be run to build the suite and setup -your path to the executables and man pages: - -./build_code -. ./set_rad_env - -See section 2 for building individual routines. - - -4) Compilation of scripts in sbin ---------------------------------- - -There are a small number of utilities in sbin/ which are written -in C and require compilation. A Makefile has been provided: - -cd $RAD_SCRIPT -make - - -5) Running the code -------------------- - -Once you have set your path to the man pages (see section 2/3) you can -find up-to-date instructions for running the following routines: - -Two-stream and spherical harmonics radiance codes using netCDF or -text CDL input files: - -man Cl_run_cdf -man Cl_run_cdl - -A Mie scattering code for determining optical properties of aerosol -and cloud particles: - -man Cscatter - -A correlated-k code for the calculation of gaseous absorption -coefficients for the spectral files either directly from HITRAN -.par or .xsc databases or line-by-line absorption coefficients in -a netCDF input file: - -man Ccorr_k - -Auxillary routines for format conversion, interpolation etc: - -man Ccdf2cdl -man Ccdl2cdf -man Cinterp - -These scripts are a command line interface to interactive routines in -the bin/ directory. These routines may be run directly if desired (eg. -l_run_cdf). - -It is very useful to study the examples/ directory for common usage -of the code. - - -6) Tested compilers -------------------- - -The full suite has been tested with the following compilers: - -Intel ifort 19 -GCC gfortran 12.2 - -To use these compilers within the Met Office run, respectively: -./build_code azure_ifort19 -./build_code azure_gfortran12 - -On the Monsoon3 collaboration machine: -./build_code monsoon3_gfortran12 - -7) Reporting bugs and receiving updates ---------------------------------------- - -Please report any bugs or suggestions to -James Manners . - -The code is held in a subversion repository here: - -https://code.metoffice.gov.uk/trac/socrates - -Accounts to access the repository are given on request. Please provide -your name and the email address you wish to use for the account to either -Scientific_Partnerships@metoffice.gov.uk or james.manners@metoffice.gov.uk. -Tutorials and package updates are provided on the repository trac pages. - -James Manners 7.10.25 diff --git a/README.md b/README.md new file mode 100644 index 0000000..a4776aa --- /dev/null +++ b/README.md @@ -0,0 +1,122 @@ + +# SOCRATES - Suite Of Community RAdiative Transfer codes based on Edwards and Slingo + +## What's included? + +You should have received this package as a tar file containing the +directories: src/ make/ data/ examples/ idl/ python/ man/ sbin/ docs/ + +`src/` contains the source code in Fortran 95 (.f90) and a few remaining +in Fortran 77 (.f). + +`make/` contains the Makefile which then accesses the various Mk_* +files. + +`sbin/` contains scripts that can be used to run the fortran routines. + +`man/` contains man pages for scripts in sbin/. For example, running +`man Cl_run_cdf` will give options for that script. + +`examples/` and `data/` provide test input for the radiation code. +See the CONTENTS in each directory under examples/ for instructions. + +`idl/` and `python/` contain scripts to generate atmospheric profiles etc +in netCDF format to be used as input for the radiation code (l_run_cdf). + +`docs/` contain the user guide and technical guide for the ES code. + +## Compiling the source code within the Met Office + +For users within the Met Office simply run the command: + +`./build_code` + +to compile the entire suite. To setup your path to the executables +and man pages you should then source the following file: + +`. ./set_rad_env` + +Individual programs can also be compiled using the build_code script +(build_code will take as an argument the target to pass to the makefile). + +For example, to build the routines that don't require netCDF: + +`./build_code cdl` + +To build just the two-stream/radiance code (netCDF version): + +`./build_code l_run_cdf` + +## Compiling the source code externally + +For external users it should only be necessary to edit the file +make/Mk_cmd to allow compilation of the code on your system. FORTCOMP +and LINK can be changed to your local Fortran compiler. To use the netCDF +routines you must also change INCCDF_PATH and LIBCDF_PATH to point to +your local netCDF installation. + +The following commands can then be run to build the suite and setup +your path to the executables and man pages: + +`./build_code` +`. ./set_rad_env` + +See previous section for building individual routines. + +## Compilation of scripts in sbin + +There are a small number of utilities in sbin/ which are written +in C and require compilation. A Makefile has been provided: + +`cd $RAD_SCRIPT` +`make` + +## Running the code + +Once you have set your path to the man pages (see section 2/3) you can +find up-to-date instructions for running the following routines: + +Two-stream and spherical harmonics radiance codes using netCDF or +text CDL input files: + +`man Cl_run_cdf` +`man Cl_run_cdl` + +A Mie scattering code for determining optical properties of aerosol +and cloud particles: + +`man Cscatter` + +A correlated-k code for the calculation of gaseous absorption +coefficients for the spectral files either directly from HITRAN +.par or .xsc databases or line-by-line absorption coefficients in +a netCDF input file: + +`man Ccorr_k` + +Auxillary routines for format conversion, interpolation etc: + +`man Ccdf2cdl` +`man Ccdl2cdf` +`man Cinterp` + +These scripts are a command line interface to interactive routines in +the bin/ directory. These routines may be run directly if desired (eg. +l_run_cdf). + +It is very useful to study the examples/ directory for common usage +of the code. + +## Tested compilers + +The full suite has been tested with the following compilers: + +Intel ifort 19 +GCC gfortran 12.2 + +To use these compilers within the Met Office run, respectively: +`./build_code azure_ifort19` +`./build_code azure_gfortran12` + +On the Monsoon3 collaboration machine: +`./build_code monsoon3_gfortran12` From 2570ec3fe3516639c9d63dc3914d26a5960683ab Mon Sep 17 00:00:00 2001 From: Yaswant Pradhan <2984440+yaswant@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:48:41 +0000 Subject: [PATCH 2/3] Update repository attributes for CDL (#4) --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..db2cfc6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# NetCDF CDL (Common Data Language) +*.[pqt] linguist-language=CDL From 19f031ee4151f6eed0a2acc5a86ce484762eebfb Mon Sep 17 00:00:00 2001 From: James Bruten <109733895+james-bruten-mo@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:52:44 +0000 Subject: [PATCH 3/3] Add cla files (#5) --- .github/workflows/cla-check.yaml | 10 +++++++++ CONTRIBUTORS.md | 5 +++++ README.md | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 .github/workflows/cla-check.yaml create mode 100644 CONTRIBUTORS.md diff --git a/.github/workflows/cla-check.yaml b/.github/workflows/cla-check.yaml new file mode 100644 index 0000000..3d28d73 --- /dev/null +++ b/.github/workflows/cla-check.yaml @@ -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' diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..c34eb45 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +# Contributors + +| GitHub user | Real Name | Affiliation | Date | +| ----------- | --------- | ----------- | ---- | +| james-bruten-mo | James Bruten | Met Office | 2025-12-09 | diff --git a/README.md b/README.md index a4776aa..349b325 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,41 @@ # SOCRATES - Suite Of Community RAdiative Transfer codes based on Edwards and Slingo +## 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) + ## What's included? You should have received this package as a tar file containing the