Skip to content
This repository has been archived by the owner on Jul 18, 2021. It is now read-only.
/ resonances-fortran Public archive

Three-body/Two-body mean motion resonances finder in Solar System

License

Notifications You must be signed in to change notification settings

smirik/resonances-fortran

Repository files navigation

Build Status Build Status

The purpose of the program is to find potential resonances for asteroids and identify them. Currently, 2-body and 3-body cases are available for handling.

The software consists of the following modules:

  • resonant axis calculator,
  • resonance finder,
  • integrator (mercury6 is used),
  • phase builder,
  • classifier,
  • compositor etc.

For the references, please use:

  1. Smirnov E., Dovgalev I. and Popova E. Asteroids in three-body mean motion resonances with planets. Icarus. 2017. (https://doi.org/10.1016/j.icarus.2017.09.032)
  2. Smirnov E., Shevchenko I. Massive identification of asteroids in three-body resonances. Icarus. 2013. (http://dx.doi.org/10.1016/j.icarus.2012.10.034)

Usage

There are some logical keys in global_parameters.f90 that can be configured to make a special mode of running the program. Those keys are:

  • force_source_building: if true, the program will create new binary source file and replace existing (requires basic source file allnum.cat from AstDyS catalog).
  • use_only_integration: if true, the program will just perform an integration (using Mercury6 package) and create .aei files without finding any resonances.
  • just_id_matrices will force the program only create files with id_matrices without finding any resonances and .aei files
  • force_aei_rebuilding: if true, the integration will be performed even if corresponding .aei files already exist
  • mode_2body: turns on 2-body case
  • mode_3body turns on 3-body case

When all keys are configured, the program can be launched.

Use program

  1. Download AstDyS catalog of the orbital elements (allnum.cat by default) and move to the input directory or, if you have installed Python 3 on your computer, run:
make source

The currently used catalog version is available at AstDyS 'allnum.cat'. At the first time the program will build the binary source file asteroids.bin from it. This file will be used in consequent sessions.

  1. To compile the software run:
make

After these steps you can use the program:

./comp.x [-range | -list] <argument list/range>
  • if -list key is used, just provide a list of asteroid names.
  • if -range key is used, specify only first and last asteroid.
  • Don't forget to update mercury/param.in.sample before the compilation and set the end date you want (in case of 100000 years you may set it to stop time (days) = 38982600.5d0).

Examples

./comp.x -list 1013 99942 309239 499
./comp.x -range 1 1000

Run under docker

Note that you should have a folder called /root/output (or replace it with another one) that has 4 sub-folders: aei, aei_planets, id_matrices, results. It will be mounted to docker in order to save the results in the files.

Of course, you have to install docker locally.

docker run -v /root/output:/root/resonances/output smirik/resonances-fortran ./comp.x -list 490 2348
docker run -v /root/output:/root/resonances/output smirik/resonances-fortran ./comp.x -range 1 100

If you want to build a new container:

docker build -t yourname/your-container-name .

Meta information

  • When the program finishes, .aei files will be created and placed in ./output/aei/ directory, and .aei files for planets will appear in ./output/aei_planets/.
  • Files with id_matrices will appear in ./output/id_matrices/ directory. The files with results by resonances will be placed in ./output/results/ directory.
  • The common files result_2body.txt and result_2body.txt contain the information about all found resonances over all given asteroid list. Each record includes:
    • Asteroid name
    • Resonance (with planets and numbers)
    • Classification verdict (1 - pure resonance, 0 - transient)

Cleaning

The command make clean frees the disk memory from temporary files (including metadata, object files etc). Graphics, .rpout and .aei files will not be deleted.

Running tests

  1. resonances-fortran uses funit gem for unit tests. To install it:
sudo gem install funit

Please make sure that you have ruby installed.

You should also export FC variable (and some other variables if they are not):

export FC="gfortran"
export CXX="g++"
export CC="gcc"
export FSFLAG=-I
  1. To launch tests run:
make tests

After launching the tests please make sure that you clean the directory:

make clean