Transformation units test
subroutine transformation_module_test() use jpl_ephemeris_module, only: jpl_ephemeris implicit none real(wp),dimension(6),parameter :: initial_state = [10000.0_wp,& 0.0_wp,& 0.0_wp,& 1.0_wp,& 2.0_wp,& 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 type(icrf_frame) :: from type(two_body_rotating_pulsating_frame) :: to type(jpl_ephemeris) :: eph421 logical :: status_ok real(wp),dimension(6) :: rv_out type(ecliptic_frame) :: ecliptic_f real(wp),dimension(3,3) :: c integer :: i !! counter write(*,*) '' write(*,*) '---------------' write(*,*) ' transformation_module_test' write(*,*) '---------------' write(*,*) '' !open the ephemeris: call eph421%initialize(filename=ephemeris_file_421,status_ok=status_ok) if (.not. status_ok) error stop 'Error initializing DE421 ephemeris.' !initialize frames: ! [NOTE: need to make constructors for the frames] ! note: default is Earth-Moon-barycenter: from = icrf_frame(et=et) to = two_body_rotating_pulsating_frame(et=et,scale=scale) call from%transform(initial_state,to,et,eph421,rv_out,status_ok) if (.not. status_ok) error stop 'Error in state transformation.' !results: write(*,*) '' write(*,'(A/,*(E30.16/))') 'initial state (J2000-Earth):', initial_state write(*,'(A/,*(E30.16/))') 'final state (Earth-Moon rotating, centered at barycenter, scale=384400):', rv_out write(*,*) '' ! ecliptic frame: ecliptic_f = ecliptic_frame(b=body_earth) call ecliptic_f%get_c_cdot(eph421,to_icrf=.true.,c=c,status_ok=status_ok) write(*,*) '' write(*,*) 'ecliptic to j2000:' do i=1,3 write(*,*) c(i,:) end do ! from SPICE: ! rot = [1.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00, ! 0.0000000000000000E+00, 9.1748206206918181E-01, -3.9777715593191371E-01, ! 0.0000000000000000E+00, 3.9777715593191371E-01, 9.1748206206918181E-01] ! ! from FAT: ! 1.0000000000000000 0.0000000000000000 0.0000000000000000 ! 0.0000000000000000 0.91748206206918181 -0.39777715593191371 ! 0.0000000000000000 0.39777715593191371 0.91748206206918181 !close the ephemeris: call eph421%close() end subroutine transformation_module_test