bplane_test Subroutine

public subroutine bplane_test()

Unit test for bplane_module.

Arguments

None

Calls

proc~~bplane_test~~CallsGraph proc~bplane_test bplane_module::bplane_test proc~bplane bplane_module::bplane proc~bplane_test->proc~bplane proc~calculate_bplane_data bplane_module::calculate_bplane_data proc~bplane_test->proc~calculate_bplane_data proc~compute_vinf_vectors bplane_module::compute_vinf_vectors proc~bplane_test->proc~compute_vinf_vectors proc~cross vector_module::cross proc~bplane->proc~cross proc~ucross vector_module::ucross proc~bplane->proc~ucross proc~unit vector_module::unit proc~bplane->proc~unit proc~calculate_bplane_data->proc~cross proc~calculate_bplane_data->proc~unit proc~compute_vinf_vectors->proc~cross proc~ucross->proc~cross proc~ucross->proc~unit

Source Code

    subroutine bplane_test()

    implicit none

    real(wp),dimension(3) :: vinfvec
    real(wp) :: bmag,theta,BdotT,BdotR,bmag2,theta2,BdotT2,BdotR2
    logical :: status_ok
    integer :: istat

    real(wp),parameter :: mu = 0.398600436233000e+06_wp  !! grav. param. for earth \( (km^2/s^2) \)
    real(wp),dimension(6),parameter :: rv = [ -1.518170076605391E+04_wp, &
                                               1.518170076605392E+04_wp, &
                                               2.147016712324346E+04_wp, &
                                              -4.613927243557805E+00_wp, &
                                              -2.352686048227026E+00_wp, &
                                               1.598938983116768E+00_wp  ] !! example hyperbolic state

    write(*,*) ''
    write(*,*) '---------------'
    write(*,*) ' bplane_test'
    write(*,*) '---------------'
    write(*,*) ''

    call compute_vinf_vectors(mu,rv,vinfin=vinfvec)

    write(*,*) 'vinfvec(1) =' , vinfvec(1)
    write(*,*) 'vinfvec(2) =' , vinfvec(2)
    write(*,*) 'vinfvec(3) =' , vinfvec(3)


    call bplane(mu,rv,vinfvec,bmag,theta,BdotT,BdotR,status_ok)

    write(*,*) ''
    write(*,*) 'vinfvec(1) =' , vinfvec(1)
    write(*,*) 'vinfvec(2) =' , vinfvec(2)
    write(*,*) 'vinfvec(3) =' , vinfvec(3)
    write(*,*) 'bmag       =' , bmag
    write(*,*) 'theta      =' , theta
    write(*,*) 'BdotT      =' , BdotT
    write(*,*) 'BdotR      =' , BdotR


    call calculate_bplane_data(mu,rv,BdotR2,BdotT2,bmag2,theta2,istat)
    write(*,*) ''
    write(*,*) 'Alternate version:'
    write(*,*) ''
    write(*,*) 'bmag       =' , bmag2
    write(*,*) 'theta      =' , theta2
    write(*,*) 'BdotT      =' , BdotT2
    write(*,*) 'BdotR      =' , BdotR2

    write(*,*) ''
    write(*,*) 'Difference:'
    write(*,*) ''
    write(*,*) 'bmag       =' , bmag2 - bmag
    write(*,*) 'theta      =' , theta2 - theta
    write(*,*) 'BdotT      =' , BdotT2 - BdotT
    write(*,*) 'BdotR      =' , BdotR2 - BdotR

    end subroutine bplane_test