=============================================================
 
      This is the initialization routine for the 2D use
      of the library. It initialize the variable defined
      in the commons mml-lattice, 2Dsc-beam, 2Dsc-simulations.
      In order to work this routine needs two external files:
      a file which contain the lattice, and a parameter
      file called  parameter-micromap 
      where all the initialzation quantities for the 2D beam tracking
      are declared. The lattice file must be declared in the
      parameter-micromap file.
 
      XS is the position of injection of the beam
 
      nsimreg is a flag to number output files.
 
              Special cases:
 
      nsimreg=0: If nsimreg = 0 the pre-defined output file will have
                 extension "1".
 
      nsimreg=1: If nsimreg = 1 the file micromap.numer-simulation.data
                 will be read (or created in case it does not exists:
                 with the initialization number -1 in it).
                 This number will be used to define the new output extension.
                 Afterwords the extension number will be increased of a unit
                 and saved in micromap.numer-simulation.data.
                 This option is useful to keep in the same directory
                 many ouptut data files and save them in files with
                 different extension. If nsimreg=1 the random number
                 generator changes the random number initial seed
                 everytime you run the same program
                 Therefore at every new run
                 the numbers generated with Ranudun1(), and
                 RandGauss1() will have a different seed.
                 (because the file number-simulation.data set the
                 seed).
 
      nsimreg=-1:If nsimreg=-1 the initial seed of the random number
                 generator is set by the envinronment variable
                 SLURM_ARRAY_TASK_ID
                 of "kronos" and the number in the file "ndata_kronos".
                 This number is unique when you run in the "kronos"
                 Therefore at every new run the numbers generated with
                 Ranudun1(), and RandGauss1() will have a different seed.
 
      nsimreg=-2:If nsimreg=-2 the initial seed of the random number
                 generator is set by urandom. That means that that
                 initialization number will never be repeated again.
                 Therefore at every new run the numbers generated with
                 Ranudun1(), and RandGauss1() will have a different seed.
 
     nsimreg=-10:the option nout=-10 is set in the routine
                 initimml.f
 
 
 =============================================================
 .......................................................................
 
subroutine INITIPARAMETER(XS,nsimreg)
 
COMMONS: 
common-initi.f
common-2Dsc-beam.f
common-2Dsc-simulation.f
common-mml-lattice.f
 
SUBROUTINES USED:
  parameter-micromap .f.html">ed  parameter-micromap 
  count_from_file
  get_index_kronos
  set_seed_random_number
  initimml
  TUNEMACHINE
  initi_kv_beta1
  injection3D
  initi_current
   betanew
  rmsoutput
  initi_perveance
  betanew
  messages_n
  COMPACTION
  beta
  LINOP
 
micromap-index
Mon Jul 17 08:57:38 CEST 2017