diff --git a/.gitignore b/.gitignore index 8b868b2..d0d0593 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,10 @@ Release # misc .DS_Store *.suo -*.pdb \ No newline at end of file +*.pdb + +# test artifacts +/*.txt +/*.png +/*.csv +/*.py \ No newline at end of file diff --git a/README.md b/README.md index e515a0f..46874f1 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ============ [![GitHub release](https://img.shields.io/github/release/jacobwilliams/Fortran-Astrodynamics-Toolkit.svg?style=plastic)](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/releases/latest) -[![DOI](https://zenodo.org/badge/21782788.svg)](https://zenodo.org/badge/latestdoi/21782788) [![Build Status](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/actions) [![codecov](https://codecov.io/gh/jacobwilliams/Fortran-Astrodynamics-Toolkit/branch/master/graph/badge.svg?token=BHtd51oUTE)](https://codecov.io/gh/jacobwilliams/Fortran-Astrodynamics-Toolkit) +[![DOI](https://zenodo.org/badge/21782788.svg)](https://zenodo.org/badge/latestdoi/21782788) ![Image](https://raw.githubusercontent.com/jacobwilliams/Fortran-Astrodynamics-Toolkit/master/tests/pork_chop/pork_chop.png) @@ -63,16 +63,7 @@ fpm build --profile release fpm test --profile release ``` -A [FoBiS](https://github.com/szaghi/FoBiS) configuration file (`fortran-astrodynamics-toolkit.fobis`) is also provided that can build the library and examples. Use the `mode` flag to indicate what to build. For example: - -* To build all the examples using gfortran: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode tests-gnu` -* To build all the examples using ifort: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode tests-intel` -* To build a static library using gfortran: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode static-gnu` -* To build a static library using ifort: `FoBiS.py build -f fortran-astrodynamics-toolkit.fobis -mode static-intel` - -The full set of modes are: `static-gnu`, `static-gnu-debug`, `static-intel`, `static-intel-debug`, `shared-gnu`, `shared-gnu-debug`, `shared-intel`, `shared-intel-debug`, `tests-gnu`, `tests-gnu-debug`, `tests-intel`, `tests-intel-debug` - -To generate the documentation using [ford](https://github.com/Fortran-FOSS-Programmers/ford), run: ```FoBis.py rule --execute makedoc -f fortran-astrodynamics-toolkit.fobis``` +To generate the documentation using [ford](https://github.com/Fortran-FOSS-Programmers/ford), run: `ford fortran-astrodynamics-toolkit.md` ## Third-Party Requirements @@ -80,7 +71,7 @@ A script `get_third_party.sh` is included to download and build the third-party ### Pyplot-Fortran -The plots generated by the examples are done using the [pyplot-fortran](https://github.com/jacobwilliams/pyplot-fortran) module. When compiling with FPM, this will automatically be downloaded and compiled. If using FoBiS, you must obtain this manually. +The plots generated by the examples are done using the [pyplot-fortran](https://github.com/jacobwilliams/pyplot-fortran) module. When compiling with FPM, this will automatically be downloaded and compiled. ### Ephemeris files diff --git a/fortran-astrodynamics-toolkit.fobis b/fortran-astrodynamics-toolkit.fobis deleted file mode 100644 index 652e467..0000000 --- a/fortran-astrodynamics-toolkit.fobis +++ /dev/null @@ -1,233 +0,0 @@ -[modes] -modes = static-gnu static-gnu-debug - static-intel static-intel-debug - shared-gnu shared-gnu-debug - shared-intel shared-intel-debug - tests-gnu tests-gnu-debug - tests-intel tests-intel-debug - -[common-variables] -$MOD_FILE = fortran_astrodynamics_toolkit.f90 -$FORD_FILE = fortran-astrodynamics-toolkit.md -$STATIC_LIB = libfat.a -$SHARED_LIB = libfat.so -$OPTIMIZE = -O2 -$CSTATIC_GNU = -c -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function -pedantic -std=f2008ts -$DEBUG_GNU = -O0 -g3 -Warray-bounds -Wcharacter-truncation -Wline-truncation -Wimplicit-interface -Wimplicit-procedure -Wunderflow -fcheck=all -fmodule-private -ffree-line-length-132 -fimplicit-none -fbacktrace -fdump-core -finit-real=nan -std=f2008ts -fall-intrinsics -$CSTATIC_INT = -c -std18 -traceback -$DEBUG_INT = -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces -fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std15 -$EXDIRS = ./archive - ./tmp - ./pyplot-fortran/src/tests/ - -# main modes -# library -[static-gnu] -description = Build library with GNU gfortran by optimized-static flags -compiler = gnu -cflags = $CSTATIC_GNU $OPTIMIZE -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = static -target = $MOD_FILE -output = $STATIC_LIB -exclude_dirs = $EXDIRS - -[static-gnu-debug] -description = Build library with GNU gfortran by debug-static flags -compiler = gnu -cflags = $CSTATIC_GNU $DEBUG_GNU -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = static -target = $MOD_FILE -output = $STATIC_LIB -exclude_dirs = $EXDIRS - -[static-intel] -description = Build library with Intel Fortran by optimized-static flags -compiler = intel -cflags = $CSTATIC_INT $OPTIMIZE -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = static -target = $MOD_FILE -output = $STATIC_LIB -exclude_dirs = $EXDIRS - -[static-intel-debug] -description = Build library with Intel Fortran by debug-static flags -compiler = intel -cflags = $CSTATIC_INT $DEBUG_INT -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = static -target = $MOD_FILE -output = $STATIC_LIB -exclude_dirs = $EXDIRS - -[shared-gnu] -description = Build library with GNU gfortran by optimized-shared flags -compiler = gnu -cflags = $CSTATIC_GNU $OPTIMIZE -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = shared -target = $MOD_FILE -output = $SHARED_LIB -exclude_dirs = $EXDIRS - -[shared-gnu-debug] -description = Build library with GNU gfortran by debug-shared flags -compiler = gnu -cflags = $CSTATIC_GNU $DEBUG_GNU -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = shared -target = $MOD_FILE -output = $SHARED_LIB -exclude_dirs = $EXDIRS - -[shared-intel] -description = Build library with Intel Fortran by optimized-shared flags -compiler = intel -cflags = $CSTATIC_INT $OPTIMIZE -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = shared -target = $MOD_FILE -output = $SHARED_LIB -exclude_dirs = $EXDIRS - -[shared-intel-debug] -description = Build library with Intel Fortran by debug-shared flags -compiler = intel -cflags = $CSTATIC_INT $DEBUG_INT -cflags_heritage = True -build_dir = ./lib/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./src/ -colors = True -quiet = False -log = False -jobs = 2 -mklib = shared -target = $MOD_FILE -output = $SHARED_LIB -exclude_dirs = $EXDIRS - -# test programs -[tests-gnu] -description = Build all tests with GNU gfortran by optimized-static flags -compiler = gnu -cflags = $CSTATIC_GNU $OPTIMIZE -cflags_heritage = True -build_dir = ./bin/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./ -colors = True -quiet = False -log = False -jobs = 2 -exclude_dirs = $EXDIRS - -[tests-gnu-debug] -description = Build all tests with GNU gfortran by debug-static flags -compiler = gnu -cflags = $CSTATIC_GNU $DEBUG_GNU -cflags_heritage = True -build_dir = ./bin/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./ -colors = True -quiet = False -log = False -jobs = 2 -exclude_dirs = $EXDIRS - -[tests-intel] -description = Build all tests with Intel Fortran by optimized-static flags -compiler = intel -cflags = $CSTATIC_INT $OPTIMIZE -cflags_heritage = True -build_dir = ./bin/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./ -colors = True -quiet = False -log = False -jobs = 2 -exclude_dirs = $EXDIRS - -[tests-intel-debug] -description = Build all tests with Intel Fortran by debug-static flags -compiler = intel -cflags = $CSTATIC_INT $DEBUG_INT -cflags_heritage = True -build_dir = ./bin/ -mod_dir = ./mod/ -obj_dir = ./obj/ -src = ./ -colors = True -quiet = False -log = False -jobs = 2 -exclude_dirs = $EXDIRS - -# auxiliary rules -[rule-makedoc] -help = Rule for building documentation from source files -rule_1 = ford $FORD_FILE diff --git a/fpm.toml b/fpm.toml index 3d81fd2..8d560e3 100644 --- a/fpm.toml +++ b/fpm.toml @@ -55,8 +55,22 @@ name = "kepler_tests" source-dir = "tests/kepler" main = "kepler_tests.f90" -#... the ones that use the third-party components aren't enabled yet ... -# cw_test -# ephemeris_comparison -# fat_tests -# gravity_test +[[test]] +name = "cw_test" +source-dir = "tests/cw_test" +main = "cw_test.f90" + +[[test]] +name = "ephemeris_comparison" +source-dir = "tests/ephemeris" +main = "ephemeris_comparison.f90" + +[[test]] +name = "fat_tests" +source-dir = "tests/unit_tests" +main = "fat_tests.f90" + +[[test]] +name = "gravity_test" +source-dir = "tests/gravity" +main = "gravity_test.f90" diff --git a/src/geopotential_module.f90 b/src/geopotential_module.f90 index 101cdec..e70f8d2 100644 --- a/src/geopotential_module.f90 +++ b/src/geopotential_module.f90 @@ -1257,7 +1257,7 @@ subroutine geopotential_module_test() implicit none - character(len=*),parameter :: gravfile = '../grav/GGM03C.GEO' !! the coefficient file + character(len=*),parameter :: gravfile = './grav/GGM03C.GEO' !! the coefficient file class(geopotential_model),pointer :: g type(geopotential_model_mueller) ,target :: g_mueller diff --git a/src/jpl_ephemeris_module.f90 b/src/jpl_ephemeris_module.f90 index 22d323f..335b4cb 100644 --- a/src/jpl_ephemeris_module.f90 +++ b/src/jpl_ephemeris_module.f90 @@ -886,7 +886,7 @@ end subroutine get_constants ! !### Ephemeris files ! This routine requires the DE405 and DE421 JPL binary ephemeris files -! to be present in the `../eph` directory. +! to be present in the `./eph` directory. ! These can be built by using the instructions ! [here](ftp://ssd.jpl.nasa.gov/pub/eph/planets/fortran/userguide.txt). ! @@ -915,8 +915,8 @@ subroutine ephemeris_test() type(jpl_ephemeris) :: eph405, eph421 logical :: status_ok_405,status_ok_421 - character(len=*),parameter :: ephemeris_file_405 = '../eph/JPLEPH.405' !! JPL DE405 ephemeris file - character(len=*),parameter :: ephemeris_file_421 = '../eph/JPLEPH.421' !! JPL DE421 ephemeris file + character(len=*),parameter :: ephemeris_file_405 = './eph/JPLEPH.405' !! JPL DE405 ephemeris file + character(len=*),parameter :: ephemeris_file_421 = './eph/JPLEPH.421' !! JPL DE421 ephemeris file write(*,*) '' write(*,*) '---------------' diff --git a/src/transformation_module.f90 b/src/transformation_module.f90 index dc3d346..6d59f4d 100644 --- a/src/transformation_module.f90 +++ b/src/transformation_module.f90 @@ -690,7 +690,7 @@ subroutine transformation_module_test() 3.0_wp] !! km, km/s real(wp),parameter :: et = zero !! ephemeris time [sec] real(wp),parameter :: scale = 384400.0_wp !! scale factor [km] - character(len=*),parameter :: ephemeris_file_421 = '../eph/JPLEPH.421' !! JPL DE421 ephemeris file + character(len=*),parameter :: ephemeris_file_421 = './eph/JPLEPH.421' !! JPL DE421 ephemeris file type(icrf_frame) :: from type(two_body_rotating_pulsating_frame) :: to diff --git a/tests/cw_test/cw_test.f90 b/tests/cw_test/cw_test.f90 index 8c2e0f4..5241d29 100644 --- a/tests/cw_test/cw_test.f90 +++ b/tests/cw_test/cw_test.f90 @@ -30,7 +30,7 @@ program cw_test real(wp),parameter :: mu_earth = 398600.4418_wp !! grav. param of earth [km3/s2] real(wp),parameter :: orbit_inc = 45.0_wp*deg2rad !! orbit inclination [rad] real(wp),parameter :: orbit_sma = 6778.0_wp !! orbit semimajor axis [km] - character(len=*),parameter :: gravfile = '../grav/GGM03C.GEO' !! grav coefficient file + character(len=*),parameter :: gravfile = './grav/GGM03C.GEO' !! grav coefficient file integer,parameter :: grav_n = 10 !! max degree integer,parameter :: grav_m = 10 !! max order real(wp),dimension(3),parameter :: r_chaser_lvlh = [1.0_wp,1.0_wp,1.0_wp] !! chaser r relative to target (LVLH) diff --git a/tests/ephemeris/ephemeris_comparison.f90 b/tests/ephemeris/ephemeris_comparison.f90 index 720f752..168590a 100644 --- a/tests/ephemeris/ephemeris_comparison.f90 +++ b/tests/ephemeris/ephemeris_comparison.f90 @@ -19,7 +19,7 @@ program ephemeris_comparison integer :: i integer :: jd_start, jd_end - character(len=*),parameter :: ephemeris_file_405 = '../eph/JPLEPH.405' !! JPL DE405 ephemeris file + character(len=*),parameter :: ephemeris_file_405 = './eph/JPLEPH.405' !! JPL DE405 ephemeris file write(*,*) '' write(*,*) '---------------' diff --git a/tests/gravity/gravity_test.f90 b/tests/gravity/gravity_test.f90 index d9481f2..a38c389 100644 --- a/tests/gravity/gravity_test.f90 +++ b/tests/gravity/gravity_test.f90 @@ -22,7 +22,7 @@ program gravity_test real(wp),parameter :: orbit_sma = 6778.0_wp !orbit semimajor axis [km] !the coefficient file: - character(len=*),parameter :: gravfile = '../grav/GGM03C.GEO' + character(len=*),parameter :: gravfile = './grav/GGM03C.GEO' integer,parameter :: grav_n = 10 !max degree integer,parameter :: grav_m = 10 !max order