Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Compute the coordinates of the libration points (L1,L2,L3,L4,L5).
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
subroutine compute_libration_points_v2(mu,r1,r2,r3,r4,r5)use math_module,only:cube_rootimplicit nonereal(wp),intent(in)::mu!! CRTBP parameterreal(wp),intent(out),optional::r1!! L1 x coordinatereal(wp),intent(out),optional::r2!! L2 x coordinatereal(wp),intent(out),optional::r3!! L3 x coordinatereal(wp),dimension(2),intent(out),optional::r4!! L4 [x,y] coordinatesreal(wp),dimension(2),intent(out),optional::r5!! L5 [x,y] coordinatesinteger,parameter::maxiter=100!! maximum number of iterationsreal(wp),parameter::tol=1.0e-12_wp!! convergence tolerancereal(wp)::gamma,gamma0integer::i!! counterif(present(r1))thengamma0=cube_root(mu*(one-mu)/three)gamma=gamma0+onedo i=1,maxiterif(abs(gamma-gamma0)<=tol)exitgamma0=gamma gamma=cube_root((mu*(gamma0-one)**2)/(three-two*mu-gamma0*(three-mu-gamma0)))end dor1=one-mu-gammaend if if(present(r2))thengamma0=cube_root(mu*(one-mu)/three)gamma=gamma0+onedo i=1,maxiterif(abs(gamma-gamma0)<=tol)exitgamma0=gamma gamma=cube_root((mu*(gamma0+one)**2)/(three-two*mu+gamma0*(three-mu+gamma0)))end dor2=one-mu+gammaend if if(present(r3))thengamma0=cube_root(mu*(one-mu)/three)gamma=gamma0+onedo i=1,maxiterif(abs(gamma-gamma0)<=tol)exitgamma0=gamma gamma=cube_root((one-mu)*(gamma0+one)**2/(one+two*mu+gamma0*(two+mu+gamma0)))end dor3=-mu-gammaend if call compute_libration_points(mu,r4=r4,r5=r5)end subroutine compute_libration_points_v2