
\newpage
 
 
 %------------------------------------------------------------------------
 %		CHAPTER : CHECK PROGRAM AND PORTABILITY
 %------------------------------------------------------------------------
 \chapter{CHECK PROGRAM AND PORTABILITY}
 \label{chapter:CHECK PROGRAM AND PORTABILITY}
 

%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION :  Check program 
%------------------------------------------------------------------------
\section{Check program }
\label{sect:check program}

\subsection{General remarks}

A coordinate transform library must have a check program, in one hand to check the validity of the calculations,
and in other hand to be sure that we find the same results from one computer to another one, 
or from one compiler to another one.

~\\
The rocot\_check.exe programs delivered in the standard package allows the user to check 
the validity of the library for a given machine and compiler. It run from an input date and time, 
an input vector test, and with an input direction of observation. Next paragraph show  examples of input 
and output data file (rocot\_check.in and rocot\_check.out files in standard package). 
Accuracy of the computation is one deduce of the Sun direction computation, which is 0.006 degrees \cite{Russel71}.\\
                  
There is 4 main parts in the rocot\_check.out file:

\begin{enumerate}[parsep=0.1cm,itemsep=0.cm,topsep=0.1cm]
\item  \textbf{check calendar conversions} of the library;

\item  \textbf{check basic time parameters} as Sun direction, Dipole direction, Ecliptic pole, Sun equator pole;

\item  \textbf{check basic transformation}, for instance verify that direction of the Sun in GSM system 
is well the X axis, that Dipole direction in MAG system is well the Z axis, and so on;

\item  \textbf{check the usual transformations}, by changing the input vector across all available 
paths showed on the schematic diagram of section \ref{sect:schematic diagram of transformations}.
\end{enumerate}
 
\bigskip 
Mainly, the vector is transformed:

\begin{enumerate}[parsep=0.1cm,itemsep=0.cm,topsep=0.1cm]
\item   as a "star" centered on GE0 system (see schematic diagram figure \ref{diagram transformation}
of section  \ref{sect:schematic diagram of transformations} );

\item   as a "star" centered on GEI system;
\item   as a "star" centered on GSE system;
\item   as a "clockwise ring cumulative transformation", from GEO to GEO, in the other sense;
\item   some specific systems from GSE (SR2, ISR2, SR, MFA)
\item  Finally, input direction of the point of observation is used to check local coordinate systems, i.e. DM and VDH.
\end{enumerate}


\bigskip
At each "go and back", one check that the original vector is returned to the same value, 
taking into account accuracy of the computation : 32 bits simple precision, 6 significant digits, 
and input Sun direction within 0.006 degrees \cite{Russel71}.\\

So do not be worry if you get values as 0.999999 rather than 1.0, or other things like that.



\subsection{Input rocot\_check.in data file for running check program}

Input parameters for rocot\_check program has been choosen as below:


\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{12.2cm}
\begin{scriptsize}
\begin{verbatim}


1990 10 17    # iyear, imonth, iday
12 30 1       # ihour, imin, isec
 5. 30. 60.   # R, Theta, Phi (deg.) of test vector
45. 30.       # Geographic latitude and longitude (deg.) of point of observation
2.  170. 10.  # R, Theta, Phi (deg.) of spin axis in GSE
0.25 30.      # Spin frequency (Hz), Spin phase (Deg.)
1.2345        # delta T from Spin phase time measurement

\end{verbatim} 
\end{scriptsize}
\end{boxedminipage}
\end{center}


\subsection{Output rocot\_check.out file from check program execution}

This file is displayed on several pages as table \ref{Content of rocotcheck.out file}.

\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{10cm}
\begin{footnotesize}\baselineskip=7pt
\begin{alltt}


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
     Coordinates Transformation Library  ROCOTLIB
                  ___________________
 
 Rocotche program: Check transformations of Rocotlib
 
          Patrick ROBERT, CRPE, November 1992
 
          Revised Version 3.0 - Feb 2017
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



\textbf{SUMMARY OF CHECK OPERATIONS :}
***************************

  I) TEST OF ROCOTLIB CALENDAR CONVERSIONS

 II) CHECK BASIC TIME PARAMETERS

III) CHECK BASIC TRANSFORMATIONS

 IV) TEST OF ROCOTLIB TRANSFORMATION SUBROUTINES

    A) STAR TRANSFORMATIONS AROUND  GEI  SYSTEM

       GEI -----------------------------> MAG
       GEI ------------------------> SM
       GEI ------------------> GSM
       GEI ------------> GSE

    B) COUNTERCLOCKWISE RING CUMULATIVE TRANSFORM.

       GEO ->GEI ->GSQ ->GSE ->GSM ->SM ->MAG ->GEO

    C) CLOCKWISE RING CUMULATIVE TRANSFORMATIONS

       GEO ->MAG ->SM ->GSM ->GSE ->GSQ ->GEI ->GEO

    D) STAR TRANSFORMATIONS AROUND  GEO  SYSTEM

       GEO ------> SM
       GEO -----------> GSM
       GEO -----------------> GSE
       GEO -----------------------> GSQ

    E) LOCAL SYSTEMS

       GEO ----> DM
       GEO ----> VDH

    F) SPACECRAFT SYSTEMS

       GEO -> GSE -> SR2 -> SR -> SR2 -> GSE -> GEO

    G) PSEUDO-MAGNETOPAUSE SYSTEMS

       GSE ----> TPN
       GSM ----> TPN

\end{alltt} 
\end{footnotesize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$ 


\newpage 
Continuation of rocot\_check.out file...
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{10cm}
\begin{footnotesize}
\begin{verbatim}

INPUT DATA TEST :
***************

INPUT DATE AND TIME:
 iyear,imonth,iday ? (ex: 1990,10,17)
 1990 10 17
 hour, minute, second ? (ex: 10,45,50)
 12 30  1

iyear,imonth,iday:  1990 10 17
ih, im, is       :  12 30 01

INPUT VECTOR TEST:
r, teta,phi of any vector in GEO system ? (deg.)
     5.00000   30.000   60.000

INPUT GEOG. LAT AND LONG. FOR LOCAL SYSTEMS TEST:
lat. and long. of local direct. of observation ? (d.)
  45.000   30.000

INPUT SPIN DIRECTION for SR and SR2 SYSTEMS:
r, teta,phi of spin axis in GSE system ? (deg.)
     2.00000  170.000   10.000

SPIN FREQUENCY, SPIN PHASE & Deltat T :
 Spin frequency, Spin phase ? (Hz, deg.)
     0.25000   30.000
delta T ? (sec. from time of spin phase)
     1.23450



RUN OF CHECK PROGRAM
********************

Please wait...

\end{verbatim} 
\end{footnotesize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$ 

\newpage
Continuation of rocot\_check.out file...


\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}
             T E S T   O F   R O C O T L I B  Version 3.0


\textbf{I) TEST OF ROCOTLIB CALENDAR CONVERSIONS}
\textbf{   =====================================}

INPUT DATE AND TIME:

year, month,  day   :       1990    10    17
hour, minute, second:         12    30     1

computed values:

decimal hour of the day:   12.5003
day of the year:             290
Julian day from 1-1-1950:  14899
Julian day from 1-1-2000:  -3363
leap year (1=yes,0=no):        0

recompute date from year and day of the year:  1990    10    17
recompute date from Julian day 1950         :  1990    10    17
recompute date from Julian day 2000         :  1990    10    17
recompute time from decimal hour:    12    30     1


\textbf{II) CHECK BASIC TIME PARAMETERS}
\textbf{    ===========================}

SUN PARAMETERS IN GEI SYSTEM

Greenwich Sideral Time (deg.):   213.253
ecliptic longitude     (deg.):   203.879
right ascention        (deg.):   202.100
declination            (deg.):    -9.265

DIPOLE TILT ANGLE      (deg.):    -3.789

SUN DIRECTION
                     in GEI:
                                X=   -.91444     r   =     1.00000
                                Y=   -.37132     teta=    99.265
                                Z=   -.16100     phi =  -157.900
                     in GEO:
                                X=    .96832     r   =     1.00000
                                Y=   -.19090     teta=    99.265
                                Z=   -.16100     phi =   -11.152

DIPOLE DIRECTION
                     in GEI:
                                X=   -.14729     r   =     1.00000
                                Y=    .11476     teta=    10.761
                                Z=    .98241     phi =   142.077
                     in GEO:
                                X=    .06025     r   =     1.00000
                                Y=   -.17673     teta=    10.761
                                Z=    .98241     phi =   -71.176

ECLIPTIC DIRECTION
                     in GEI:
                                X=    .00000     r   =     1.00000
                                Y=   -.39780     teta=    23.440
                                Z=    .91747     phi =   -90.000
                     in GEO:
                                X=    .21812     r   =     1.00000
                                Y=    .33266     teta=    23.440
                                Z=    .91747     phi =    56.747

SUN EQUATOR DIRECTION
                     in GEI:
                                X=    .12170     r   =     1.00000
                                Y=   -.42440     teta=    26.200
                                Z=    .89726     phi =   -74.000
                     in GEO:
                                X=    .13094     r   =     1.00000
                                Y=    .42164     teta=    26.200
                                Z=    .89726     phi =    72.747

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$ 

\newpage
Continuation of rocot\_check.out file...
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}




\textbf{III) CHECK BASIC TRANSFORMATIONS}
\textbf{     ===========================}


     Check (S,E) angle is equal to 90 deg. : angle=  90.000    (deg.)


1) input vector: Sun direction in GEI system
   -----------------------------------------

                                X=   -.91444     r   =     1.00000
                                Y=   -.37132     teta=    99.265
                                Z=   -.16100     phi =  -157.900

                               in GEO system

                                X=    .96832     r   =     1.00000
                                Y=   -.19090     teta=    99.265
                                Z=   -.16100     phi =   -11.152


   check Y=0 in SM  system with t_gei_to_sm:

                                X=    .99781     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=    93.789
                                Z=   -.06609     phi =      .000

                           with t_geo_to_sm:

                                X=    .99781     r   =     1.00000
                                Y=    .00000     teta=    93.789
                                Z=   -.06609     phi =      .000

   check Y=0 and Z=0 in GSM system with t_gei_to_gsm:

                                X=   1.00000     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=    90.000
                                {\color{red}\textbf{Z=    .00000}}     phi =      .000

                           with t_geo_to_gsm:

                                X=   1.00000     r   =     1.00000
                                Y=    .00000     teta=    90.000
                                Z=    .00000     phi =      .000

   check Y=0 and Z=0 in GSE system with t_gei_to_gse:

                                X=   1.00000     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=    90.000
                                {\color{red}\textbf{Z=    .00000}}     phi =      .000

                           with t_geo_to_gse:

                                X=   1.00000     r   =     1.00000
                                Y=    .00000     teta=    90.000
                                Z=    .00000     phi =      .000

   check Y=0 and Z=0 in GSQ system with t_gei_to_gseq:

                                X=   1.00000     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=    90.000
                                {\color{red}\textbf{Z=    .00000}}     phi =      .000

                           with t_geo_to_gseq:

                                X=   1.00000     r   =     1.00000
                                Y=    .00000     teta=    90.000
                                Z=    .00000     phi =      .000

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$ 


\newpage

\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}\baselineskip=7pt
\begin{alltt}
2) input vector: Dipole direction in GEI system
   --------------------------------------------

                                X=   -.14729     r   =     1.00000
                                Y=    .11476     teta=    10.761
                                Z=    .98241     phi =   142.077

                                  in GEO system

                                X=    .06025     r   =     1.00000
                                Y=   -.17673     teta=    10.761
                                Z=    .98241     phi =   -71.176

   check X=0 and Y=0 in MAG system with t_gei_to_mag:

                                {\color{red}\textbf{X=    .00000}}     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=      .000
                                Z=   1.00000     phi =      .000

                           with t_geo_to_mag:

                                X=    .00000     r   =     1.00000
                                Y=    .00000     teta=      .000
                                Z=   1.00000     phi =      .000

   check X=0 and Y=0 in SM  system with t_gei_to_sm:

                                {\color{red}\textbf{X=    .00000}}     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=      .000
                                Z=   1.00000     phi =      .000

                           with t_geo_to_sm:

                                X=    .00000     r   =     1.00000
                                Y=    .00000     teta=      .000
                                Z=   1.00000     phi =      .000

   check Y=0 in GSM system with t_gei_to_gsm:

                                X=   -.06609     r   =     1.00000
                               {\color{red}\textbf{ Y=    .00000}}     teta=     3.789
                                Z=    .99781     phi =  -180.000

                           with t_geo_to_gsm:

                                X=   -.06609     r   =     1.00000
                                Y=    .00000     teta=     3.789
                                Z=    .99781     phi =   180.000

3) input vector: Ecliptic direction in GEI system
   ----------------------------------------------

                                X=    .00000     r   =     1.00000
                                Y=   -.39780     teta=    23.440
                                Z=    .91747     phi =   -90.000

                                    in GEO system

                                X=    .21812     r   =     1.00000
                                Y=    .33266     teta=    23.440
                                Z=    .91747     phi =    56.747

   check X=0 and Y=0 in GSE system with t_gei_to_gse:

                                {\color{red}\textbf{X=    .00000}}     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=      .000
                                Z=   1.00000     phi =      .000

                           with t_geo_to_gse:

                                X=    .00000     r   =     1.00000
                                Y=    .00000     teta=      .000
                                Z=   1.00000     phi =      .000

   check X=0 in GSQ system with t_gei_to_gseq:

                                {\color{red}\textbf{X=    .00000}}     r   =     1.00000
                                Y=   -.07931     teta=     4.549
                                Z=    .99685     phi =   -90.000

                           with t_geo_to_gseq:

                                X=    .00000     r   =     1.00000
                                Y=   -.07931     teta=     4.549
                                Z=    .99685     phi =   -90.000
\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$ 

\newpage
Continuation of rocot\_check.out file...


\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}\baselineskip=8pt
\begin{alltt}



4) input vector: Sun equator in GEI system
   ---------------------------------------

                                X=    .12170     r   =     1.00000
                                Y=   -.42440     teta=    26.200
                                Z=    .89726     phi =   -74.000

                             in GEO system

                                X=    .13094     r   =     1.00000
                                Y=    .42164     teta=    26.200
                                Z=    .89726     phi =    72.747


   check and Y=0 in GSQ system with t_gei_to_gseq:

                                X=   -.09815     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=     5.633
                                Z=    .99517     phi =  -180.000

                           with t_geo_to_gseq:

                                X=   -.09815     r   =     1.00000
                                Y=    .00000     teta=     5.633
                                Z=    .99517     phi =   180.000



5) input vector: North geographic in GEO system
   --------------------------------------------

                                X=    .00000     r   =     1.00000
                                Y=    .00000     teta=      .000
                                Z=   1.00000     phi =      .000


   check X=0 and Y=0 in GEI system with t_geo_to_gei:

                                {\color{red}\textbf{X=    .00000}}     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=      .000
                                Z=   1.00000     phi =      .000

   check Y=0 in MAG system with t_gei_to_mag:

                                X=   -.18672     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=    10.761
                                Z=    .98241     phi =   180.000

                           with t_geo_to_mag:

                                X=   -.18672     r   =     1.00000
                                Y=    .00000     teta=    10.761
                                Z=    .98241     phi =   180.000



\textbf{IV) TEST OF ROCOTLIB TRANSFORMATION SUBROUTINES}
\textbf{    ===========================================}

1) input choosed test vector in GEO system :

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

2) converts GEO system to GEI system by t_geo_to_gei

                                X=    .14185     r   =     5.00000
                                Y=  -2.49597     teta=    30.000
                                Z=   4.33013     phi =   -86.747

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$

\newpage
Continuation of rocot\_check.out file...
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}\baselineskip=7.5pt
\begin{alltt}


\textbf{A) STAR TRANSFORMATIONS AROUND  GEI  SYSTEM}
\textbf{   ========================================}

            # 3
       GEI --------> MAG
            # 4
       GEI --------> SM
            # 5
       GEI --------> GSM
            # 6
       GEI --------> GSE


1) t# 3 converts GEI system to MAG system byt_gei_to_mag

                                X=  -2.42551     r   =     5.00000
                                Y=   1.88173     teta=    37.877
                                Z=   3.94664     phi =   142.195

              come back to GEI system by t_mag_to_gei

                                X=    .14185     r   =     5.00000
                                Y=  -2.49597     teta=    30.000
                                Z=   4.33013     phi =   -86.747

          difference beetween first GEI vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}



2) t# 4 converts GEI system to SM  system byt_gei_to_sm

                                X=    .36158     r   =     5.00000
                                Y=   3.04848     teta=    37.877
                                Z=   3.94664     phi =    83.236

              come back to GEI system by t_sm_to_gei

                                X=    .14185     r   =     5.00000
                                Y=  -2.49597     teta=    30.000
                                Z=   4.33013     phi =   -86.747

          difference beetween first GEI vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}



3) t# 5 converts GEI system to GSM system byt_gei_to_gsm

                                X=    .09996     r   =     5.00000
                                Y=   3.04848     teta=    37.591
                                Z=   3.96191     phi =    88.122

              come back to GEI system by t_gsm_to_gei

                                X=    .14185     r   =     5.00000
                                Y=  -2.49597     teta=    30.000
                                Z=   4.33013     phi =   -86.747

          difference beetween first GEI vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}




4) t# 6 converts GEI system to GSE system by t_gei_to_gse

                                X=    .09996     r   =     5.00000
                                Y=    .57634     teta=     6.718
                                Z=   4.96567     phi =    80.160

              come back to GEI system by t_gse_to_gei

                                X=    .14185     r   =     5.00000
                                Y=  -2.49597     teta=    30.000
                                Z=   4.33013     phi =   -86.747

          difference beetween first GEI vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}



\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$

\newpage
Continuation of rocot\_check.out file...


\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}



\textbf{B) COUNTERCLOCKWISE RING CUMULATIVE TRANSFORMATIONS}
\textbf{   ================================================}

    # 2      7      8      9     10    11     12
  GEO -> GEI -> GSQ -> GSE -> GSM -> SM -> MAG -> GEO


   input choosed test vector in GEO system :

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

1) t# 2 converts GEO system to GEI system by t_geo_to_gei

                                X=    .14185     r   =     5.00000
                                Y=  -2.49597     teta=    30.000
                                Z=   4.33013     phi =   -86.747

2) t# 7 converts GEI system to GSQ system by t_gei_to_gseq

                                X=    .09996     r   =     5.00000
                                Y=    .18069     teta=     2.367
                                Z=   4.99573     phi =    61.047

3) t# 8 converts GSQ system to GSE system by t_gseq_to_gse

                                X=    .09996     r   =     5.00000
                                Y=    .57634     teta=     6.718
                                Z=   4.96567     phi =    80.160

4) þ# 9 converts GSE system to GSM system by t_gse_to_gsm

                                X=    .09996     r   =     5.00000
                                Y=   3.04848     teta=    37.591
                                Z=   3.96191     phi =    88.122

5) t# 10 converts GSM system to SM  system by t_gsm_to_sm

                                X=    .36158     r   =     5.00000
                                Y=   3.04848     teta=    37.877
                                Z=   3.94664     phi =    83.236

6) t# 11 converts SM  system to MAG system by t_sm_to_mag

                                X=  -2.42551     r   =     5.00000
                                Y=   1.88172     teta=    37.877
                                Z=   3.94664     phi =   142.195

7) t# 12 converts MAG system to GEO system by t_mag_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}



\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$

\newpage
Continuation of rocot\_check.out file...


\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}



\textbf{C) CLOCKWISE RING CUMULATIVE TRANSFORMATIONS}
\textbf{   =========================================}

    # 12     11    10     9      8      7      2
  GEO -> MAG -> SM -> GSM -> GSE -> GSQ -> GEI -> GEO


   input choosed test vector in GEO system :

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

1) t# 12 converts GEO system to MAG system by t_geo_to_mag

                                X=  -2.42551     r   =     5.00000
                                Y=   1.88173     teta=    37.877
                                Z=   3.94664     phi =   142.195

2) t# 11 converts MAG system to SM  system by t_mag_to_sm

                                X=    .36158     r   =     5.00000
                                Y=   3.04848     teta=    37.877
                                Z=   3.94664     phi =    83.236

3) t# 10 converts SM  system to GSM system by t_sm_to_gsm

                                X=    .09996     r   =     5.00000
                                Y=   3.04848     teta=    37.591
                                Z=   3.96191     phi =    88.122

4) t# 9 converts GSM system to GSE system by t_gsm_to_gse

                                X=    .09996     r   =     5.00000
                                Y=    .57634     teta=     6.718
                                Z=   4.96567     phi =    80.160

5) t# 8 converts GSE system to GSQ system by t_gse_to_gseq

                                X=    .09996     r   =     5.00000
                                Y=    .18069     teta=     2.367
                                Z=   4.99573     phi =    61.047

6) t# 7 converts GSQ system to GEI system by t_gseq_to_gei

                                X=    .14185     r   =     5.00000
                                Y=  -2.49597     teta=    30.000
                                Z=   4.33013     phi =   -86.747

          difference beetween first GEI vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}



7) t# 2 converts GEI system to GEO system by t_gei_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}


\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$

\newpage
Continuation of rocot\_check.out file...
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}\baselineskip=7.5pt
\begin{alltt}


\textbf{D) STAR TRANSFORMATIONS AROUND  GEO  SYSTEM}
\textbf{   ========================================}

          # 13
     GEO --------> SM
          # 14
     GEO --------> GSM
          # 15
     GEO --------> GSE
          # 16
     GEO --------> GSQ

   input choosed test vector in GEO system :

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

1) t# 13 converts GEO system to SM  system by t_geo_to_sm

                                X=    .36158     r   =     5.00000
                                Y=   3.04848     teta=    37.877
                                Z=   3.94664     phi =    83.236

              come back to GEO system by t_sm_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}


2) t# 14 converts GEO system to GSM system by t_geo_to_gsm

                                X=    .09996     r   =     5.00000
                                Y=   3.04848     teta=    37.591
                                Z=   3.96191     phi =    88.122

              come back to GEO system by t_gsm_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}


3) t# 15 converts GEO system to GSE system by t_geo_to_gse

                                X=    .09996     r   =     5.00000
                                Y=    .57634     teta=     6.718
                                Z=   4.96567     phi =    80.160

              come back to GEO system by t_gse_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}


4) t# 16 converts GEO system to GSQ system by t_geo_to_gseq

                                X=    .09996     r   =     5.00000
                                Y=    .18069     teta=     2.367
                                Z=   4.99573     phi =    61.047

              come back to GEO system by t_gseq_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$

\newpage
Continuation of rocot\_check.out file...
\renewcommand{\arraystretch}{1.8}
\begin{center}\setlength{\fboxrule}{1pt}

\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}
{\setlength{\baselineskip}{0.95\baselineskip}
 
\textbf{E) LOCAL SYSTEMS TRANSFORMATIONS}
\textbf{   =============================}

          # 17
     GEO --------> DM
          # 18
     GEO --------> VDH

   first direction of observation in GEO system:
        geog. lat., long. =    45.000    30.000

1) t# 17 converts GEO system to DM  system by t_geo_to_dm

                                X=   2.62675     r   =     5.00000
                                Y=   1.58877     teta=    37.877
                                Z=   3.94664     phi =    31.167

              come back to GEO system by t_dm_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}


2) t# 18 converts GEO system to VDH system by t_geo_to_vdh

                                X=   4.59279     r   =     5.00000
                                Y=   1.25000     teta=    72.170
                                Z=   1.53093     phi =    15.225

              come back to GEO system by t_vdh_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}


   second direction of observation in GEO system:
        geog. lat., long. =    45.000    30.000

3) t# 17 converts GEO system to DM  system by t_geo_to_dm

                                X=   2.62675     r   =     5.00000
                                Y=   1.58877     teta=    37.877
                                Z=   3.94664     phi =    31.167

              come back to GEO system by t_dm_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}


4) t# 18 converts GEO system to VDH system by t_geo_to_vdh

                                X=   4.59279     r   =     5.00000
                                Y=   1.25000     teta=    72.170
                                Z=   1.53093     phi =    15.225

              come back to GEO system by t_vdh_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetween first GEO vector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}
}
\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$

\newpage
Continuation of rocot\_check.out file...


\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}


\textbf{F) LOCAL SPACECRAFT SYSTEMS TRANSFORMATIONS}
\textbf{   ========================================}

    # 15    19     21    -21    -19    -15
  GEO -> GSE -> SR2 -> SR -> SR2 -> GSE -> GEO


   input choosed test vector in GEO system :

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

   input choosed spin axis in GSE system :

                                X=    .34202     r   =     2.00000
                                Y=    .06031     teta=   170.000
                                Z=  -1.96962     phi =    10.000

   input choosed Spin frequency, Spin phase, dt:

                   Spin frequency=    .2500 Hz
                   Spin phase    =  30.0000 deg.
                   delta T       =   1.2345 sec.


1) t# 15 converts GEO system to GSE system by t_geo_to_gse

                                X=    .09996     r   =     5.00000
                                Y=    .57634     teta=     6.718
                                Z=   4.96567     phi =    80.160

2) t# 19 converts GSE system to SR2 system by t_gse_to_sr2

                                X=    .94425     r   =     5.00000
                                Y=   -.72804     teta=   166.204
                                Z=  -4.85575     phi =   -37.633

3) t#-21 converts SR2 system to SR  system by t_sr2_to_sr

                                X=   -.57328     r   =     5.00000
                                Y=  -1.04547     teta=   166.204
                                Z=  -4.85575     phi =  -118.738

4) t# 21 converts SR  system to SR2 system by t_sr_to_sr2

                                X=    .94425     r   =     5.00000
                                Y=   -.72804     teta=   166.204
                                Z=  -4.85575     phi =   -37.633

5) t#-19 converts SR2 system to GSE system by t_sr2_to_gse

                                X=    .09996     r   =     5.00000
                                Y=    .57634     teta=     6.718
                                Z=   4.96567     phi =    80.160

6) t#-15 converts GSE system to GEO system by t_gse_to_geo

                                X=   1.25000     r   =     5.00000
                                Y=   2.16506     teta=    30.000
                                Z=   4.33013     phi =    60.000

          difference beetveen first GEO wector: {\color{red}\textbf{angle=      .000}}    (deg.)
                                                {\color{red}\textbf{ratio=     1.00000}}

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$

\newpage
Continuation of rocot\_check.out file...


\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}


\textbf{G) MAGNETIC FIELD ALIGNED TRANSFORMATION}
\textbf{   =====================================}

  GSE -> MFA
  SR2 -> MFA

   input choosed test vector in GSE system :

                                X=    .09996     r   =     5.00000
                                Y=    .57634     teta=     6.718
                                Z=   4.96567     phi =    80.160

   input choosed DC mag. field in GSE system :

                                X=  30.00000     r   =   208.32666
                                Y=  50.00000     teta=    16.254
                                Z= 200.00000     phi =    59.036


1) t# 22 converts GSE system to MFA system by t_gse_to_mfa

                                X=   -.61494     r   =     5.00000
                                Y=   -.64522     teta=    10.269
                                Z=   4.91991     phi =  -133.623

   input choosed test vector in SR2 system :

                                X=    .94425     r   =     5.00000
                                Y=   -.72804     teta=   166.204
                                Z=  -4.85575     phi =   -37.633

   input choosed DC mag. field in SR2 system :

                                X=  63.48236     r   =   208.32666
                                Y= -56.09747     teta=   156.005
                                Z=-190.32358     phi =   -41.466

2) t# 20 converts SR2 system to MFA system by t_sr2_to_mfa

                                X=   -.61494     r   =     5.00000
                                Y=   -.64522     teta=    10.269
                                Z=   4.91991     phi =  -133.623

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\vspace{-0.2cm}\hspace{9cm}Continuation of table \ref{Content of rocotcheck.out file} $\rightarrow$


\newpage
Continuation of rocot\_check.out file...

\begin{table}[!h]
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{11.5 cm}
\begin{scriptsize}
\begin{alltt}



\textbf{H) PSEUDO-MAGNETOPAUSE SYSTEMS}
\textbf{   ===========================}

       GSE ----> TPN
       GSM ----> TPN

1) Computation of the TPN system

   Input position in GSE system, in RE:
   (supposed to be on the magnetopause)

   Xo, Yo, Zo in GSE =     5.720     8.230     9.220

   abcisse of subsolar point for paraboloid model:    12.000

   TPN vectors in GSE:

   Tx,Ty,Tz=      .713     -.467     -.523
   Px,Py,Pz=      .000      .746     -.666
   Nx,Ny,Nz=      .701      .475      .532
 

   input choosed test vector in GSE system :

                                X=    .70138     r   =     1.00000
                                Y=    .47466     teta=    57.876
                                Z=    .53176     phi =    34.088
 
2) t# 23 convert GSE system to TPN system by t_gse_to_tpn

                                {\color{red}\textbf{X=    .00000}}     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=      .000
                                Z=   1.00000     phi =      .000
 
3) t# 9 convert GSE system to GSM system by t_gse_to_gsm

                                X=    .70138     r   =     1.00000
                                Y=    .68058     teta=    77.769
                                Z=    .21186     phi =    44.138
 
4) t# 9 convert GSE position of S/C to GSM position

   Xo, Yo, Zo in GSM =     5.720    11.800     3.673
 
5) t# 24 convert GSM system to TPN system by t_gsm_to_tpn

                                {\color{red}\textbf{X=    .00000}}     r   =     1.00000
                                {\color{red}\textbf{Y=    .00000}}     teta=      .000
                                Z=   1.00000     phi =      .000

\textbf{===============================}
\textbf{END OF rocot_check test program}
\textbf{===============================}

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\caption{rocot\_check.out file}
\label{Content of rocotcheck.out file}
\end{table}




\newpage
%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Compare rocot\_check.out files
%------------------------------------------------------------------------
\section{Compare rocot\_check.out files}
\label{sect:Compare rocot check.out files}

The rocot\_check.out file given in table \ref{Content of rocotcheck.out file} of section \ref{sect:check program} 
has been computed on a GNU/Linux operating system with a processor type x86\_64 with fort77 compiler.

~\\
Note that The  fort77  compiler invokes the f2c command transparently, so it can be
used like a real Fortran compiler.  It can be used to compile  Fortran and C, and to link it with the f2c libraries.
So we will see in section \ref{sect:Results obtained with gcc on C code and fort77 on F77 codes} that it is not surprising that the two codes, f77 and C, lead to exactly the same result.

~\\
When you use  another machines, with another compiler, the first thing to do is to
compare the rocot\_example.out file with the one given in section \ref{rocot example out}.

So we remind you have to compile with:
\begin{center}
    \texttt{\textbf{\small{make clean}}} \\
    \texttt{\textbf{\small{make all}}}    
\end{center}

and run all programs by
\begin{center}
    \texttt{\textbf{\small{sh/RUN\_ALL.sh}}}
\end{center}


Note that the package is delivered with a \texttt{\textbf{out\_GNU\_Linux\_x86\_64\_fort77\_f\_corr}} directory, containing all the {\color{red}.out} files corresponding to all the .exe files.
So a convenient way to do the comparison is to run all the available programs as explained in section \ref{Running all test programs} 
and then to compare the .out files.

~\\
One recommend to do first:

\begin{center}
\texttt{\textbf{\small{diff ./out/rocot\_example.out ./out\_GNU\_Linux\_x86\_64\_fort77\_f\_corr/rocot\_example.out}}}
\end{center}

If discrepancies are on $6^{th}$ or $7^{th}$ digits, there is no problem. 
So you can then check the rocot\_check.out files by doing:

\begin{center}
\texttt{\textbf{\small{diff ./out/rocot\_check.out ./out\_GNU\_Linux\_x86\_64\_fort77\_f\_corr/rocot\_check.out}}}
\end{center}

If the output is too long, redirect the output to a file, as:

\begin{center}
\texttt{\textbf{\small{diff ./out/rocot\_check.out ......./rocot\_check.out}}} $>$ \texttt{\textbf{\small{rocot\_check.txt}}}
\end{center}

Then take time to examine carefully the \texttt{\textbf{\small{rocot\_check.txt}}} file.


%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Running all available programs
%------------------------------------------------------------------------

\section{Running all available programs}
\label{sect:Running all available programs}

Before doing anything, verify that you have defined your compiler in the Makefile (see section \ref{choose compiler}) and running \texttt{\textbf{\small{make clean}}}
and \texttt{\textbf{\small{make all}}}. So the directory \texttt{\textbf{\small{bin}}} will contains all executables files such as {\color{red}\texttt{\textbf{\small{*.exe }}}}.

Then all available programs can be executed by running \texttt{\textbf{\small{sh/RUN\_ALL.sh}}}.
Details of all given programs are in chapter \ref{chapter:USEFUL PROGRAMS}.
~~\\
~~\\




%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Compare other .out files
%------------------------------------------------------------------------
\section{Compare other .out files}
\label{sect:Compare other .out files}

If there is a good agreement between the \texttt{\textbf{\small{rocot\_check.out}}} files, you can be quiet on the validity of the library.
Nevertheless, you can also check as the same manner  other .out files, but you must use first the \texttt{\textbf{\small{correct\_out.sh}}} shell script before doing comparison.
Indeed, according compiler used, the output can be different.\\

For example, with \texttt{\textbf{\small{fort77}}} or \texttt{\textbf{\small{gcc}}} we get result as:

\hspace{1cm}\texttt{\textbf{\small{X=   -.91444}}}\smallskip

while with \texttt{\textbf{\small{gfortran}}}, with the same format, we get:

\hspace{1cm}\texttt{\textbf{\small{X=  -0.91444}}}\smallskip

So it you make a linux \texttt{\textbf{\small{diff}}} command on the two output files, you will find a lot of insignificant difference. That is why we use a small shell script to convert the output file with the same convention (see table \ref{Content of correct_out.sh shell script file} below).\\

If you use a new compiler,  for instance \texttt{\textbf{\small{ifort}}}, on f77 package, you first identify your machine/system by enter:\smallskip

\hspace{1cm}\texttt{\textbf{\small{uname -a}}} \smallskip

you get something like:\smallskip

\texttt{\textbf{\small{Linux lx-robert 4.4.0-64-generic \#85-Ubuntu SMP Mon Feb 20 11:50:30 UTC
 2017 x86\_64 x86\_64 x86\_64 GNU/Linux}}} \\

Then you have to run the command: \smallskip

\hspace{1cm}\texttt{\textbf{\small{correct\_out.sh out\_GNU\_Linux\_x86\_64\_ifort\_f\_corr}}} \smallskip

and you will get in the directory \texttt{\textbf{\small{out\_GNU\_Linux\_x86\_64\_ifort\_f\_corr}}}
containing all the .out files, with the corrections of format making it possible to make comparisons without the previous disadvantages.\\

Then, by running a shell-script as, for instance:\smallskip
 
\hspace{1cm}\texttt{\textbf{\small{compare\_out\_GNU\_Linux\_x86\_64\_fort77\_gfortran.sh}}}\smallskip

you get all the difference between the results of \texttt{\textbf{\small{fort77}}} compiler 
and \texttt{\textbf{\small{gfortran}}}.
Example of compare shell scrip is given below 
(see table \ref{Content of compare_out_GNU_Linux_x86_64_fort77_gfortran.sh}).\\
~\\

\begin{table}[!h]
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{12.5 cm}
\begin{scriptsize}
\begin{alltt}

#!/bin/sh

# ------------------------------------------------------
# utility for compare .out files
# numbers as  ".123"    will be changed as " 0.123"
# numbers as "-.123"    will be changed as "-0.123"
# numbers as "-.00000"  will be changed as " 0.00000"
# numbers as "-180.000" will be changed as " 180.000"
# numbers as "-.000"    will be changed as " 0.000"

# Example of use:
# correct_out.sh out_GNU_Linux_x86_64_gfortran_f_corr
# ------------------------------------------------------

out_corr=$1

list1=`ls -1 out/*.out`
list2=`ls -1 out/*.resu`

list="$list1 $list2"

for name in $list 
do
echo $name ...
nameout=`basename $name`
sed -e s"/  \./ 0\./g" -e s"/ -\./-0\./g"  -e s"/-0\.00000/ 0\.00000/g" 
    -e s"/-180\.000/ 180\.000/g" -e s"/ -0\.000 /  0\.000 /g" $name > $out_corr/$nameout
done

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\caption{correct\_out.sh shell script file}
\label{Content of correct_out.sh shell script file}
\end{table}



\begin{table}[!h]
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{12.5 cm}
\begin{scriptsize}
\begin{alltt}

#!/bin/sh

dir1=out_GNU_Linux_x86_64_fort77_f_corr
dir2=out_GNU_Linux_x86_64_gfortran_f_corr

ls -1  $dir1/*.out | sed s"%.*/%%" > toto1.tmp
 ; diff $dir1/& $dir2/&%" toto1.tmp > toto2.tmp------------ 
sh toto2.tmp
rm toto*.tmp

\end{alltt} 
\end{scriptsize}
\end{boxedminipage}\\
\end{center}
\caption{compare\_out\_GNU\_Linux\_x86\_64\_fort77\_gfortran.sh shell script file}
\label{Content of compare_out_GNU_Linux_x86_64_fort77_gfortran.sh}
\end{table}



%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Differences between codes and used compilers
%------------------------------------------------------------------------
\section{Differences between codes and used compilers}
\label{sect:Differences between codes and used compilers}

Whatever the program used, it is reliable only if it give the same results with various compilers 
on various machines and OS.

Tests done here concern only various compiler, on the same machine 
(see \ref{sect:Compare other .out files}) but between the 3 delivered language: F77, F90 and C.
Results being satisfactory, no other test has been done.


\subsection{Results obtained with two different compilers on the same code}
\label{sect:Results obtained with two different compilers on the same code}

The checked code is the F77 code, with \texttt{\textbf{\small{ifort}}}
 and \texttt{\textbf{\small{gfortran}}}. Procedure used if the shell script 
\texttt{\small{compare\_out\_GNU\_Linux\_x86\_64\_fort77\_gfortran.sh}}
 given in table 
\ref{Content of compare_out_GNU_Linux_x86_64_fort77_gfortran.sh}.\medskip

As we can see, this shell compare all the .out files present in the two directories:

\hspace{2.cm}\texttt{\textbf{\small{out\_GNU\_Linux\_x86\_64\_fort77\_f\_corr}}}  

\hspace{1.3cm}and \texttt{\textbf{\small{out\_GNU\_Linux\_x86\_64\_gfortran\_f\_corr}}}.\medskip

Results are given in table \ref{Result of compare_out_GNU_Linux_x86_64_fort77_gfortran.sh}
below. We can see that there is no differences for following programs:

\begin{itemize}[label=$-$]
{\setlength{\baselineskip}{0.55\baselineskip}
\item \texttt{\small{co\_julday\_table.out}}
\item \texttt{\small{co\_mag\_time.out}}
\item \texttt{\small{rocot\_check.out}}
\item \texttt{\small{rocot\_info.out}}
\item \texttt{\small{test\_day\_in\_week.out}}
\item \texttt{\small{test\_format.out}}
\item \texttt{\small{test\_week.out }}
\item \texttt{\small{vdh\_to\_gse.out}}
\item \texttt{\small{co\_sunset.out}}
}
\end{itemize}
 
 \begin{center} 
 {\color{red}\it{Some minors differences exists for following programs:}}\end{center}
 
 \begin{itemize}[label=$-$]
 {\setlength{\baselineskip}{0.60\baselineskip}
 \item \texttt{\textbf{\small{co\_seasons.out}}} : Only a difference of about 10 mn is observed on solstices time computation. 
 Since the time accuracy of solstices and equinoxes is estimated about one hour, difference is negligible.
 
 \item \texttt{\textbf{\small{co\_sunset\_year.out}}} : Only one minute angle on the azimuth  of the direction of solar meridian and sunset, which is  negligible.
 
 \item \texttt{\textbf{\small{latlon\_to\_xyz.out}}} : Problem of output format: results are good  until $7^{th}$ digit, which is the single precision of the computer.
 
 \item \texttt{\textbf{\small{rocot\_check\_mva.out}}} : After matrix diagonalisation, some eigen values are not strictly equal to zero, both with f77 and gfortran. Nevertheless, the maximum eigen value being $~ 5000$, the minimum found is $~ 6. 10^{-4}$ , that is to say a ratio of 
 $~ 10^{-7}$, close to zero if we consider 7 digits for single precision.
 
 This is the same thing for dot product of vectors which should be equal to zero, observed value being $~10^{-7}$.
 
 At last, teta and phi angle differs on the $7^{th}$ digit, which is no significant.
 
 \item \texttt{\textbf{\small{rocot\_example.out.out}}} : difference observed at the $6^{th}$ digit, so, once again, effect of single precision.
 
 \item \texttt{\textbf{\small{test\_dir\_sun.out.out}}} : difference of $10^{-3}$ degree on the last angle, corresponding to the $6^{th}$ digit of a single precision number.
 
 \par}
 \end{itemize}
 
 


%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Results obtained with two different compilers
%------------------------------------------------------------------------
\subsection{Results obtained with the same compiler on F77 and F90 codes}
\label{sect:Results obtained with the same compiler on F77 and F90 codes}

Comparison was done on \texttt{\textbf{\small{F77}}} codes (*.f) and 
\texttt{\textbf{\small{F90}}} codes (*.f90) with the same 
\texttt{\textbf{\small{gfortran}}} compiler.
To do this comparison, we used the following  shell 

\texttt{\textbf{\small{compare\_with\_out\_GNU\_Linux\_x86\_64\_gfortran\_f.sh }}} 
given in the F90 package.\medskip
\vspace{-8pt}
\begin{center} {\color{red}\it{Absolutely no difference for all programs tested.}}\end{center}



\begin{table}[!ht]
\begin{center}\setlength{\fboxrule}{1pt}
\begin{boxedminipage}[c]{13.5 cm}
\begin{scriptsize}
\begin{alltt}
{\setlength{\baselineskip}{0.78\baselineskip}
compare_out_GNU_Linux_x86_64_fort77_gfortran.sh
----------------------------------------- 
co_julday_table.out : 
----------------------------------------- 
co_mag_time.out : 
----------------------------------------- 
co_sunset.out : 
13c13
<  merid. time (UT)= 12:03:20 sunrise= 07:34:00 sunset= 16:33:00 durd=  8:59:00
---
>  merid. time (UT)= 12:03:20 sunrise= 07:28:20 sunset= 16:38:50 durd=  9:10:30
20c20
<  merid. time (UT)= 12:06:50 sunrise= 07:21:50 sunset= 16:52:20 durd=  9:30:30
---
>  merid. time (UT)= 12:06:50 sunrise= 07:16:40 sunset= 16:57:30 durd=  9:40:50
27c27
<  merid. time (UT)= 12:12:00 sunrise= 07:52:20 sunset= 16:32:20 durd=  8:40:00
---
>  merid. time (UT)= 12:12:00 sunrise= 07:46:00 sunset= 16:38:30 durd=  8:52:30
34c34
<  merid. time (UT)= 12:12:00 sunrise= 07:53:30 sunset= 16:31:00 durd=  8:37:30
---
>  merid. time (UT)= 12:12:00 sunrise= 07:47:10 sunset= 16:37:20 durd=  8:50:10
----------------------------------------- 
co_sunset_year.out : 
162c162
< 2017-05-11  04:16 359d24'  61d20'  11:47  59d08' \textbf{180d01'}  19:19 359d22' 298d57'  15:0
---
> 2017-05-11  04:16 359d24'  61d20'  11:47  59d08' \textbf{180d00'}  19:19 359d22' 298d57'  15:0
401c401
< 2017-12-08  07:33 359d23' 125d08'  11:43  18d22' 180d01'  15:52 359d23' \textbf{234d49'}   8:1
---
> 2017-12-08  07:33 359d23' 125d08'  11:43  18d22' 180d01'  15:52 359d23' \textbf{234d48'}   8:1
----------------------------------------- 
latlon_to_xyz.out : 
2,3c2,3
<   50.  20.  6000.
<   4319.07764  1572.01587  3856.\textbf{72559}
---
>    50.0000000       20.0000000       6000.00000    
>    4319.07764       1572.01587       3856.\textbf{72583}    
----------------------------------------- 
rocot_check_mva.out : 
48,50c48,50
<                0.55875E+04    0.00000E+00    0.00000E+00
<                \textbf{0.00000E+00   -0.63610E-03   -0.30518E-04}
<                0.00000E+00   \textbf{-0.30518E-04}    0.20369E+05
---
>                0.55875E+04    0.11176E-07    0.00000E+00
>                \textbf{0.11176E-07   -0.23651E-03    0.00000E+00}
>                0.00000E+00    \textbf{0.00000E+00}    0.20369E+05
63,65c63,65
<  V1.V2 =  \textbf{-0.44703E-07}
<  V2.V3 =  \textbf{-0.11921E-06}
<  V3.V1 =  \textbf{ 0.00000E+00}
---
>  V1.V2 =  \textbf{-0.14901E-07}
>  V2.V3 =  \textbf{-0.89407E-07}
>  V3.V1 =  \textbf{ 0.14901E-06}
88,89c88,89
<  theta        \textbf{65.09956      124.61702       45.00004}
<  phi         -87.65820      \textbf{-16.34700       30.00003}
---
>  theta        \textbf{65.09957      124.61701       45.00003}
>  phi         -87.65820      \textbf{-16.34699       30.00002}
91c91
<  Lambda    0.20369E+05    0.55875E+04   \textbf{-0.63610E-03}
---
>  Lambda    0.20369E+05    0.55875E+04   \textbf{-0.23651E-03}
----------------------------------------- 
rocot_check.out : 
----------------------------------------- 
rocot_example.out : 
15,16c15,16
< Sun in GEI:      \textbf{0.744703     -0.612328}     -0.265465
< Sun in GEO:      \textbf{0.315648}      0.910985     -0.265465
---
> Sun in GEI:      \textbf{0.744702     -0.612329}     -0.265465
> Sun in GEO:      \textbf{0.315649}      0.910985     -0.265465
----------------------------------------- 
rocot_info.out : 
----------------------------------------- 
test_day_in_week.out : 
----------------------------------------- 
test_dir_sun.out : 
26c26
< Sun  in GEI :     0.136     0.909     0.394     1.000    66.790    \textbf{81.520}
---
> Sun  in GEI :     0.136     0.909     0.394     1.000    66.790    \textbf{81.521}
----------------------------------------- 
test_format.out : 
----------------------------------------- 
test_week.out : 
----------------------------------------- 
vdh_to_gse.out : 
}
\end{alltt} 
\end{scriptsize}
\end{boxedminipage}
\end{center}
\vspace{-0.4cm}
\caption{Result of compare\_out\_GNU\_Linux\_x86\_64\_fort77\_gfortran.sh}
\label{Result of compare_out_GNU_Linux_x86_64_fort77_gfortran.sh}
\end{table}



%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Results obtained with gcc and fort77 on C and F77 codes
%------------------------------------------------------------------------
\subsection{Results obtained with gcc on C code and fort77 on F77 codes}
\label{sect:Results obtained with gcc on C code and fort77 on F77 codes}


Comparison was done on \texttt{\textbf{\small{C}}} codes (*.c) and 
\texttt{\textbf{\small{F77}}} codes (*.f) with  
\texttt{\textbf{\small{gcc}}} compiler for C codes and 
\texttt{\textbf{\small{F77}}} compiler for F77 codes.
To do this comparison, we used the following  shell 

\texttt{\textbf{\small{compare\_with\_out\_GNU\_Linux\_x86\_64\_fort77\_f.sh}}} 
given in the F90 package.\medskip
\vspace{-8pt}
\begin{center} {\color{red}\it{Absolutely no difference for all programs tested.}}\end{center}

\emph {But this is obvious in fact}, since the C codes has been derived from F77 codes via the f2c converter, even if the C codes has then be Has been improved, mainly for its visibility. Furthermore the Makefile for C codes use the f2c library. So, no surprising that we found exactly the same result.



%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Results obtained with gcc and fort77 on C and F77 codes
%------------------------------------------------------------------------
\subsection{Results obtained with gcc on C code and gfortran on F77 or F90 codes}
\label{sect:Results obtained with gcc on C code and gfortran on F77 or F90 codes}

Comparison has been done both on F77 codes (*.f) and F90 codes (*.f90) with 
\texttt{\textbf{\small{gfortran}}} compiler.
\vspace{-8pt}
\begin{center} {\color{red}\it{Results founds are exactly the same that those of table
 \ref{Result of compare_out_GNU_Linux_x86_64_fort77_gfortran.sh}}}\end{center}

That is to say the results are the same that comparison between \texttt{\textbf{\small{Fort77}}} and
\texttt{\textbf{\small{gfortran}}}.


%------------------------------------------------------------------------
%		CHAPTER : CHECK PROGRAM AND PORTABILITY
%		SECTION : Summary
%------------------------------------------------------------------------
\subsection{Summary}
\label{sect:Summary}

Previous results show that only compiler choice is significant, and not code translation.

In fact, \texttt{\textbf{\small{f77}}}, \texttt{\textbf{\small{f95}}} or \texttt{\textbf{\small{gfortran}}} \emph {are the same compiler}. They give same results, whatever *.f or *.f90 used Fortran files.
~\\

In other hand, \texttt{\textbf{\small{fort77}}} use \texttt{\textbf{\small{f2c}}} compiler, as \texttt{\textbf{\small{gcc}}}. So \texttt{\textbf{\small{fort77}}} and \texttt{\textbf{\small{gcc}}} give same results on *.f or *.c files.
~\\

At least small differences observed between use of \texttt{\textbf{\small{fort77}}} and \texttt{\textbf{\small{gfortran}}} are in the accuracy of the computer.
If more important differences appears in the future, the user will check the possibility of using double precision computations.


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

\chapter*{Annexe: compatibility with previous versions}
Rocotlib exist since version 1.0 in november 1992. Until the 2.2 version of december 2011, the 
subroutines names was short and low speaking.\\

From the version 3, all the subroutine has been renamed with a long and more descriptive name. The correspondence with old names and new names is given in table \ref{Correspondance between names of old Rocotlib version }.
The V3.0 version contains a significant number of new subroutines not given here.

\begin{table}[!ht]
    \begin{center}\setlength{\fboxrule}{1pt}
        \begin{boxedminipage}[c]{11.5 cm}
            \begin{scriptsize}
                \begin{alltt}
                    \begin{multicols}{2}
                        {\setlength{\baselineskip}{0.90\baselineskip}
      cangrat : cp_angle_and_ratio
      cdatdoy : cv_doty_to_date
      cdatj00 : cv_jul2000_to_date
      cdatj50 : cv_jul1950_to_date
      cdatwee : cv_weekn_to_date
      cdipdir : cp_geo_dipole_dir
      cdoweek : cv_date_to_dotw
      cdoyear : cv_date_to_doty
      cfrdayn : cp_fr_day_name
      cfrmonn : cp_fr_month_name
      chouday : cv_hms_to_dech
      cjd1950 : cv_date_to_jul1950
      cjd2000 : cv_date_to_jul2000
      cmilday : cv_dhms_to_msotd
      cnbdmon : cp_nbday_in_month
      coleapy : cp_leap_year
      csundir : cp_gei_sun_dir
      csunset : cp_sunrise_sunset
      ctimhou : cv_dech_to_hms
      ctimmil : cv_msotd_to_hmsms
      ctimpa2 : cp_time_param2
      ctimpa3 : cp_time_param3
      ctimpar : cp_time_param
      ctpnsys : cp_tpn_param
      cusdayn : cp_en_day_name
      cusmonn : cp_en_month_name
      cweedoy : cv_date_to_weekn
      
      gdipdir : g_gei_geo_dipole_dir
      gdiptan : g_gsm_dipole_tilt_angle
      gecldir : g_gei_geo_ecliptic_dir
      gsrodir : g_gei_geo_sun_rot
      gsundir : g_gei_geo_sun_dir
      gsunpar : g_gei_sun_param
      gvernum : g_rocot_version_number
      
      plibinf : print_rocot_info
      
      recoor  : r_coordinate_values
      recsys  : r_coordinate_system
      redate  : r_date
      retime  : r_time
      
      
      
      
      
      
      
      tcarsph : t_car_to_sph
      tdmegeo : t_dm_to_geo
      tgeigeo : t_gei_to_geo
      tgeigse : t_gei_to_gse
      tgeigsm : t_gei_to_gsm
      tgeigsq : t_gei_to_gseq
      tgeimag : t_gei_to_mag
      tgeisma : t_gei_to_sm
      tgeodme : t_geo_to_dm
      tgeogei : t_geo_to_gei
      tgeogse : t_geo_to_gse
      tgeogsm : t_geo_to_gsm
      tgeogsq : t_geo_to_gseq
      tgeomag : t_geo_to_mag
      tgeosma : t_geo_to_sm
      tgeovdh : t_geo_to_vdh
      tgsegei : t_gse_to_gei
      tgsegeo : t_gse_to_geo
      tgsegsm : t_gse_to_gsm
      tgsegsq : t_gse_to_gseq
      tgsemfa : t_gse_to_mfa
      tgsesr2 : t_gse_to_sr2
      tgsetpn : t_gse_to_tpn
      tgsmgei : t_gsm_to_gei
      tgsmgeo : t_gsm_to_geo
      tgsmgse : t_gsm_to_gse
      tgsmgsq : t_gsm_to_gseq
      tgsmmag : t_gsm_to_mag
      tgsmsma : t_gsm_to_sm
      tgsmtpn : t_gsm_to_tpn
      tgsqgei : t_gseq_to_gei
      tgsqgeo : t_gseq_to_geo
      tgsqgse : t_gseq_to_gse
      tgsqgsm : t_gseq_to_gsm
      tmaggei : t_mag_to_gei
      tmaggeo : t_mag_to_geo
      tmaggsm : t_mag_to_gsm
      tmagsma : t_mag_to_sm
      tsmagei : t_sm_to_gei
      tsmageo : t_sm_to_geo
      tsmagsm : t_sm_to_gsm
      tsmamag : t_sm_to_mag
      tsphcar : t_sph_to_car
      tsr2gse : t_sr2_to_gse
      tsr2mfa : t_sr2_to_mfa
      tsr2sre : t_sr2_to_sr
      tsresr2 : t_sr_to_sr2
      tvdhgeo : t_vdh_to_geo
}
\end{multicols}
\end{alltt} 
\end{scriptsize}
\end{boxedminipage}
\end{center}
\vspace{-0.4cm}
\caption{Correspondence between names of old Rocotlib versions with the one of version 3.0.}
\label{Correspondance between names of old Rocotlib version }
\end{table}

%------------------------------------------------------------------------
% liste des figures et des tables
\def\cleardoublepage{\clearpage}
\begin{changemargin}{-1. cm}{-1. cm}
    \listoffigures
    \def\cleardoublepage{\clearpage}    
    \listoftables
\end{changemargin}
%------------------------------------------------------------------------

\chapter*{Acknowledgments}
The author is deeply grateful to Ronan Modolo who made a first Latex translation of the formulas initially written in Word in the 1.7 version of december 2002.

\vspace{2 cm}

%\def\clearpage{\hspace{0.01cm}}
%------------------------------------------------------------------------

\begin{thebibliography}{4}
    \bibitem[1]{Russel71} Geophysical coordinate transformations, C.T. Russell, cosmic electrodynamics, v.2, 184-196, 1971.
    \bibitem[2]{Robert93} CLUSTER Software Tools, Part 1 : Coordinate Transformation Library, Version 1.1, 
    by Patrick Robert, CNRS-CNET/CRPE, Document de travail DT/CRPE/1231, Juillet 1993.
    \bibitem[3]{Robert00} CLUSTER DATA PROCESSING, Transformation of a STAFF waveform into a Magnetic Field Aligned coordinate system, 
    by Patrick Robert and C. de Villedary, Rapport interne CNRS-UVSQ/CETP $n_o$ RI-CETP/6/2000, Octobre 2000.
    \bibitem[4]{Robert03} ROCOTLIB: a Coordinate Transformation Library for Solar-Terrestrial studies, Version 1.7, 
    by Patrick Robert, Rapport interne CNRS-UVSQ/CETP $n_o$ RI-CETP/02/2003, January 2003.
    \bibitem[4]{Robert04} Livraison des données S300/UBF 
    des satellites GEOS au CDPP, comparaison avec le magn\'etom\`etre, Patrick Robert, Rapport interne pour le CDPP,
    ScientiDev, Mai 2019.

\end{thebibliography}

The results of sunset and sunrise computation done in the library have been checked with the one given by the service of the
``Institut de M\'ecanique c\'eleste et de calcul des \'eph\'em\'erides (IMCCE)'' an particularly the web page
{\color{blue}\url{https://promenade.imcce.fr/fr/pages3/370.html}}

