COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cendRun.f
Go to the documentation of this file.
1 ! to be called when the end of execution status is reached.
2  subroutine cendrun
3  implicit none
4 #if defined (KEKA) || defined (KEKB)
5 #include "mpif.h"
6  integer err
7 #endif
8 
9 ! save current status.
10  call csavestatus
11 ! user hook
12  call chookenrun
13 #if defined (KEKA) || defined (KEKB)
14  call mpi_finalize(err)
15 #endif
16  end
17 ! ***************************************** stave cont info
18  subroutine csavestatus
19  implicit none
20 #include "Zmanagerp.h"
21 
22  integer icon
23 
24  preveventno = eventno ! current event no.
25  call rnd1s(initrn) ! current seed.
26  if(contfile .ne. ' ' ) then
27  call copennlfw(tempdev, contfile, icon)
28 ! open(TempDev, file=ContFile, form='formatted')
29  call cwriteparam(tempdev, 1)
30  close(tempdev)
31  endif
32  end
33 ! ***************************************** print final status
34  subroutine cprintstatus
35  implicit none
36 #include "Zmanagerp.h"
37 #include "Zptcl.h"
38 #include "Zprimary.h"
39 #include "Zprimaryv.h"
40 
41 
42  character*80 msg
43  integer i
44 
45  write(msg, *) ' No of cummulative events =', preveventno,
46  * ' No of events in this run=', eventsintherun
47  call cerrormsg(msg, 1)
48  write(msg, *) ' comp. sampled accepted'
49  call cerrormsg(msg, 1)
50  do i = 1, prim%no_of_comps
51  write(msg, '(i4,2i12)')
52  * i, prim%NoOfSampComp(i,1), prim%NoOfSampComp(i,2)
53  call cerrormsg(msg, 1)
54  enddo
55  call cerrormsg("###end of run###", 1)
56  end
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine chookenrun
Definition: chook.f:147
subroutine cendrun
Definition: cendRun.f:3
subroutine cwriteparam(io, force)
Definition: cwriteParam.f:4
subroutine csavestatus
Definition: cendRun.f:19
subroutine cprintstatus
Definition: cendRun.f:35