COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cwriteSeed.f
Go to the documentation of this file.
1 ! ****************************************************
2 ! inquire the initial random seed
3  subroutine cqinirn(ir)
4  implicit none
5 #include "Zmanager.h"
6  integer ir(2)
7 
8  ir(1) = seedsave(1)
9  ir(2) = seedsave(2)
10  end
11 ! ****************************************************
12 ! write iformation for initial random number for flesh
13 ! at skelton making time
14  subroutine cwriteseed
15  implicit none
16 #include "Zmanagerp.h"
17 #include "Zmanager.h"
18 
19 #undef F90
20 #undef FLUSH
21 
22 #if defined PCLinux
23 #define FLUSH
24 #define F90
25 #elif defined PCLinuxIFC
26 #define FLUSH
27 #define F90
28 #elif defined Solaris
29 #define FLUSH
30 #elif defined NEXT486
31 #define FLUSH
32 #elif defined DECALPHA
33 #define FLUSH
34 #elif defined CF_AlphaLinux
35 #define FLUSH
36 #elif defined SGI
37 #define FLUSH
38 #elif defined IBMAIX
39 #define FLUSH
40 #endif
41 
42 #if defined FLUSH
43  character*120 fn
44  logical first
45  integer klena
46  save first, fn
47  data first/.true./
48 
49  if(first) then
50  first = .false.
51  fn = ' '
52  call cgetfname(seedfile, fn)
53  else
54 #if defined F90
55  open(seedfiledev, file=fn(1:klena(fn)),
56  * form='formatted', position='append')
57 #elif defined IBMAIX
58 ! ibm should apppend if status old
59  open(seedfiledev, file=fn(1:klena(fn)),
60  * form='formatted', status='old')
61 #else
62  open(seedfiledev, file=fn(1:klena(fn)),
63  * form='formatted', access='append')
64 #endif
65  endif
66 #endif
67 
68  write(seedfiledev, *) seedsave, eventno+1
69 
70 #if defined FLUSH
71  close(seedfiledev)
72 #endif
73  end
74 ! ****************************************************
75 ! read iformation for initial random number at flesh time
76  subroutine creadseed(ir, no, jeof)
77  implicit none
78 #include "Zmanagerp.h"
79 
80  integer ir(2), no, jeof
81 
82  integer nn
83  integer count
84  data count/0/
85  save count
86 
87  jeof = 0
88  do while(.true.)
89  read(seedfiledev, *, end=100) ir, nn
90  if(nn .ge. eventno) goto 200 ! skip already processed ones
91  enddo
92 
93  100 continue
94  jeof =1
95  if(count .eq. 0) then
96  count = count + 1
97  call cerrormsg(
98  * 'No more events to be fleshed',1)
99  call cerrormsg(
100  * 'EOF of the seed file reached', 1)
101  else
102  call cerrormsg(
103  * '2nd time to read EOF of the seed file',0)
104  endif
105  200 continue
106  no = nn
107  end
subroutine cgetfname(fnin, fn)
Definition: copenf.f:275
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine creadseed(ir, no, jeof)
Definition: cwriteSeed.f:77
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
subroutine cwriteseed
Definition: cwriteSeed.f:15
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon ! knockon is considered Obsolete *PhotoProd false
Definition: cblkElemag.h:7
subroutine cqinirn(ir)
Definition: cwriteSeed.f:4
Definition: Zpos.h:16