
C***********************************************************************
C         rinit_inc.f       170707
C***********************************************************************

      IMPLICIT NONE                           

C+++++++++C+++++++++C+++++++++C+++++++++C+++++++++C+++++++++C+++++++++72

C ******* PARAMETERS***************************************************
      
      INTEGER NSTAR
      PARAMETER (NSTAR=150001)
      DOUBLE PRECISION PII,GM
      PARAMETER (PII=3.14159265358979312D0)                         
      PARAMETER (GM=3.7942D16)

C NSTAR = THE MAXIMUM AMOUNT OF PARTICLES
 
C ******* VARIABLES RELATED TO PARTICLES ******************************

      DOUBLE PRECISION R(NSTAR,3),RP(NSTAR,3),ROTA(NSTAR,3)                
      DOUBLE PRECISION S(NSTAR),MYY(NSTAR)
      INTEGER IS(NSTAR)
      DOUBLE PRECISION SHEAR
      DOUBLE PRECISION EPOT,EKIN,ETOT,MSUM,ETOT0

C R = POSITIONS OF PARTICLES
C RP = VELOCITIES OF PARTICLES
C ROTA = SPINS OF PARTICLES
C S = RADIUSES OF PARTICLES

C ******* VARIABLES RELATED TO SIZE DISTRIBUTION **********************
                                                                        
      DOUBLE PRECISION DSIG(0:10),SIG,SIGA,SIGB,SIG1,SIG2
      DOUBLE PRECISION CIFAC(10),CEFAC(10),CIFAC0,CEFAC0
      DOUBLE PRECISION XMASS(NSTAR),TMASS
      INTEGER NUM(10),VAL,MJAK,NSIG,IND
      DOUBLE PRECISION Q,QQ,VAK,EXPO,S1,S2,SS,ROO
      REAL XPRO(NSTAR),YPRO(NSTAR)
      INTEGER INDX(NSTAR)
      DOUBLE PRECISION SV(NSTAR)
      DOUBLE PRECISION MYYV(NSTAR),MKES(10)
      INTEGER INDLARGE
      DOUBLE PRECISION MTOT_SIZE(0:10)
      INTEGER NC(10),LKMR

      DOUBLE PRECISION PA

C NSIG = NUMBER OF SIZE GROUPS
  
C ******* VARIABLES RELATED TO BOX + INITIAL VALUES ******************
      
      INTEGER ISEED,LKM,LKMC
      DOUBLE PRECISION TIME,TIME0,ETA,WZ,WZ2,WZFAC,W0,OMEGA,OMEGA2,W2
      DOUBLE PRECISION KAPPA,KAPPA2,KAPPAFAC,PERIOD
      DOUBLE PRECISION QZINIT
      DOUBLE PRECISION XL,YL,TAU(10),TAU0
      DOUBLE PRECISION CX1(10),CX2(10),CI(10),CE(10),CXMI,CXMA
      DOUBLE PRECISION CX,CXB,CY,CYB
      DOUBLE PRECISION CI2,CE2,CINK,CEKS,CXMAX,CYMAX
      DOUBLE PRECISION EKS,EKS2,EKSB,INK,INK2,INKB,MA,MB
      INTEGER IDIME
      DOUBLE PRECISION LEV,SIG4,DEF,AFIDL

      REAL AMPFIDL(400),PHASEFIDL(400)

C CINK,CEKS = EPISYKLIAMPLITUDIEN KESKIARVOT

C ******* MISC ********************************************************

      CHARACTER*80 DUMMYLINE
      INTEGER I,J,NR,LASK,M,N,IR,NTEST,IMIX
      DOUBLE PRECISION FACTEMP
      DOUBLE PRECISION AVAK,BVAK,CVAK,VVAK,UVAK,WVAK,ZVAK,ZPVAK
      DOUBLE PRECISION UVAK_ALL,WVAK_ALL,ZVAK_ALL,ZPVAK_ALL


      DOUBLE PRECISION FH3
      DOUBLE PRECISION SRAN,DUMMY,RAN1,DELTA,GAMMA
      INTEGER IIDUM

      DOUBLE PRECISION ERO,EROX,EROY,EROZ,SKER
