Skip to content

Commit acd97ad

Browse files
committed
move a constant
some formatting and notes
1 parent 03f0e4b commit acd97ad

File tree

3 files changed

+17
-30
lines changed

3 files changed

+17
-30
lines changed

src/celestial_body_module.f90

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,25 @@ module celestial_body_module
1515
!! A celestial body (Planet, moon, etc.)
1616
!! The `ID` from the [[base_class]] is the NAIF SPICE ID code for the body
1717
real(wp) :: mu = zero !! gravitational parameter \( \mu \) [\(km^3/s^2\)]
18+
!note: also should add radius, etc.
1819
end type celestial_body
1920

20-
21-
type(celestial_body),parameter,public :: body_ssb = &
22-
celestial_body(0, 'SSB', 0.0_wp ) !! solar-system barycenter
21+
type(celestial_body),parameter,public :: body_ssb = celestial_body(0, 'SSB', 0.0_wp ) !! solar-system barycenter [note: don't have mu defined here yet]
2322

2423
!define some bodies:
2524
! MU values from: https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/gm_de431.tpc
26-
type(celestial_body),parameter,public :: body_sun = &
27-
celestial_body(10, 'Sun',1.3271244004193938E+11_wp )
28-
type(celestial_body),parameter,public :: body_mercury = &
29-
celestial_body(199,'Mercury',2.2031780000000021E+04_wp )
30-
type(celestial_body),parameter,public :: body_venus = &
31-
celestial_body(299,'Venus',3.2485859200000006E+05_wp )
32-
type(celestial_body),parameter,public :: body_earth = &
33-
celestial_body(399,'Earth',3.9860043543609598E+05_wp )
34-
type(celestial_body),parameter,public :: body_earth_moon_barycenter = &
35-
celestial_body(3,'Earth-Moon Barycenter',4.0350323550225981E+05_wp )
36-
type(celestial_body),parameter,public :: body_moon = &
37-
celestial_body(301,'Moon',4.9028000661637961E+03_wp )
38-
type(celestial_body),parameter,public :: body_mars = &
39-
celestial_body(499,'Mars',4.282837362069909E+04_wp )
40-
type(celestial_body),parameter,public :: body_jupiter = &
41-
celestial_body(599,'Jupiter',1.266865349218008E+08_wp )
42-
type(celestial_body),parameter,public :: body_saturn = &
43-
celestial_body(699,'Saturn',3.793120749865224E+07_wp )
44-
type(celestial_body),parameter,public :: body_uranus = &
45-
celestial_body(799,'Uranus',5.793951322279009E+06_wp )
46-
type(celestial_body),parameter,public :: body_neptune = &
47-
celestial_body(899,'Neptune',6.835099502439672E+06_wp )
48-
type(celestial_body),parameter,public :: body_pluto = &
49-
celestial_body(999,'Pluto',8.696138177608748E+02_wp )
25+
type(celestial_body),parameter,public :: body_sun = celestial_body(10, 'Sun', 1.3271244004193938E+11_wp)
26+
type(celestial_body),parameter,public :: body_mercury = celestial_body(199,'Mercury', 2.2031780000000021E+04_wp)
27+
type(celestial_body),parameter,public :: body_venus = celestial_body(299,'Venus', 3.2485859200000006E+05_wp)
28+
type(celestial_body),parameter,public :: body_earth = celestial_body(399,'Earth', 3.9860043543609598E+05_wp)
29+
type(celestial_body),parameter,public :: body_earth_moon_barycenter = celestial_body(3, 'Earth-Moon Barycenter',4.0350323550225981E+05_wp)
30+
type(celestial_body),parameter,public :: body_moon = celestial_body(301,'Moon', 4.9028000661637961E+03_wp)
31+
type(celestial_body),parameter,public :: body_mars = celestial_body(499,'Mars', 4.282837362069909E+04_wp )
32+
type(celestial_body),parameter,public :: body_jupiter = celestial_body(599,'Jupiter', 1.266865349218008E+08_wp )
33+
type(celestial_body),parameter,public :: body_saturn = celestial_body(699,'Saturn', 3.793120749865224E+07_wp )
34+
type(celestial_body),parameter,public :: body_uranus = celestial_body(799,'Uranus', 5.793951322279009E+06_wp )
35+
type(celestial_body),parameter,public :: body_neptune = celestial_body(899,'Neptune', 6.835099502439672E+06_wp )
36+
type(celestial_body),parameter,public :: body_pluto = celestial_body(999,'Pluto', 8.696138177608748E+02_wp )
5037

5138
!*****************************************************************************************
5239
end module celestial_body_module

src/lighting_module.f90

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
module lighting_module
77

88
use kind_module, only: wp
9-
use numbers_module, only: pi, zero, one, two
9+
use numbers_module, only: pi, zero, one, two, c_light
1010
use vector_module, only: unit, cross, axis_angle_rotation
1111
use ephemeris_module, only: ephemeris_class
1212
use transformation_module, only: icrf_frame
@@ -18,8 +18,6 @@ module lighting_module
1818

1919
private
2020

21-
real(wp),parameter :: c_light = 299792.458_wp !! speed of light in km/s
22-
2321
public :: from_j2000body_to_j2000ssb
2422
public :: apparent_position
2523
public :: get_sun_fraction ! high-level routine

src/numbers_module.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module numbers_module
2929
real(wp),parameter,public :: universal_grav_constant = 6.67408e-20_wp !! CODATA-recommended universal gravitational
3030
!! constant \( km^3/kg-s^2 \)
3131

32+
real(wp),parameter,public :: c_light = 299792.458_wp !! speed of light in km/s
33+
3234
!> 3x3 identity matrix:
3335
real(wp),dimension(3,3),parameter,public :: identity_3x3 = reshape(&
3436
[[one,zero,zero],&

0 commit comments

Comments
 (0)