
%------------------------------------------------------------------------
%       PART 2 : USER'S MANUAL
%------------------------------------------------------------------------
\part{USER'S MANUAL}
\label{part:user's manual}

%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%------------------------------------------------------------------------
\chapter{DESCRIPTION OF AVAILABLE MODULES}
\label{chapter:description of available modules}

%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : General remarks
%------------------------------------------------------------------------
\section{General remarks}
\label{sect:General remarks CC}

ROCOTLIB library delivers 6 kinds of subroutines:

\bigskip
\textit{\textbf{a)  ``Basic computation subroutines"}} such as \texttt{cp\_time\_param, cp\_gei\_sun\_dir} etc.
It only do computations without any particular previous call. 
One has include in this category the particular \texttt{cp\_time\_param} subroutine which set for a given date and time 
all the time varying quantities needed for the transformations matrix (results are stored in 15 common transparent to the user). 
The \texttt{cp\_gei\_sun\_dir} subroutine compute the direction of the Sun in GEI, while \texttt{cp\_geo\_dipole\_dir} 
compute the direction of the magnetic dipole axis in GEO. Both are used in \texttt{cp\_time\_param}, but can be used independently.
\\


\textit{\textbf{b)  ``Calendar subroutines"}} contains two categories: 
computation and conversion. Computation subroutines are such as \texttt{cp\_xxx\_xxx},
for instance \texttt{cp\_nbday\_in\_month}  and does computations without any particular previous call. 
Conversion subroutines are such as \texttt{cv\_xxx\_to\_xxx}, for instance \texttt{cv\_date\_to\_doty, cv\_dech\_to\_hms}
 etc. There are useful for conversion of dates and times given in various format.
 \\


\textit{\textbf{c)  ``Give subroutines"}} such as \texttt{g\_gei\_geo\_sun\_dir, g\_gsm\_dipole\_tilt\_angle}, etc... 
 give in the output arguments useful parameters as for instance direction of the Sun in GEI and GEO systems, 
 value of the dipole tilt angle, etc... 
Subroutine \texttt{cp\_time\_param} must be called before using theses subroutines at each date/time variation.
\\


\textit{\textbf{d)  ``Read and check subroutines"}} such as  \texttt{r\_date, r\_time}, 
which query and read on the standard input date and time, with automatic check of good format (no hour greater than 23, 
or minutes greater than 59, and so on), useful to write an interactive user program where date and time are an input. 
\\


\textit{\textbf{e)  ``Transformations subroutines"}} such as \texttt{t\_gei\_to\_geo, t\_geo\_to\_gei}
 transforms input Cartesian coordinates system into an another one following mathematical expressions given in Part I ; 
as above, subroutine \texttt{cp\_time\_param} must be called before using theses subroutines at each date/time variation.
\\


\textit{\textbf{f)  ``Matrix operations subroutines"}} such as  \texttt{mat\_xxx} (\texttt{mat\_product, mat\_diff,
mat\_transpose, mat\_diagonalise}, etc...)
allowing a lot of matrix operations, and are used for MVA system (Minimum Variance Analysis).
\\


One subroutine is out of class: a call to  \texttt{print\_rocot\_info} subroutine just print the information relative to the library 
(version number, etc.).
\\


Chapter \ref{chapter:software installation} give instructions for software installation of the library on a UNIX system.
The library is given in three languages: Fortran 77, Fortran 90 and C user program. 
All provides a test program code source to check the library validity. 

\smallskip
Successful tests on PC/Windows 7 lab-top has been done
using Msys interface and fort77 code, but are not documented here.

\newpage


%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : Description of    ``Basic Computation" subroutines
%------------------------------------------------------------------------
\section{Description of    ``Basic Computation" subroutines}
\label{sect:description of "basic computation" subroutines}

~\\
Subroutine cp\_time\_param must be called before any tranformation. It prepare all the matrix required to 
do coordinate transformation, depending of date and time.

~\\
Subroutines cp\_time\_param2 and cp\_time\_param3 do the same, but with input arguments different, which could be more
easy to use in certain cases.

~\\
\textbf{cp\_time\_param}

\hspace{1.6cm}
\texttt{subroutine cp\_time\_param(iyear,imonth,iday,ihour,imin,isec)}

\hspace{1.6cm} 
$\blacktriangleright$ ~\emph{\textbf{compute\_time\_parameters}:  prepare matrix for coordinate transformations}}

\begin{paragraph2}
\emph{Prepare all time varying quantities for computations of coordinate transforms of the library, 
and store results in 15 common statements; use cp\_gei\_sun\_dir and cp\_geo\_dipole\_dir subroutines. Quantities stored in commons are below:}
\end{paragraph2}


\begin{small}
\begin{paragraph2} 
\emph{ 
\hspace{-3pt}sin and cos of GMST\\
ecliptic pole in GEI system\\
direction of the rotation axis of the sun in GEI system\\
dipole direction in GEI system\\
direction of the sun in GEO system\\
direction of the ecliptic in GEO system\\
direction of the rotation axis of the sun in GEO system\\
cross product MxS in GEI system\\
cross product ExS in GEI system\\
cross product RxS in GEI system\\
cross product RxE in GEI system\\
cross product DxS in GEO system\\
cross product ExS in GEO system\\
cross product RxS in GEO system\\
computation of gei to mag vectors\\
computation of gei to sm vectors\\
computation of gei to gsm vectors\\
computation of gei to gseq vectors\\
computation of tetq angle\\
computation of mu angle\\
computation of dzeta angle\\
computation of phi angle\\
computation of geo to mag vectors\\
computation of geo to sm vectors\\
computation of geo to gsm vectors\\
computation of geo to gsq vectors
}
\end{paragraph2}
\end{small}
 
\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}
\texttt{input :} &  \texttt{iyear, imonth, iday : date as 1985 08 24} \\
                 &  \texttt{iyear  must be} $>$ \texttt{1901 and }$<$ \texttt{2099 }\\
                 &  \texttt{ihour,imin,isec : time 23 57 36 (U.T.)}\\
                 & \\
\hspace{-6pt}\texttt{output :} & \texttt{in common statements}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\newpage
\bigskip
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_time\_param2}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_time\_param2(jd1950, houday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_time\_parameters:} prepare matrix for coordinate transformations}

\hspace{1.6cm}
\emph{Same as cp\_time\_param, but with different date-time input}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{Julian day from 1950, decimal hour in the day}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{in common statements}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_time\_param3}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_time\_param3(jd2000, houday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_time\_parameters:} prepare matrix for coordinate transformations}

\hspace{1.6cm}
\emph{Same as cp\_time\_param, but with different date-time input}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{Julian day from 2000, decimal hour in the day}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{in common statements}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_geo\_dipole\_dir}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_geo\_dipole\_dir(iyear,idoty,d1,d2,d3)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_dipole\_direction} in GEO system}

\begin{paragraph2}
\emph{Compute geodipole axis direction from International Geomagnetic Reference Field (IGRF) models 
for time interval 1965 to 1990. For time out of interval, computation is made for nearest boundary.}
\end{paragraph2}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iyear : year (1965 - 1990)}}\\
                                      &  \small{\texttt{idoty : day of the year (1 for January 1)}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{d1,d2,d3  Cartesian dipole components in GEO}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_gei\_sun\_dir}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_gei\_sun\_dir(iyear,idoty,ihour,imin,isec,gst,slong,}}

\hspace{6.3cm}
\small{\texttt{sra,sdec,obliq)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_sun\_direction} in GEI system}

\begin{paragraph2}
\emph{Calculates four quantities in GEI system necessary for coordinate
transformations\\ dependent on sun position (and, hence, on universal time
and season). From C.T. Russel71, cosmic electrodynamics ,v.2,184-196,1971,
revised P. Robert 1992 \& 2000.}
\end{paragraph2}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}
\small{\texttt{input :}} & \small{\texttt{iyear : year (1901-2099)}} & \\
                         & \small{\texttt{idoty : day of the year (1 for January 1)}} & \\
                         & \small{\texttt{ihour,imin,isec : hours, minutes, seconds U.T.}} & \\
   
\hspace{-6pt}
\small{\texttt{output:}} & \small{\texttt{gst}}   \hspace{1.7cm} \small{\texttt{Greenwich mean sideral time (radians)}}\\
                         & \small{\texttt{slong}} \hspace{1.2cm} \small{\texttt{longitude along ecliptic (radians)}}\\
                         & \small{\texttt{sra}}   \hspace{1.7cm} \small{\texttt{right ascension (radians)}}\\
                         & \small{\texttt{sdec}}  \hspace{1.4cm} \small{\texttt{declination of the sun (radians)}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_angle\_and\_ratio}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_angle\_and\_ratio(ux,uy,uz, vx,vy,vz, angle,ratio)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_angle\_and\_ratio} between 2 vectors}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{ux,uy,uz, vx,vy,vz}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{angle (radians) and}} $|\textrm{u}|/|\textrm{v}|$
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_sunrise\_sunset}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_sunrise\_sunset(iyear,imon,iday,rlat,rlon,tmer,tris,}}

\hspace{1.6cm}
\small{\texttt{tset,durd)}}


\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_Sunset} and other Sun parameters}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}
\small{\texttt{input :}} & \small{\texttt{iyear,imon,iday : date}}\\
                         & \small{\texttt{rlat,rlon: geographic latitude and longitude in rad.}}\\
\hspace{-6pt}
\small{\texttt{output:}} & \small{\texttt{tmer,tris,tset,durd : Sun meridian time, Sunrise time,}}\\
                         & \small{\texttt{Sunset time and duration of the day, in Cha*8 variable}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\newpage
\bigskip
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_Euler\_interpol}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_Euler\_interpol(a1,b1,c1,a2,b2,c2,ti,dt,ai,bi,ci)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_Euler\_interpolation} interpolation of Euler's angles}

\hspace{1.6cm}
\begin{tabular}{ll}
    \hspace{-6pt}
    \small{\texttt{input :}} & \small{\texttt{a1,b1,c1,a2,b2,c2, : Values of Euler'angle at $t_1$ and $t_2$}}\\
    & \small{\texttt{ti,dt : time of interpolation, $t_1 < t_i < t_2$,  dt= $t_2 - t_1$}}\\
    \hspace{-6pt}
    \small{\texttt{output:}} & \small{\texttt{ai,bi,ci : values of interpolated Euler'angles at $t_i$}}\\
\end{tabular}

%------------------------------------------------------------------------
%------------------------------------------------------------------------

\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_tpn\_param}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_tpn\_param(xo,yo,zo,xs, Tx,Ty,Tz, Px,Py,Pz, Nx,Ny,Nz)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_TPN\_parameters}}

\begin{paragraph2}
\emph{Compute TPN vector in GSE system or any system having X axis towards the SUN.\\
        \hspace*{1cm} N: Output normal to the paraboloid\\
        \hspace*{1cm} T: tangent to the paraboloid, towards the summit\\
        \hspace*{1cm} P: tangent to the paraboloid, P=N X T\\~\\
    The paraboloid is defined by its summit Xs and the local point Xo, Yo, Zo\\
~\\	
 Note: the paraboloid is close to the magnetopause if the summit          
 is defined as the subsolar point (by T87,T89 model or other)
          and if the local point Xo,Yo,Zo correspond to a magnetopause 
          crossing.}
\end{paragraph2}		  


\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{xo,yo,zo,xs}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{Nx,Ny,Nz,Tx,Ty,Tz,Px,Py,Pz}}
\end{tabular}

%-----------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

~\\~\\


%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : Description of    ``Calendar" subroutines
%------------------------------------------------------------------------
\section{Description of   ``Calendar" subroutines}
\label{sect:description of "Calendar" subroutines}
\bigskip
\subsection{``compute" subroutines}
~\\
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_seasons}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_seasons(iyear,id\_sso,id\_wso,id\_seq,id\_feq,}}

\hspace{1.6cm}
\small{\texttt{ct\_sso,ct\_wso,ct\_seq,ct\_feq)}}


\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_seasons} spring and fall equinoxes, summer and winter solstices}

\hspace{1.6cm}
\begin{tabular}{ll}
    \hspace{-6pt}
    \small{\texttt{input :}} & \small{\texttt{iyear : given year}}\\
    \hspace{-6pt}
    \small{\texttt{output:}} & \small{\texttt{id\_sso,id\_wso : June and december day of summer and}}\\
    & \hspace{3.0cm} \small{\texttt{winter solstice.}}\\ 
    &                \small{\texttt{id\_seq,id\_feq : same for march and september spring}}\\
    & \hspace{3.0cm} \small{\texttt{and fall equinoxes.}}\\ 
    
    & \small{\texttt{ct\_sso,ct\_wso : June and december time of summer and}}\\
    & \hspace{3.0cm} \small{\texttt{winter solstice.}}\\ 
    &                \small{\texttt{ct\_seq,ct\_feq : same for march and september spring}}\\
    & \hspace{3.0cm} \small{\texttt{and fall equinoxes; Cha*5  (hh:mm) }}\\           
\end{tabular}

%-----------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_nbday\_in\_month}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_nbday\_in\_month(iyear,imonth,nbday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_number\_of\_days\_in\_a\_month  }}

\hspace{1.6cm}
\begin{tabular}{ll}
    \hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iyear,imonth}}\\
    \hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{nbday, ex 31 for January}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\newpage 
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_leap\_year}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_leap\_year(iyear,ileap)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_leap\_year} with ileap=1 for leap year, 0 if not }

\hspace{1.6cm}
\begin{tabular}{ll}
    \hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iyear (ex: 1980)}}\\
    \hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{ileap (1 or 0 if iyear is or not a leap year)}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cp\_fr\_day\_name} 

\hspace{1.6cm}
\small{\texttt{subroutine cp\_fr\_day\_name(iday,cday,n)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_french\_day\_name} as  ``Lundi" for iday= 1}

\hspace{1.6cm}
\begin{tabular}{ll}
    \hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iday, day number (1-7)}}\\
    \hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{cday, as  ``Lundi", n= number of character }} \\
                                          &  \small{\texttt{of the word}} 
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip


\textbf{cp\_fr\_month\_name}

\hspace{1.6cm}
\small{\texttt{subroutine cp\_fr\_month\_name(imonth,cmonth,n)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_french\_month\_name}  as  ``Janvier" for imonth=1}

\hspace{1.6cm}
\begin{tabular}{ll}
    \hspace{-6pt}\small{\texttt{input :}} & \small{\texttt{imonth, month (1-12)}}\\
    \hspace{-6pt}\small{\texttt{output:}} & \small{\texttt{cmonth, as  ``Janvier", n= number of character of the word}} 
\end{tabular}
  
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip
 
\textbf{cp\_en\_day\_name}
 
\hspace{1.6cm}
\small{\texttt{subroutine cp\_en\_day\_name(iday,cday,n)}}
 
\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_english\_day\_name} as  ``Monday" for iday= 1}
 
\hspace{1.6cm}
\begin{tabular}{ll}
    \hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iday, day number (1-7)}}\\
    \hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{cday, as  ``Monday", n= number of character of the word}}
\end{tabular}
 
 %------------------------------------------------------------------------
 \smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip
    
 \textbf{cp\_en\_month\_name}
    
 \hspace{1.6cm}
 \small{\texttt{subroutine cp\_en\_month\_name(imonth,cmonth,n)}}
    
 \hspace{1.6cm}
 $\blacktriangleright$ ~\emph{\textbf{compute\_english\_month\_name}  as  ``January" for imonth=1}
    
 \hspace{1.6cm}
 \begin{tabular}{ll}
     \hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{imonth, month (1-12)}}\\
     \hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{cmonth, as  ``January", n= number of character of the word}} 
 \end{tabular}
 
 %------------------------------------------------------------------------
 \smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip 

~\\
~\\
~\\
\subsection{``convert" subroutines}

~\\
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_doty\_to\_date}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_doty\_to\_date(idoty,iyear,imonth,iday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_date\_from\_day\_of\_the\_year}  and for a given year.}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{idoty, iyear, (idoty=1 for January 1)}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{imonth, iday}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_jul2000\_to\_date}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_jul2000\_to\_date(jud00,iyear,imonth,iday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_date\_from\_Julian\_day} with jud00=1 for January 1, 2000}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{jud00  Julian day (1= 1/1/2000)}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{iyear, imonth, iday}}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_jul1950\_to\_date}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_jul1950\_to\_date(jud50,iyear,imonth,iday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_date\_from\_Julian\_day} with jud50=1 for January 1, 1950}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{jud50  Julian day (1= 1/1/1950)}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{iyear, imonth, iday}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\newpage 
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_weekn\_to\_date}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_weekn\_to\_date(iweek,iyear,imonth,iday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_date\_for\_first\_day\_of\_week} number  always a Monday}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iweek: week number in the year}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{iyear, imonth, iday}}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_date\_to\_dotw}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_date\_to\_dotw(iyear,imonth,iday,idow)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_day\_of\_the\_week}  from date}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iyear, imonth, iday}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{idow : day of the week, 1 for Monday}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_date\_to\_doty}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_date\_to\_doty(iyear,imonth,iday, idoty)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_day\_of\_the\_year}   with idoty=1 for January 1}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} & \small{\texttt{iyear,imonth,iday, ex: 1990,10,17}}\\
\hspace{-6pt}\small{\texttt{output:}} & \small{\texttt{idoty, ex: 290}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_hms\_to\_dech}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_hms\_to\_dech(ih,im,is,houday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_hour\_of\_the\_day}  from hours, minutes, seconds}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{ih,im,is}}\\
\hspace{-6pt}\small{\texttt{output:}} & \small{\texttt{houday   decimal hour of the day}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_date\_to\_jul1950}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_date\_to\_jul1950(iyear,imonth,iday, jud50)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_Julian\_day}    with jud50=1 for January 1, 1950}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iyear,imonth,iday ex: 1990,10,17}} \\
\hspace{-6pt}\small{\texttt{output:}} & \small{\texttt{jud50}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_date\_to\_jul2000}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_date\_to\_jul2000(iyear,imonth,iday, jud00)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_Julian\_day}   	with jud00=1 for January 1, 2000}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iyear,imonth,iday ex: 2001,10,17}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{jud00}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_dhms\_to\_msotd}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_dhms\_to\_msotd(ih,im,is,ims,milday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_millisecond\_of\_the\_day }}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} & \small{\texttt{ih,im,is,ims: time in hour,min,sec,millisec}}\\
\hspace{-6pt}\small{\texttt{output:}} & \small{\texttt{ milday, millisec. of the day }}($<$86400000)
\end{tabular}



%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_dech\_to\_hms}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_dech\_to\_hms(houday,ih,im,is)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_time}  from decimal hour of the day}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{houday, decimal hour of the day}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{ih,im,is}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_msotd\_to\_hmsms}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_msotd\_to\_hmsms(milday,ih,im,is,ims)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_time}  from millisecond of the day}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{houday, decimal hour of the day}}\\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{ih,im,is,ims}}
\end{tabular}



\vspace*{-4pt}
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{cv\_date\_to\_weekn}

\hspace{1.6cm}
\small{\texttt{subroutine cv\_date\_to\_weekn(iyear,imonth,iday,iweek)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_week\_of\_the\_year}  from date}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\small{\texttt{input :}} &  \small{\texttt{iyear, imonth, iday}} \\
\hspace{-6pt}\small{\texttt{output:}} &  \small{\texttt{iweek : week of the year, 1 for first Monday}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip


\newpage

%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : Description of    ``Give" subroutines
%------------------------------------------------------------------------
\section{Description of    ``Give" subroutines}
\label{sect:description of "Give" subroutines}

~\\
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{g\_gei\_geo\_dipole\_dir}

\hspace{1.6cm}
\texttt{\small{subroutine g\_gei\_geo\_dipole\_dir(dxgei,dygei,dzgei,dxgeo,dygeo,dzgeo)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{give\_dipole\_direction} in GEI and GEO system}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} &  \texttt{\small{none}} \\
\hspace{-6pt}\texttt{\small{output:}} &  \texttt{\small{dxgei,dygei,dzgei  Cartesian dipole GEI coord.}}\\
                                      & \texttt{\small{dxgeo,dygeo,dzgeo  Cartesian dipole GEO coord.}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{g\_gsm\_dipole\_tilt\_angle}

\hspace{1.6cm}
\texttt{\small{subroutine g\_gsm\_dipole\_tilt\_angle(diptan)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{give\_dipole\_tilt\_angle} in GSM system (radians)}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} &  \texttt{\small{none}} \\
\hspace{-6pt}\texttt{\small{output:}} &  \texttt{\small{diptan=(D,Z) angle in GSM (radians)}}\\
                                      &  (\texttt{\small{diptan$>$0 when the north magnetic pole}}\\
                                      &  \texttt{\small{is tilted toward the Sun)}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{g\_gei\_geo\_ecliptic\_dir}

\hspace{1.6cm}
\texttt{\small{subroutine g\_gei\_geo\_ecliptic\_dir(exgei,eygei,ezgei,exgeo,eygeo,ezgeo)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{give\_ecliptic\_direction} in GEI and GEO system}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} &  \texttt{\small{none}}\\
\hspace{-6pt}\texttt{\small{output:}} &  \texttt{\small{exgei,eygei,ezgei  Cartesian eclip. GEI coord.}}\\
                                      &  \texttt{\small{exgeo,eygeo,ezgeo  Cartesian eclip. GEO coord.}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{g\_gei\_geo\_sun\_rot}

\hspace{1.6cm}
\texttt{\small{subroutine g\_gei\_geo\_sun\_rot(rxgei,rygei,rzgei,rxgeo,rygeo,rzgeo)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{give\_sun\_rotation\_direction} in GEI and GEO system}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} & \texttt{\small{none}} \\
\hspace{-6pt}\texttt{\small{output:}} & \texttt{\small{rxgei,rygei,rzgei Cartesian sun rot. GEI coord.}}\\
                                      & \texttt{\small{rxgeo,rygeo,rzgeo Cartesian sun rot. GEO coord.}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{g\_gei\_geo\_sun\_dir}

\hspace{1.6cm}
\texttt{\small{subroutine g\_gei\_geo\_sun\_dir(sxgei,sygei,szgei,sxgeo,sygeo,szgeo)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{give\_sun\_direction} in GEI and GEO system}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} & \texttt{\small{none}} \\
\hspace{-6pt}\texttt{\small{output:}} & \texttt{\small{sxgei,sygei,szgei Cartesian sun GEI coord.}}\\
                                      & \texttt{\small{sxgeo,sygeo,szgeo Cartesian sun GEO coord.}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{g\_gei\_sun\_param}

\hspace{1.6cm}
\texttt{\small{subroutine g\_gei\_sun\_param(gmst,slon,sras,sdec)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{give\_sun\_parameter} dependant of time in GEI system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{\small{input :}} &  \texttt{\small{none}}  & \\
\hspace{-6pt}\texttt{\small{output:}} &  \texttt{\small{gmst}}  &  \texttt{\small{Greenwich mean sideral time(radians)}}\\
                                      &  \texttt{\small{slon}}  &  \texttt{\small{longitude along ecliptic (radians)}}\\
                                      &  \texttt{\small{sras}}  &  \texttt{\small{ right ascension (radians)}}\\
                                      &  \texttt{\small{sdec}}  &  \texttt{\small{ declination of the sun (radians)}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{g\_rocot\_version\_number}

\hspace{1.6cm}
\texttt{\small{subroutine g\_rocot\_version\_number(vernum)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{give\_version\_number} of the library}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} &   \texttt{\small{none }}\\
\hspace{-6pt}\texttt{\small{output:}} & \texttt{\small{vernum (ex 1.0)}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

~\\


%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : Description of    ``Read and check" subroutines
%------------------------------------------------------------------------
\section{Description of    ``Read and check" subroutines}
\label{sect:description of "Read and check" subroutines}

~\\
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{r\_coordinate\_values}

\hspace{1.6cm}
\texttt{\small{subroutine r\_coordinate\_values(x,y,z,cs)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{read\_coordinate} values  from standard input input and check validity}

\begin{paragraph2}
\emph{read cs character variable from standard input;\\
if cs is eq to  ``c", then read Cartesian component of a vector from standard input.\\
if cs is eq to  ``s", else read spherical r, t, j components from standard input.
}
\end{paragraph2}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} &  \texttt{\small{cs (char*1)}}\\
\hspace{-6pt}\texttt{\small{output:}} & \texttt{\small{x,y,z, cs Cartesian components and cs}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{recys}

\hspace{1.6cm}
\texttt{\small{subroutine recys(csys)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{read\_coordinate\_system}  from terminal input and check validity}

\begin{paragraph2}
\emph{csys must have only the following values: gei, geo, mag, sma, gsm, gse, gsq
if not, ask again}
\end{paragraph2}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} & \texttt{\small{none}}\\
\hspace{-6pt}\texttt{\small{output:}} & \texttt{\small{csys ; print error if csys is not valid, and ask again}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{r\_date}

\hspace{1.6cm}
\texttt{\small{subroutine r\_date(iyear,imonth,iday)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{read\_date} from standard input and check validity}

\begin{paragraph2}
\emph{test if imonth is not greater than 12, test if iday is not greater then length of the month, 
taking into account the leap years;  year must be greater or equal to 1900.}
\end{paragraph2}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} & \texttt{\small{none}}\\
\hspace{-6pt}\texttt{\small{output:}} & \texttt{\small{iyear, imonth,iday }}\\
                                      & \texttt{\small{print error if date is not valid, and ask again}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{r\_time}

\hspace{1.6cm}
\texttt{\small{subroutine r\_time(ih,im,is)}}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{read\_time} from standard input and check validity}

\hspace{1.6cm}
\emph{ih must be between 1 and 23, im and is between 1 and 59}


\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} & \texttt{\small{none}}\\
\hspace{-6pt}\texttt{\small{output:}} & \texttt{\small{ih,im,is}} \\
                                      & \texttt{\small{print error if time is not valid, and ask again}}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

~\\~\\~\\


%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : Description of    ``print information" subroutines
%------------------------------------------------------------------------
\section{Description of    ``Print information" subroutines}
\label{sect:description of "print information" subroutines}

~\\
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\hspace{1.6cm}
\texttt{\small{subroutine prinfo}}

\begin{paragraph2}
$\blacktriangleright$ ~\emph{\textbf{print\_information} and version of the library; result is listed in section VI}
\end{paragraph2}

\hspace{1.6cm}
\begin{tabular}{ll}
\hspace{-6pt}\texttt{\small{input :}} & \texttt{\small{none}}\\
\hspace{-6pt}\texttt{output:} & \texttt{print information on standard output}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip
~\\~

%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : Description of ~   ``Transformations" subroutines
%------------------------------------------------------------------------
\section{Description of    ``Transformations" subroutines}
\label{sect:description of "Transformations" subroutines}

~\\
Subroutines are sorted according with the schematic diagram of section \ref{sect:schematic diagram of transformations}, 
or the liste given in section \ref{sect:list of transformations}

~\\
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{1) t\_gei\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_gei\_to\_geo(xgei,ygei,zgei,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gei\_to\_geo :}  GEI  $\longrightarrow$ GEO  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgei,ygei,zgei} & \texttt{Cartesian gei coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo} & \texttt{Cartesian geo coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~t\_geo\_to\_gei}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_gei(xgeo,ygeo,zgeo,xgei,ygei,zgei)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_gei :}  GEO  $\longrightarrow$ GEI  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgei,ygei,zgei} &   \texttt{Cartesian gei coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{2) t\_gei\_to\_mag}

\hspace{1.6cm}
\texttt{subroutine t\_gei\_to\_mag(xgei,ygei,zgei,xmag,ymag,zmag)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gei\_to\_mag :}  GEI  $\longrightarrow$ MAG  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgei,ygei,zgei}  & \texttt{Cartesian gei coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xmag,ymag,zmag} &   \texttt{Cartesian mag coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~t\_mag\_to\_gei}

\hspace{1.6cm}
\texttt{subroutine t\_mag\_to\_gei(xmag,ymag,zmag,xgei,ygei,zgei)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_mag\_to\_gei :}  MAG  $\longrightarrow$ GEI  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xmag,ymag,zmag }&  \texttt{ Cartesian mag coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgei,ygei,zgei}  & \texttt{Cartesian gei coordinates}
\end{tabular}

 %------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{3) t\_gei\_to\_sm}

\hspace{1.6cm}
\texttt{subroutine t\_gei\_to\_sm(xgei,ygei,zgei,xsma,ysma,zsma)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gei\_to\_sma :}  GEI  $\longrightarrow$ SM  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgei,ygei,zgei}  & \texttt{Cartesian gei coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xsma,ysma,zsma} &   \texttt{Cartesian sma coordinates}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~t\_sm\_to\_gei}

\hspace{1.6cm}
\texttt{subroutine t\_sm\_to\_gei(xsma,ysma,zsma,xgei,ygei,zgei)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sma\_to\_gei :}  SM  $\longrightarrow$ GEI  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xsma,ysma,zsma} &   \texttt{Cartesian sma coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgei,ygei,zgei}  &\texttt{ Cartesian gei coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{4) t\_gei\_to\_gsm}

\hspace{1.6cm}
\texttt{subroutine t\_gei\_to\_gsm(xgei,ygei,zgei,xgsm,ygsm,zgsm)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gei\_to\_gsm :}  GEI  $\longrightarrow$ GSM  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgei,ygei,zgei} & \texttt{Cartesian gei coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsm,ygsm,zgsm} & \texttt{Cartesian gsm coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~t\_gsm\_to\_gei}

\hspace{1.6cm}
\texttt{subroutine t\_gsm\_to\_gei(xgsm,ygsm,zgsm,xgei,ygei,zgei)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsm\_to\_gei :}  GSM  $\longrightarrow$ GEI  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsm,ygsm,zgsm} &   \texttt{Cartesian gsm coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgei,ygei,zgei } & \texttt{Cartesian gei coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{5) t\_gei\_to\_gse}

\hspace{1.6cm}
\texttt{subroutine t\_gei\_to\_gse(xgei,ygei,zgei,xgse,ygse,zgse)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gei\_to\_gse :}  GEI  $\longrightarrow$ GSE  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgei,ygei,zgei}  & \texttt{Cartesian gei coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgse,ygse,zgse} &   \texttt{Cartesian gse coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip
\newpage
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~t\_gse\_to\_gei}

\hspace{1.6cm}
\texttt{subroutine t\_gse\_to\_gei(xgse,ygse,zgse,xgei,ygei,zgei)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_gei :}  GSE  $\longrightarrow$ GEI  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse} &   \texttt{Cartesian gse coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgei,ygei,zgei } & \texttt{Cartesian gei coordinates}
\end{tabular}

 %------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{6) t\_gei\_to\_gseq}

\hspace{1.6cm}
\texttt{subroutine t\_gei\_to\_gseq(xgei,ygei,zgei,xgsq,ygsq,zgsq)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gei\_to\_gsq :}  GEI  $\longrightarrow$ GSEQ  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgei,ygei,zgei}  & \texttt{Cartesian gei coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsq,ygsq,zgsq }&   \texttt{Cartesian gsq coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~t\_gseq\_to\_gei}

\hspace{1.6cm}
\texttt{subroutine t\_gseq\_to\_gei(xgsq,ygsq,zgsq,xgei,ygei,zgei)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsq\_to\_gei :}  GSEQ  $\longrightarrow$ GEI  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsq,ygsq,zgsq} &   \texttt{Cartesian gsq coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgei,ygei,zgei } & \texttt{Cartesian gei coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{7) t\_geo\_to\_sm}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_sm(xgeo,ygeo,zgeo,xsma,ysma,zsma)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_sma :}  GEO  $\longrightarrow$ SM system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xsma,ysma,zsma} &   \texttt{Cartesian sma coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~t\_sm\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_sm\_to\_geo(xsma,ysma,zsma,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sma\_to\_geo :}  SM  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xsma,ysma,zsma} &   \texttt{Cartesian sma coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{8) t\_geo\_to\_gsm}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_gsm(xgeo,ygeo,zgeo,xgsm,ygsm,zgsm)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_gsm :}  GEO  $\longrightarrow$ GSM system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsm,ygsm,zgsm} &   \texttt{Cartesian gsm coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~t\_gsm\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_gsm\_to\_geo(xgsm,ygsm,zgsm,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsm\_to\_geo :}  GSM  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsm,ygsm,zgsm} &   \texttt{Cartesian gsm coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo } & \texttt{Cartesian geo coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{9) t\_geo\_to\_gse}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_gse(xgeo,ygeo,zgeo,xgse,ygse,zgse)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_gse :}  GEO  $\longrightarrow$ GSE system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgse,ygse,zgse} &   \texttt{Cartesian gse coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~t\_gse\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_gse\_to\_geo(xgse,ygse,zgse,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_geo :}  GSE  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse} &   \texttt{Cartesian gse coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{10) t\_geo\_to\_gseq}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_gseq(xgeo,ygeo,zgeo,xgsq,ygsq,zgsq)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_gsq :}  GEO  $\longrightarrow$ GSEQ system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsq,ygsq,zgsq} &   \texttt{Cartesian gsq coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_gseq\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_gseq\_to\_geo(xgsq,ygsq,zgsq,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsq\_to\_geo :}  GSEQ  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsq,ygsq,zgsq} &   \texttt{Cartesian gsq coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo } & \texttt{Cartesian geo coordinates}
\end{tabular}
 
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{11) t\_gse\_to\_gseq}

\hspace{1.6cm}
\texttt{subroutine t\_gse\_to\_gseq(xgse,ygse,zgse,xgsq,ygsq,zgsq)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_gsq :}  GSE  $\longrightarrow$ GSEQ  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse}  & \texttt{Cartesian gse coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsq,ygsq,zgsq} &   \texttt{Cartesian gsq coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_gseq\_to\_gse}

\hspace{1.6cm}
\texttt{subroutine t\_gseq\_to\_gse(xgsq,ygsq,zgsq,xgse,ygse,zgse)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsq\_to\_gse :}  GSEQ  $\longrightarrow$ GSE  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsq,ygsq,zgsq} &   \texttt{Cartesian gsq coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgse,ygse,zgse}  & \texttt{Cartesian gse coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{12) t\_gse\_to\_gsm}

\hspace{1.6cm}
\texttt{subroutine t\_gse\_to\_gsm(xgse,ygse,zgse,xgsm,ygsm,zgsm)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_gsm :}  GSE  $\longrightarrow$ GSM  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse } & \texttt{Cartesian gse coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsm,ygsm,zgsm} &  \texttt{Cartesian gsm coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_gsm\_to\_gse}

\hspace{1.6cm}
\texttt{subroutine t\_gsm\_to\_gse(xgsm,ygsm,zgsm,xgse,ygse,zgse)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsm\_to\_gse :}  GSM  $\longrightarrow$ GSE  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsm,ygsm,zgsm} &  \texttt{Cartesian gsm coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgse,ygse,zgse} & \texttt{Cartesian gse coordinates}
\end{tabular}

 %------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{13) t\_gsm\_to\_sm}

\hspace{1.6cm}
\texttt{subroutine t\_gsm\_to\_sm(xgsm,ygsm,zgsm,xsma,ysma,zsma)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsm\_to\_sma :}  GSM  $\longrightarrow$ SM  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsm,ygsm,zgsm}  & \texttt{Cartesian gsm coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xsma,ysma,zsma} &   \texttt{Cartesian sma coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_sm\_to\_gsm}

\hspace{1.6cm}
\texttt{subroutine t\_sm\_to\_gsm(xsma,ysma,zsma,xgsm,ygsm,zgsm)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sma\_to\_gsm :}  SM  $\longrightarrow$ GSM  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xsma,ysma,zsma} & \texttt{Cartesian sma coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsm,ygsm,zgsm} & \texttt{Cartesian gsm coordinates}
\end{tabular}
 
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{14) t\_sm\_to\_mag}

\hspace{1.6cm}
\texttt{subroutine t\_sm\_to\_mag(xsma,ysma,zsma,xmag,ymag,zmag)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sma\_to\_mag :}  SM  $\longrightarrow$ MAG system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xsma,ysma,zsma}  & \texttt{Cartesian sma coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xmag,ymag,zmag}&   \texttt{Cartesian mag coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_mag\_to\_sm}

\hspace{1.6cm}
\texttt{subroutine t\_mag\_to\_sm(xmag,ymag,zmag,xsma,ysma,zsma)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_mag\_to\_sma :}  MAG  $\longrightarrow$ SM system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xmag,ymag,zmag} &   \texttt{Cartesian mag coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xsma,ysma,zsma}  & \texttt{Cartesian sma coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{15) t\_geo\_to\_mag}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_mag(xgeo,ygeo,zgeo,xmag,ymag,zmag)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_mag :}  GEO  $\longrightarrow$ MAG system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xmag,ymag,zmag} &   \texttt{Cartesian mag coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_mag\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_mag\_to\_geo(xmag,ymag,zmag,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_mag\_to\_geo :}  MAG  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xmag,ymag,zmag} &  \texttt{Cartesian mag coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{16) tgsesma}

\hspace{1.6cm}
\texttt{subroutine tgsesma(xgse,ygse,zgse,xsma,ysma,zsma)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_sma :}  GSE  $\longrightarrow$ SMA system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse} & \texttt{Cartesian gse coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xsma,ysma,zsma} & \texttt{Cartesian sma coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~tsmagse}

\hspace{1.6cm}
\texttt{subroutine tsmagse(xsma,ysma,zsma,xgse,ygse,zgse)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sma\_to\_gse :}  SM  $\longrightarrow$ GSE system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xsma,ysma,zsma}&   \texttt{Cartesian sma coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgse,ygse,zgse}  & \texttt{Cartesian gse coordinates}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{17) t\_gsm\_to\_mag}

\hspace{1.6cm}
\texttt{subroutine t\_gsm\_to\_mag(xgsm,ygsm,zgsm,xmag,ymag,zmag)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsm\_to\_mag :}  GSM  $\longrightarrow$ MAG  system (via GSM$\longrightarrow$SM$\longrightarrow$MAG)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsm,ygsm,zgsm}  & \texttt{Cartesian gsm coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xmag,ymag,zmag} &   \texttt{Cartesian mag coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_mag\_to\_gsm}

\hspace{1.6cm}
\texttt{subroutine t\_mag\_to\_gsm(xmag,ymag,zmag,xgsm,ygsm,zgsm)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_mag\_to\_gsm :}  MAG  $\longrightarrow$ GSM  system (via MAG$\longrightarrow$SM$\longrightarrow$GSM)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xmag,ymag,zmag} &   \texttt{Cartesian mag coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsm,ygsm,zgsm}  & \texttt{Cartesian gsm coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{18) t\_gsm\_to\_gseq}

\hspace{1.6cm}
\texttt{subroutine t\_gsm\_to\_gseq(xgsm,ygsm,zgsm,xgsq,ygsq,zgsq)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsm\_to\_gsq :}  GSM  $\longrightarrow$ GSQ  system 
(via GSM$\longrightarrow$GSE$\longrightarrow$GSQ)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsm,ygsm,zgsm}  & \texttt{Cartesian gsm coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsq,ygsq,zgsq} &   \texttt{Cartesian gsq coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_gseq\_to\_gsm}

\hspace{1.6cm}
\texttt{subroutine t\_gseq\_to\_gsm(xgsq,ygsq,zgsq,xgsm,ygsm,zgsm)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsq\_to\_gsm :}  GSQ  $\longrightarrow$ GSM  system 
(via GSQ$\longrightarrow$GSE$\longrightarrow$GSM)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsq,ygsq,zgsq} &   \texttt{Cartesian gsq coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgsm,ygsm,zgsm}  & \texttt{Cartesian gsm coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{19) t\_geo\_to\_dm}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_dm(xgeo,ygeo,zgeo,rlat,rlong,xdme,ydme,zdme)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_dme :}  GEO  $\longrightarrow$ DM system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo } & \texttt{Cartesian geo coordinates}\\
        & \texttt{rlat,rlong }     & \texttt{latitude and longitude of the}\\
        &                 &\texttt{point of observation (radians)}\\
\hspace{-6pt}\texttt{output:} & \texttt{xdme,ydme,zdme} &  \texttt{Cartesian dme coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_dm\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_dm\_to\_geo(xdme,ydme,zdme,rlat,rlong,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_dme\_to\_geo :}  DM  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\texttt{input:} & \texttt{xdme,ydme,zdme} &   \texttt{Cartesian dme coordinates}\\
        & \texttt{rlat,rlong}      & \texttt{latitude and longitude of the}\\
        &                 &\texttt{point of observation (radians)}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip
\newpage
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{20) t\_geo\_to\_vdh}

\hspace{1.6cm}
\texttt{subroutine t\_geo\_to\_vdh(xgeo,ygeo,zgeo,rlat,rlong,xvdh,yvdh,zvdh)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_geo\_to\_vdh :}  GEO  $\longrightarrow$ VDH system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}\\
        & \texttt{rlat,rlong}      & \texttt{latitude and longitude of the}\\
        &                 &\texttt{point of observation (radians)}\\
\hspace{-6pt}\texttt{output:} & \texttt{xvdh,yvdh,zvdh} &   \texttt{Cartesian vdh coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~~t\_vdh\_to\_geo}

\hspace{1.6cm}
\texttt{subroutine t\_vdh\_to\_geo(xvdh,yvdh,zvdh,rlat,rlong,xgeo,ygeo,zgeo)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_vdh\_to\_geo :}  VDH  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\texttt{input:} & \texttt{xvdh,yvdh,zvdh} &   \texttt{Cartesian vdh coordinates}\\
        & \texttt{rlat,rlong}      & \texttt{latitude and longitude of the}\\
        &                 &\texttt{point of observation (radians)}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgeo,ygeo,zgeo}  & \texttt{Cartesian geo coordinates}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{21) t\_sr2\_to\_sr}

\hspace{1.6cm}
\texttt{subroutine t\_sr2\_to\_sr(xsr2,ysr2,spifre,spipha,deltaT,xsre,ysre)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sr2\_to\_sre :}  SR2 $\longrightarrow$ SR  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} &\texttt{xsr2, ysr2} &\texttt{cartesian sr2 coordinates}\\
&  \texttt{spifre}& \texttt{spin frequency in Hz}\\
&  \texttt{spipha}& \texttt{spin phase in radians, growing with time}\\
& &\texttt{spipha= positive angle between the xsr}\\
& &\texttt{axis and the component of the direction}\\
& &\texttt{of the Sun in the xsr-ysr plane.}\\
&\texttt{deltaT}& \texttt{(T -To) (sec.), between the current time}\\
& &\& \texttt{the time where is measured the spin phase}\\
\hspace{-6pt}\texttt{output:}& \texttt{xsre,ysre}& \texttt{cartesian sr coordinates}\\
\hspace{-6pt}\texttt{Comment:}& \texttt{Z component}& \texttt{is unchanged (spin axis)}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~t\_sr\_to\_sr2}

\hspace{1.6cm}
\texttt{subroutine t\_sr\_to\_sr2(xsre,ysre,spifre,spipha,deltaT,xsr2,ysr2)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sre\_to\_sr2 :}  SR $\longrightarrow$ SR2  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} &  \texttt{xsre,ysre} & \texttt{cartesian sr coordinates}\\
       &  \texttt{spifre}   &  \texttt{spin frequency in Hz}\\
       &  \texttt{spipha}   &  \texttt{spin phase in radians, growing with time}\\
       &           &  	   \texttt{spipha= positive angle between the xsr}\\
& &\texttt{axis and the component of the direction}\\
& &\texttt{of the Sun in the xsr-ysr plane.}\\
       &  \texttt{deltaT}   &  (\texttt{T -To) (sec.), between the current time}\\
       &           & \& \texttt{the time where is measured the spin phase}\\
\hspace{-6pt}\texttt{output:} &\texttt{xsr2, ysr2} & \texttt{cartesian sr2 coordinates}\\
\hspace{-6pt}\texttt{Comment:} & \texttt{Z component} & \texttt{is unchanged (spin axis)}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{22) t\_gse\_to\_sr2}

\hspace{1.6cm}
\texttt{subroutine t\_gse\_to\_sr2(xgse,ygse,zgse,rotx,roty,rotz,xsr2,ysr2,zsr2)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_sr2 :}  GSE  $\longrightarrow$ SR2 system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse}  & \texttt{Cartesian gse coordinates}\\
        & \texttt{rotx,roty,rotz}      & \texttt{Cartesian gse coordinates}\\
        &                 &\texttt{of the rotation axis of the S/C}\\
\hspace{-6pt}\texttt{output:} & \texttt{xsr2,ysr2,zsr2} &   \texttt{Cartesian sr2 coordinates}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{~~~~t\_sr2\_to\_gse}

\hspace{1.6cm}
\texttt{subroutine t\_sr2\_to\_gse(xsr2,ysr2,zsr2,rotx,roty,rotz,xgse,ygse,zgse)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sr2\_to\_gse :}  VDH  $\longrightarrow$ GEO system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xsr2,ysr2,zsr2} &   \texttt{Cartesian sr2 coordinates}\\
        & \texttt{rotx,rot,y,rotz}      & \texttt{Cartesian gse coordinates}\\
        &                 &\texttt{of the rotation axis of the S/C}\\
\hspace{-6pt}\texttt{output:} & \texttt{xgse,ygse,zgse}  & \texttt{Cartesian gse coordinates}
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{23) t\_sr2\_to\_mfa}

\hspace{1.6cm}
\texttt{subroutine t\_sr2\_to\_mfa(xsr2,ysr2,zsr2,bx,by,bz,rotx,roty,rotz,}

\hspace{1.6cm}
\texttt{xmfa,ymfa,zmfa)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sr2\_to\_mfa :}  SR2 $\longrightarrow$ MFA  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xsr2,ysr2,zsr2} & \texttt{Cartesian SR2 coordinates}\\
                              & \texttt{bx,by,bz}       & \texttt{Cartesian SR2 coordinates}\\
                              &                         & \texttt{of the DC magnetic field}\\
                              & \texttt{rotx,roty,rotz} & \texttt{Cartesian GSE coordinates}\\
                              &                         & \texttt{of the rotation axis of the S/C}\\
\hspace{-6pt}\texttt{output:} & \texttt{xmfa,ymfa,zmfa} & \texttt{Cartesian MFA coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{24) t\_gse\_to\_mfa}

\hspace{1.6cm}
\texttt{subroutine t\_gse\_to\_mfa(xgse,ygse,zgse,bx,by,bz,xmfa,ymfa,zmfa)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_mfa :}  GSE $\longrightarrow$ MFA  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse} & \texttt{Cartesian SR2 coordinates}\\
                              & \texttt{bx,by,bz}       & \texttt{Cartesian GSE coordinates}\\
                              &                         & \texttt{of the DC magnetic field}\\
\hspace{-6pt}\texttt{output:} & \texttt{xmfa,ymfa,zmfa} & \texttt{Cartesian MFA coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{24) t\_gse\_to\_tpn}

\hspace{1.6cm}
\texttt{subroutine t\_gse\_to\_tpn(xgse,ygse,zgse,xo,yo,zo,xs,xtpn,ytpn,ztpn)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gse\_to\_tpn :}  GSE $\longrightarrow$ TPN  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgse,ygse,zgse} & \texttt{Cartesian GSE coordinates}\\
                              & \texttt{xo,yo,zo}       & \texttt{position of the S/C in gse}\\
                              & \texttt{xs}             & \texttt{subsolar point, submit of the paraboloid}\\							  
                              &                         & \texttt{from Earth to Sun}\\
\hspace{-6pt}\texttt{output:} & \texttt{xtpn,ytpn,ztpn} & \texttt{Cartesian TPN coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{25) t\_gsm\_to\_tpn}

\hspace{1.6cm}
\texttt{subroutine t\_gsm\_to\_tpn(xgsm,ygsm,zgsm,xo,yo,zo,xs,xtpn,ytpn,ztpn)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_gsm\_to\_tpn :}  GSM $\longrightarrow$ TPN  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{xgsm,ygsm,zgsm} & \texttt{Cartesian GSM coordinates}\\
                              & \texttt{xo,yo,zo}       & \texttt{position of the S/C in gsm}\\
                              & \texttt{xs}             & \texttt{subsolar point, submit of the paraboloid}\\							  
                              &                         & \texttt{from Earth to Sun}\\
\hspace{-6pt}\texttt{output:} & \texttt{xtpn,ytpn,ztpn} & \texttt{Cartesian TPN coordinates}
\end{tabular}





%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip


~\\~\\
$\bullet$~Transformation with Euler'angles:
~\\~\\
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{t\_xyz\_to\_vdh}

\hspace{1.6cm}
\texttt{subroutine t\_xyz\_to\_vdh(,y,z,a1,a2,a3,v,d,h)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_xyz\_to\_vdh :}  spinning XYZ $\longrightarrow$ fixed VDH  system}

\hspace{1.6cm}
\begin{tabular}{lll}
    \hspace{-6pt}\texttt{input :} & \texttt{x,y,z}       &   \texttt{Cartesian XYZ coordinates}\\
    \hspace{-6pt}                 & \texttt{a1,a2,a3}    &   \texttt{Euler's angles in degree}\\
    \hspace{-6pt}\texttt{output:} & \texttt{v,d,h}       &   \texttt{Cartesian VDH coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{t\_vdh\_to\_xyz}

\hspace{1.6cm}
\texttt{subroutine t\_vdh\_to\_xyz(,y,z,a1,a2,a3,v,d,h)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_vdh\_to\_xyz :}  fixed VDH $\longrightarrow$ spinning XYZ  system}

\hspace{1.6cm}
\begin{tabular}{lll}
    \hspace{-6pt}\texttt{input :} & \texttt{v,d,h}       &   \texttt{Cartesian VDH coordinates}\\
    \hspace{-6pt}                 & \texttt{a1,a2,a3}    &   \texttt{Euler's angles in degree}\\
    \hspace{-6pt}\texttt{output:} & \texttt{x,y,z}       &   \texttt{Cartesian XYZ coordinates}
\end{tabular}






%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip


~\\~\\
$\bullet$~Conversion spherical to cartesian and vice versa:
~\\~\\
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{t\_car\_to\_sph}

\hspace{1.6cm}
\texttt{subroutine t\_car\_to\_sph(x,y,z,r,teta,phi)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_car\_to\_sph :}  CAR $\longrightarrow$ SPH  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{x,y,z}     &   \texttt{Cartesian coordinates}\\
\hspace{-6pt}\texttt{output:} & \texttt{r,teta,phi}  & \texttt{spherical coordinates  (radians)}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{t\_sph\_to\_car}

\hspace{1.6cm}
\texttt{subroutine t\_sph\_to\_car(r,teta,phi,x,y,z)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transforms\_sph\_to\_car :}  SPH $\longrightarrow$ CAR  system}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{r,teta,phi}  & \texttt{spherical coordinates  (radians)}\\
\hspace{-6pt}\texttt{output:} & \texttt{x,y,z}       &  \texttt{Cartesian coordinates}
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\newpage
%------------------------------------------------------------------------
%		CHAPTER : DESCRIPTION OF AVAILABLE MODULES
%		SECTION : Description of    ``Matrix operations" subroutines
%------------------------------------------------------------------------
\section{Description of  ``Matrix operations" subroutines}
\label{sect:description of "Matrix operations" subroutines}

~\\
This part concern matrix operations allowing the transformation of an input 3D signal into the
 minimum variance coordinate (MVA Analysis).
 All codes in this part have been extracted of Roproc Software, V 4.5
 and rewrited properly in f77, with Rocotlib V2.2 conventions in april 2016.
 
~\\
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_covarmin}

\hspace{1.6cm}
\texttt{subroutine mat\_covarmin(ifc,Vx,Vy,Vz,n,irep,covar,lambda,eigvec)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_var\_min :} compute variance minimum coordinates of a signalVx,Vy,Vz}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{ifc}               & \texttt{unit for writing results}\\
                               & \texttt{Vx(n),Vy(n),Vz(n)} & \texttt{input signal}\\
                               & \texttt{n}                 & \texttt{number of point of the signal}\\			  
\hspace{-6pt}\texttt{output:}  & \texttt{covar(3,3)}        & \texttt{covariance matrix}\\
                               & \texttt{lamda(3)}          & \texttt{eigen values} \\
                               & \texttt{eigvev(3,3)}       & \texttt{eigen vectors}
\end{tabular} 


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_covariance}

\hspace{1.6cm}
\texttt{subroutine  mat\_covariance(Vx,Vy,Vz,n,covar)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_covariance :} compute covariance matrix for a vector series V(n)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{Vx(n),Vy(n),Vz(n)} & \texttt{vector series}\\
                               & \texttt{n}                 & \texttt{number of point of the signal}\\	  
\hspace{-6pt}\texttt{output:}  & \texttt{covar(3,3)}        & \texttt{covariance matrix}
\end{tabular} 

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_diagonalise}

\hspace{1.6cm}
\texttt{subroutine mat\_diagonalise(mat,lambda,eigvec)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{diagonalise} the given matrix mat(3,3)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :} & \texttt{mat(3,3)}    & \texttt{matrix to diagonalise}\\
\hspace{-6pt}\texttt{output:} & \texttt{lambda(3)}   & \texttt{eigen values}\\
                              & \texttt{eigvec(3,3)} & \texttt{eigen vectors normalised to 1.}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_checkortho}

\hspace{1.6cm}
\texttt{subroutine mat\_checkortho(ifc,mat)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{check orthogonality} of matrix components}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{ifc}         & \texttt{unit for writing results}\\
                               & \texttt{mat(3,3)}    & \texttt{matrix to check}\\
\hspace{-6pt}\texttt{output:}  & \texttt{on unit ifc} & \texttt{}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_determin}

\hspace{1.6cm}
\texttt{subroutine mat\_determin(mat,det)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute determinant} of the given matrix}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat(3,3)}  & \texttt{input matrix}\\
\hspace{-6pt}\texttt{output:}  & \texttt{det}  & \texttt{determinant value}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_eigenvec}

\hspace{1.6cm}
\texttt{subroutine mat\_eigenvec(mat,lambda,eigvec)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{compute\_eigen vectors}  and eigen values of real mat(3,3)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat(3,3)}     & \texttt{must be real and symmetrical}\\
                               & \texttt{ }            & \texttt{Method used is Householder}\\
\hspace{-6pt}\texttt{output:}  & \texttt{lamda(3)}     & \texttt{eigen values}\\
                               & \texttt{eigvec(3,3)}  & \texttt{eigen vectors}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_fpythag}

\hspace{1.6cm}
\texttt{subroutine mat\_fpythag(a,b,fpyth)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{Pythagore function} of two real (used by mat\_eigenvec)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{a,b}    & \texttt{arguments of the function}\\
\hspace{-6pt}\texttt{output:}  & \texttt{fpyth}  & \texttt{Pythagore function}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip
\newpage
%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_normavec}

\hspace{1.6cm}
\texttt{subroutine mat\_normavec(mat)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{normalize\_vectors:} normalise to 1 the vectors of the input matrix}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat(3,3)}  & \texttt{input matrix}\\
\hspace{-6pt}\texttt{output:}  & \texttt{mat(3,3)}  & \texttt{matrix with vectors normalized to 1.}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_product}

\hspace{1.6cm}
\texttt{subroutine mat\_product(mat1,mat2,mat3)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{product} of two given matrix of dim. 3x3}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat1(3,3)}  & \texttt{}\\
                               & \texttt{mat2(3,3)}  & \texttt{}\\
\hspace{-6pt}\texttt{output:}  & \texttt{mat3(3,3)}  & \texttt{Mat3=Mat1*Mat2}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_somme}

\hspace{1.6cm}
\texttt{subroutine mat\_somme(mat1,mat2,mat3)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{somme} of two given matrix of dim. 3x3}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat1(3,3)}  & \texttt{}\\
                               & \texttt{mat2(3,3)}  & \texttt{}\\
\hspace{-6pt}\texttt{output:}  & \texttt{mat3(3,3)}  & \texttt{Mat3=Mat1 + Mat2}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_diff}

\hspace{1.6cm}
\texttt{subroutine mat\_diff(mat1,mat2,mat3)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{difference} of two given matrix}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat1(3,3)}  & \texttt{}\\
                               & \texttt{mat2(3,3)}  & \texttt{}\\
\hspace{-6pt}\texttt{output:}  & \texttt{mat3(3,3)}  & \texttt{Mat3=Mat1 - Mat2}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_transpose}

\hspace{1.6cm}
\texttt{subroutine mat\_transpose(mat)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{transpose} input matrix}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat(3,3)}  & \texttt{matrix to transpose}\\
\hspace{-6pt}\texttt{output:}  & \texttt{mat(3,3)}  & \texttt{transposed matrix}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_changecoord}

\hspace{1.6cm}
\texttt{subroutine mat\_changecoord(mat,Vx,Vy,Vz,n)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{change\_coordinate} of a vector series with a given matrix}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{mat(3,3)}           & \texttt{coordinate transform matrix}\\
                               & \texttt{Vx(n),Vy(n),Vz(n)}  & \texttt{vector series to transform}\\
                               & \texttt{n}                  & \texttt{dimension of}$\vec{V}$\\
\hspace{-6pt}\texttt{output:}  & \texttt{Vx(n),Vy(n),Vz(n)}  & \texttt{vector series transformed as}
$\vec{V}=mat*\vec{V}$\\
\end{tabular}


%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_write}

\hspace{1.6cm}
\texttt{subroutine mat\_write(ifc,com,mat)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{write} on ifc unit the mat(3,3) with a comment}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{ifc}         & \texttt{file unit}\\
                               & \texttt{com}         & \texttt{coment string}\\
                               & \texttt{mat(3,3)}    & \texttt{matrix to be writed}\\
\hspace{-6pt}\texttt{output:}  & \texttt{on unit ifc} & \texttt{}\\
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip

\textbf{mat\_writeigen}

\hspace{1.6cm}
\texttt{subroutine mat\_writeigen(ifc,lambda,mat)}

\hspace{1.6cm}
$\blacktriangleright$ ~\emph{\textbf{write} on ifc unit the eigen values and eigen vectors of mat(3,3)}

\hspace{1.6cm}
\begin{tabular}{lll}
\hspace{-6pt}\texttt{input :}  & \texttt{ifc}         & \texttt{file unit}\\
                               & \texttt{lamda(3)}    & \texttt{eigen values to be writed}\\
                               & \texttt{mat(3,3)}    & \texttt{matrix  containing eigen vectors}\\
\hspace{-6pt}\texttt{output:}  & \texttt{on unit ifc} & \texttt{}\\                               
\end{tabular}

%------------------------------------------------------------------------
\smallskip\rule[0.5ex]{\textwidth}{0.1mm}\smallskip
