├── .github └── workflows │ └── CI.yml ├── .gitignore ├── LICENSE.txt ├── README.md ├── astro-fortran.code-workspace ├── astro-fortran.md ├── codecov.yml ├── fpm.toml ├── src └── astro_module.f90 └── test └── t_sofa_f.f90 /.github/workflows/CI.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [push] 3 | jobs: 4 | 5 | Build: 6 | runs-on: ${{ matrix.os }} 7 | strategy: 8 | fail-fast: false 9 | matrix: 10 | os: [ubuntu-latest] 11 | gcc_v: [10] # Version of GFortran we want to use. 12 | python-version: [3.9] 13 | env: 14 | FC: gfortran-${{ matrix.gcc_v }} 15 | GCC_V: ${{ matrix.gcc_v }} 16 | 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v2 20 | with: 21 | submodules: recursive 22 | 23 | - name: Set up Python 3.x 24 | uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc. 25 | with: 26 | python-version: ${{ matrix.python-version }} 27 | 28 | - name: Setup Graphviz 29 | uses: ts-graphviz/setup-graphviz@v1 30 | 31 | - name: Setup Fortran Package Manager 32 | uses: fortran-lang/setup-fpm@v4 33 | with: 34 | github-token: ${{ secrets.GITHUB_TOKEN }} 35 | 36 | - name: Install Python dependencies 37 | if: contains( matrix.os, 'ubuntu') 38 | run: | 39 | python -m pip install --upgrade pip 40 | pip install matplotlib ford 41 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 42 | 43 | - name: Install GFortran Linux 44 | if: contains( matrix.os, 'ubuntu') 45 | run: | 46 | sudo apt-get install lcov 47 | sudo update-alternatives \ 48 | --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc_v }} 100 \ 49 | --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc_v }} \ 50 | --slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.gcc_v }} 51 | 52 | # - name: Compile 53 | # run: fpm build --profile release 54 | 55 | - name: Run tests 56 | run: fpm test --profile debug --flag -coverage 57 | 58 | - name: Create coverage report 59 | run: | 60 | mkdir -p ${{ env.COV_DIR }} 61 | lcov --capture --initial --base-directory . --directory build/gfortran_*/ --output-file ${{ env.COV_DIR }}/coverage.base 62 | lcov --capture --base-directory . --directory build/gfortran_*/ --output-file ${{ env.COV_DIR }}/coverage.capture 63 | lcov --add-tracefile ${{ env.COV_DIR }}/coverage.base --add-tracefile ${{ env.COV_DIR }}/coverage.capture --output-file ${{ env.COV_DIR }}/coverage.info 64 | env: 65 | COV_DIR: build/coverage 66 | 67 | - name: Upload coverage report 68 | uses: codecov/codecov-action@v2 69 | with: 70 | files: build/coverage/coverage.info 71 | 72 | - name: Build documentation 73 | run: ford ./astro-fortran.md 74 | 75 | - name: Deploy Documentation 76 | if: github.ref == 'refs/heads/master' 77 | uses: JamesIves/github-pages-deploy-action@4.1.0 78 | with: 79 | branch: gh-pages # The branch the action should deploy to. 80 | folder: doc # The folder the action should deploy. 81 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # directories 35 | bin 36 | doc 37 | lib 38 | archive 39 | 40 | # mac 41 | .DS_Store -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | ASTRO-FORTRAN: Modern Fortran implementations of standard models used in fundamental astronomy 2 | https://github.com/jacobwilliams/astro-fortran 3 | 4 | Copyright (c) 2019-2022, Jacob Williams 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, this 14 | list of conditions and the following disclaimer in the documentation and/or 15 | other materials provided with the distribution. 16 | 17 | * The names of its contributors may not be used to endorse or promote products 18 | derived from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 24 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 27 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ******************************************************************************** 32 | Original SOFA Copyright Notice 33 | ******************************************************************************** 34 | 35 | Copyright (C) 2019 36 | Standards Of Fundamental Astronomy Board 37 | of the International Astronomical Union. 38 | 39 | ===================== 40 | SOFA Software License 41 | ===================== 42 | 43 | NOTICE TO USER: 44 | 45 | BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND 46 | CONDITIONS WHICH APPLY TO ITS USE. 47 | 48 | 1. The Software is owned by the IAU SOFA Board ("SOFA"). 49 | 50 | 2. Permission is granted to anyone to use the SOFA software for any 51 | purpose, including commercial applications, free of charge and 52 | without payment of royalties, subject to the conditions and 53 | restrictions listed below. 54 | 55 | 3. You (the user) may copy and distribute SOFA source code to others, 56 | and use and adapt its code and algorithms in your own software, 57 | on a world-wide, royalty-free basis. That portion of your 58 | distribution that does not consist of intact and unchanged copies 59 | of SOFA source code files is a "derived work" that must comply 60 | with the following requirements: 61 | 62 | a) Your work shall be marked or carry a statement that it 63 | (i) uses routines and computations derived by you from 64 | software provided by SOFA under license to you; and 65 | (ii) does not itself constitute software provided by and/or 66 | endorsed by SOFA. 67 | 68 | b) The source code of your derived work must contain descriptions 69 | of how the derived work is based upon, contains and/or differs 70 | from the original SOFA software. 71 | 72 | c) The names of all routines in your derived work shall not 73 | include the prefix "iau" or "sofa" or trivial modifications 74 | thereof such as changes of case. 75 | 76 | d) The origin of the SOFA components of your derived work must 77 | not be misrepresented; you must not claim that you wrote the 78 | original software, nor file a patent application for SOFA 79 | software or algorithms embedded in the SOFA software. 80 | 81 | e) These requirements must be reproduced intact in any source 82 | distribution and shall apply to anyone to whom you have 83 | granted a further right to modify the source code of your 84 | derived work. 85 | 86 | Note that, as originally distributed, the SOFA software is 87 | intended to be a definitive implementation of the IAU standards, 88 | and consequently third-party modifications are discouraged. All 89 | variations, no matter how minor, must be explicitly marked as 90 | such, as explained above. 91 | 92 | 4. You shall not cause the SOFA software to be brought into 93 | disrepute, either by misuse, or use for inappropriate tasks, or 94 | by inappropriate modification. 95 | 96 | 5. The SOFA software is provided "as is" and SOFA makes no warranty 97 | as to its use or performance. SOFA does not and cannot warrant 98 | the performance or results which the user may obtain by using the 99 | SOFA software. SOFA makes no warranties, express or implied, as 100 | to non-infringement of third party rights, merchantability, or 101 | fitness for any particular purpose. In no event will SOFA be 102 | liable to the user for any consequential, incidental, or special 103 | damages, including any lost profits or lost savings, even if a 104 | SOFA representative has been advised of such damages, or for any 105 | claim by any third party. 106 | 107 | 6. The provision of any version of the SOFA software under the terms 108 | and conditions specified herein does not imply that future 109 | versions will also be made available under the same terms and 110 | conditions. 111 | 112 | In any published work or commercial product which uses the SOFA 113 | software directly, acknowledgement (see www.iausofa.org) is 114 | appreciated. 115 | 116 | Correspondence concerning SOFA software should be addressed as 117 | follows: 118 | 119 | By email: sofa@ukho.gov.uk 120 | By post: IAU SOFA Center 121 | HM Nautical Almanac Office 122 | UK Hydrographic Office 123 | Admiralty Way, Taunton 124 | Somerset, TA1 2DN 125 | United Kingdom 126 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ### Brief description 3 | 4 | A refactoring of the IAU SOFA library to modern Fortran standards. 5 | 6 | This is based on the 2019-07-22 Fortran 77 SOFA Release. 7 | 8 | ### Status 9 | 10 | [![GitHub release](https://img.shields.io/github/release/jacobwilliams/astro-fortran.svg)](https://github.com/jacobwilliams/astro-fortran/releases/latest) 11 | [![Build Status](https://github.com/jacobwilliams/astro-fortran/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/astro-fortran/actions) 12 | [![codecov](https://codecov.io/gh/jacobwilliams/astro-fortran/branch/master/graph/badge.svg?token=43HK33CSMY)](https://codecov.io/gh/jacobwilliams/astro-fortran) 13 | [![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/astro-fortran)](https://github.com/jacobwilliams/astro-fortran/commits/master) 14 | 15 | ### Compiling 16 | 17 | A [Fortran Package Manager](https://github.com/fortran-lang/fpm) manifest file is included, so that the library and tests cases can be compiled with FPM. For example: 18 | 19 | ``` 20 | fpm build --profile release 21 | fpm test --profile release 22 | ``` 23 | 24 | To use `astro-fortran` within your FPM project, add the following to your `fpm.toml` file: 25 | ```toml 26 | [dependencies] 27 | astro-fortran = { git="https://github.com/jacobwilliams/astro-fortran.git" } 28 | ``` 29 | 30 | To generate the documentation using [FORD](https://github.com/Fortran-FOSS-Programmers/ford), run: 31 | 32 | ``` 33 | ford astro-fortran.md 34 | ``` 35 | 36 | ### Documentation 37 | 38 | The latest API documentation can be found [here](https://jacobwilliams.github.io/astro-fortran/). This was generated from the source code using [FORD](https://github.com/Fortran-FOSS-Programmers/ford). 39 | 40 | ### License 41 | 42 | The astro-fortran source code and related files and documentation are distributed under a permissive free software [license](https://github.com/jacobwilliams/astro-fortran/blob/master/LICENSE.txt) (BSD-style). 43 | 44 | ### See also 45 | 46 | * [SPICE](http://naif.jpl.nasa.gov/naif/toolkit.html) 47 | * [NOVAS](http://aa.usno.navy.mil/software/novas/novas_info.php) 48 | * [SOFA](http://www.iausofa.org) (mirrored [here](https://github.com/jacobwilliams/IAU_SOFA) on GitHub) 49 | * [Fortran Astrodynamics Toolkit](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit) -------------------------------------------------------------------------------- /astro-fortran.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": { 8 | "files.trimTrailingWhitespace": true, 9 | "editor.insertSpaces": true, 10 | "editor.tabSize": 4, 11 | "editor.trimAutoWhitespace": true 12 | } 13 | } -------------------------------------------------------------------------------- /astro-fortran.md: -------------------------------------------------------------------------------- 1 | project: astro-fortran 2 | project_dir: ./src 3 | output_dir: ./doc 4 | media_dir: ./media 5 | project_github: https://github.com/jacobwilliams/astro-fortran 6 | summary: astro-fortran -- Modern Fortran implementations of standard models used in fundamental astronomy 7 | author: Jacob Williams 8 | github: https://github.com/jacobwilliams 9 | predocmark_alt: > 10 | predocmark: < 11 | docmark_alt: 12 | docmark: ! 13 | display: public 14 | source: true 15 | graph: true 16 | exclude: test.f90 17 | exclude_dir: ./src/tests 18 | 19 | {!README.md!} 20 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: header, changes, diff, sunburst 3 | coverage: 4 | ignore: 5 | - test 6 | - doc 7 | status: 8 | patch: 9 | default: 10 | target: 70% 11 | project: 12 | default: 13 | target: 60% 14 | -------------------------------------------------------------------------------- /fpm.toml: -------------------------------------------------------------------------------- 1 | name = "astro-fortran" 2 | author = "Jacob Williams" 3 | copyright = "Copyright (c) 2019-2022, Jacob Williams. Copyright (C) 2019 Standards Of Fundamental Astronomy Board of the International Astronomical Union." 4 | license = "BSD-3" 5 | description = "A refactoring of the IAU SOFA library to modern Fortran standards" 6 | homepage = "https://github.com/jacobwilliams/astro-fortran" 7 | keywords = ["astrometry"] 8 | 9 | [build] 10 | auto-executables = false 11 | auto-examples = false 12 | auto-tests = true 13 | 14 | [library] 15 | source-dir = "src" 16 | 17 | [install] 18 | library = true --------------------------------------------------------------------------------