Index: trunk/MagicSoft/Simulation/Corsika/Mmcs/cerenkov.f
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Mmcs/cerenkov.f	(revision 401)
+++ trunk/MagicSoft/Simulation/Corsika/Mmcs/cerenkov.f	(revision 687)
@@ -344,11 +344,20 @@
  102      CARTIM = ((ETADSN*(THCKOB(NOBSLV)-THICK(DBLE(ZEMIS)))
      *         /WEMIS+PATHCR-VCOR/BETAE)/C(25)+TIME(NP))* 1.E9
-          
+         
 c          CALL OUTPT2(IQ(NP),I)
           CALL OUTPT2(NCT,I)
-
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-          call jctime(cartim)
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
+C     Modified by C. Bigongiari 2001 Jan 16 
+C
+C
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C          call jctime(cartim)
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C    
 
           GOTO 1000
@@ -401,5 +410,5 @@
       CHARACTER*4      CRUNH,CRUNE,CEVTH,CEVTE
       EQUIVALENCE      (RUNH(1),CRUNH), (RUNE(1),CRUNE)
-      EQUIVALENCE      (EVTH(1),CEVTH), (EVTE(1),CEVTE)
+      EQUIVALENCE      (EVTH(1),CEVTH), (EVTE(1),CEVTE)   
 *KEEP,CONST.
       COMMON /CONST/   PI,PI2,OB3,TB3,ENEPER
@@ -680,7 +689,17 @@
           CALL OUTPT2(NCT,I)
 
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-          call jctime(cartim)
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
+C     Modified by C. Bigongiari 2001 Jan 16 
+C
+C
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C          call jctime(cartim)
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C    
 
           GOTO 1000
Index: trunk/MagicSoft/Simulation/Corsika/Mmcs/jcio.c
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Mmcs/jcio.c	(revision 401)
+++ trunk/MagicSoft/Simulation/Corsika/Mmcs/jcio.c	(revision 687)
@@ -1,7 +1,9 @@
 /*----------------------------------------------------------------------
-  jcio.c : 
-
-Rutinas para la gestion de ficheros en CORSIKA 5.20 Las posibilidades
-que contempla son: 
+  jcio.c :    
+
+Rutinas para la gestion de ficheros en CORSIKA 5.20 
+Author J.C.Gonzalez 
+
+Las posibilidades que contempla son: 
 
 - Creacion de un fichero de inicio de run: run###### 
@@ -14,4 +16,10 @@
 - La grabacion se realiza en C, por lo que no existen marcas de inicio
   ni final de bloque en los ficheros.
+
+Modified by C.Bigongiari 2000 Dec 19.
+No more RUN###### and END###### files created. 
+Three files, CER######, DAT###### and STA###### files, per run instead 
+of three files per shower.
+Now ###### is the RUN NUMBER not the shower number !!!
 ----------------------------------------------------------------------*/
 
@@ -30,19 +38,24 @@
 FILE *patape;
 FILE *sttape;
+/* CBC
 FILE *runtape;
 FILE *endtape;
+CBC*/
 char tpl[100];
 char certpl[100];
 char dattpl[100];
-char statpl[100];
+/* CBC char statpl[100]; */
 char cerfile[100];
 char datfile[100];
+/* CBC
 char stafile[100];
 char runfile[100];
 char endfile[100];
-
-/*--------------------------------------------------
-  jcinitio: 
-  graba un bloque al fichero de particulas 
+CBC */
+
+/*--------------------------------------------------
+  jcinitio:  
+
+Define file names 
 --------------------------------------------------*/
 #ifdef JC_UNDERSCORES
@@ -65,9 +78,15 @@
   strcpy (dattpl, tpl);
   strcat (dattpl, "dat%06d");
+  /* CBC
   strcpy (statpl, tpl);
   strcat (statpl, "sta%06d");
-
+  */
+  /* CBC
   sprintf (runfile, "%srun%06d", tpl, *runnum);
   sprintf (endfile, "%send%06d", tpl, *runnum);
+  CBC */
+
+  sprintf (cerfile, certpl,  *runnum);         /* Added by CB */
+  sprintf (datfile, dattpl,  *runnum);         /* Added by CB */
 }
 
@@ -107,146 +126,66 @@
   jcstartrun:
   abre el fichero run###### y graba el contenido
---------------------------------------------------*/
-#ifdef JC_UNDERSCORES
-void
-jcstartrun_ (float *runh)
-#else /* JC_NO_UNDERSCORES */
-void
-jcstartrun (float *runh)
-#endif /* JC_UNDERSCORES */
-{
+
+NOW open CER and DAT files  
+--------------------------------------------------*/
+#ifdef JC_UNDERSCORES
+void
+jcstartrun_ (void)
+#else /* JC_NO_UNDERSCORES */
+void
+jcstartrun (void)
+#endif /* JC_UNDERSCORES */
+{
+  /* CBC 
+
   if ((runtape = fopen (runfile, "wb")) == NULL) {
     printf ("JCIO:: Cannot open RUN file %s. Exiting.\n", runfile);
     exit (1);
   }
+  CBC */
+
   /* puts("JCIO:: saving runheader buffer..."); */
+
+  /* CBC
   fwrite (runh, sizeof (float) * MAXBUF, 1, runtape);
-}
-
-/*--------------------------------------------------
-  jcendrun:
-  abre el fichero run###### y graba el contenido
---------------------------------------------------*/
-#ifdef JC_UNDERSCORES
-void
-jcendrun_ (float *rune)
-#else /* JC_NO_UNDERSCORES */
-void
-jcendrun (float *rune)
-#endif /* JC_UNDERSCORES */
-{
-  fwrite (rune, sizeof (float) * MAXBUF, 1, runtape);
-  fclose (runtape);
-}
-
-/*--------------------------------------------------
-  jcnewcerfile:
-  abre un nuevo fichero Cherenkov
---------------------------------------------------*/
-#ifdef JC_UNDERSCORES
-void
-jcnewcerfile_ ()
-#else /* JC_NO_UNDERSCORES */
-void
-jcnewcerfile ()
-#endif /* JC_UNDERSCORES */
-{
-  sprintf (cerfile, certpl, nshow);
+
+  CBC */
+
+    /* Following lines up to CBC added by CB */ 
+
+
   if ((cetape = fopen (cerfile, "wb")) == NULL) {
     printf ("JCIO:: Cannot open CER file %s. Exiting.\n", cerfile);
     exit (1);
   }
-  timefirst = 9.0e10;
-  timelast = -9.0e10;
-}
-
-/*--------------------------------------------------
-  jcnewdatfile:
-  abre un nuevo fichero de particulas
---------------------------------------------------*/
-#ifdef JC_UNDERSCORES
-void
-jcnewdatfile_ (void)
-#else /* JC_NO_UNDERSCORES */
-void
-jcnewdatfile (void)
-#endif /* JC_UNDERSCORES */
-{
-  sprintf (datfile, dattpl, nshow);
   if ((patape = fopen (datfile, "wb")) == NULL) {
     printf ("JCIO:: Cannot open DAT file %s. Exiting.\n", datfile);
     exit (1);
   }
-}
-
-/*--------------------------------------------------
-  jcnewstafile:
-  abre un nuevo fichero de estadisticas
---------------------------------------------------*/
-#ifdef JC_UNDERSCORES
-void
-jcnewstafile_ (void)
-#else /* JC_NO_UNDERSCORES */
-void
-jcnewstafile (void)
-#endif /* JC_UNDERSCORES */
-{
-  sprintf (stafile, statpl, nshow);
-  if ((sttape = fopen (stafile, "wb")) == NULL) {
-    printf ("JCIO:: Cannot open STA file %s. Exiting.\n", stafile);
-    exit (1);
-  }
-}
-
-/*--------------------------------------------------
-  jcnewshower:
-  abre nuevos ficheros para la nueva cascada
---------------------------------------------------*/
-#ifdef JC_UNDERSCORES
-void
-jcnewshower_ (void)
-#else /* JC_NO_UNDERSCORES */
-void
-jcnewshower (void)
-#endif /* JC_UNDERSCORES */
-{
-  if (nshow > 0) {
-    fclose (patape);
-    fclose (cetape);
-    fclose (sttape);
-  }
-
-  nshow++;
-#ifdef JC_UNDERSCORES
-  jcnewdatfile_ ();
-  jcnewcerfile_ ();
-  jcnewstafile_ ();
-#else /* JC_NO_UNDERSCORES */
-  jcnewdatfile ();
-  jcnewcerfile ();
-  jcnewstafile ();
-#endif /* JC_UNDERSCORES */
-}
-
-/*--------------------------------------------------
-  jcenddata:
-  abre el fichero run###### y graba el contenido
---------------------------------------------------*/
-#ifdef JC_UNDERSCORES
-void
-jcenddata_ (float *runh, float *rune)
-#else /* JC_NO_UNDERSCORES */
-void
-jcenddata (float *runh, float *rune)
-#endif /* JC_UNDERSCORES */
-{
-  if ((endtape = fopen (endfile, "wb")) == NULL) {
-    printf ("JCIO:: Cannot open END file %s. Exiting.\n", endfile);
-    exit (1);
-  }
-  fwrite (runh, sizeof (float) * MAXBUF, 1, endtape);
-  fwrite (rune, sizeof (float) * MAXBUF, 1, endtape);
-  fclose (endtape);
-}
+
+  /* CBC */ 
+}
+
+/* WHAT FOLLOWS IS NO MORE USED !!!!!! CB */
+
+/*--------------------------------------------------
+  jcstartshower:
+  
+Function added by CB  
+Sets timefirst and timelast variables to their initial value at the beginnng 
+of new shower   
+--------------------------------------------------*/
+#ifdef JC_UNDERSCORES
+void
+jcstartshower_ (float *evth)
+#else /* JC_NO_UNDERSCORES */
+void
+jcstartshower (float *evth)
+#endif /* JC_UNDERSCORES */
+{
+  timefirst = 9.0e10;
+  timelast = -9.0e10;
+}
+
 
 /*--------------------------------------------------
@@ -357,2 +296,19 @@
 
 }
+
+/*--------------------------------------------------
+  jcendrun:
+  
+  Closes STA file 
+--------------------------------------------------*/
+#ifdef JC_UNDERSCORES
+void
+jcendrun_ (float *rune)
+#else /* JC_NO_UNDERSCORES */
+void
+jcendrun (float *rune)
+#endif /* JC_UNDERSCORES */
+{
+  /* fwrite (rune, sizeof (float) * MAXBUF, 1, sttape); */
+  fclose (sttape);
+}
Index: trunk/MagicSoft/Simulation/Corsika/Mmcs/main.f
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Mmcs/main.f	(revision 401)
+++ trunk/MagicSoft/Simulation/Corsika/Mmcs/main.f	(revision 687)
@@ -425,19 +425,44 @@
       ILEFTA = 0
 c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- 
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
+C     Modified by C. Bigongiari 2001 Jan 16 
+C 
+C
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       print *,'JCIO::========================================'
       print *,'JCIO:: Initializing JCIO system for advanced'
       print *,'JCIO:: saving of data.'
       print *,'JCIO::========================================'
-c- initialize jcio system
+C
+Cc- initialize jcio system
+C      
       call jcinitio(dsn,nrrun)
-c- create file run######
-      call jcstartrun(runh)
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
+Cc- create file run######
+C      call jcstartrun(runh)
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+C- Modified JCSTARTRUN creates cer###### and dat###### files !
+C
+C     ###### is the RUN number !
+C
+
+      call jcstartrun(RUNH)
+
+C
+C- write Run Header on cer and dat files  
+C 
+      CALL TOBUF(RUNH,0)
+      IF ( LCERFI ) CALL TOBUFC(RUNH,0)
+
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
 C-----------------------------------------------------------------------
 C  LOOP OVER SHOWERS
+
       DO 2  ISHW = 1,NSHOW
+
  
 c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -482,11 +507,12 @@
           FPRINT = .FALSE.
         ENDIF
- 
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-c   Create cer######,dat######,sta###### files
-c------------------------------------------------------------
-        call jcnewshower
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Cc   Create cer######,dat######,sta###### files
+Cc------------------------------------------------------------
+C        call jcnewshower
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 
 C  RESET COUNTERS
         DO 447  K = 1,25
@@ -823,5 +849,5 @@
         ENDIF
         EVTH(147) = 0.
- 
+
         IF ( FEGS ) THEN
 C  PARAMETER FOR ELECTRON AND PHOTON REJECT (CONVERT ENERGY TO MEV)
@@ -838,7 +864,10 @@
         EVTH( 9) = PTOT0 * ST * SIN(PHI)
         EVTH(10) = PTOT0 * COSTHE
+     
+
 c
 c [*] one block from here sent above
 c
+
         EVTH(85) = CERSIZ
  
@@ -856,5 +885,5 @@
         IF ( EVTH(3) .GT. 3.0  .OR.  .NOT. FEGS ) THEN
           CALL TOBUF ( EVTH,0 )
-          IF ( LCERFI ) CALL TOBUFC( EVTH,0 )
+          IF ( LCERFI ) CALL TOBUFC( EVTH,0 ) 
         ENDIF
  
@@ -865,6 +894,5 @@
      *          '    GEN      LEVEL  E ON STACK'/)
         NOPART = 0
- 
- 
+
         IF ( CURPAR(1) .LE. 3.D0  .OR.
      *      (CURPAR(1) .GE. 5.D0  .AND.  CURPAR(1) .LE. 7.D0) ) THEN
@@ -889,5 +917,5 @@
 C  HADRONIC PARTICLES
           FNPRIM = .TRUE.
- 
+
 C  FILL LONGITUDINAL DISTRIBUTION FOR THE PRIMARY PARTICLE
 C  THE PARTICLE IS TRACKED FROM THICK0 DOWN TO THICK0+CHI*PRMPAR(3)
@@ -917,5 +945,5 @@
             ENDIF
           ENDIF
- 
+
 C  CHECK OBSERVATION LEVEL PASSAGE AND UPDATE PARTICLE COORDINATES
           HNEW = H
@@ -944,4 +972,5 @@
         ENDIF
  
+
 C-----------------------------------------------------------------------
 C  NORMAL CYCLE
@@ -1027,5 +1056,4 @@
 C  FINISH SHOWER AND PRINT INFORMATION
         CALL OUTEND
- 
  
 *       IF ( DEBUG ) WRITE(MDEBUG,442) NPARTO
@@ -1221,25 +1249,42 @@
         ENDIF
  
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
+C     Modified by C. Bigongiari 2001 Jan 16 
+C 
+C
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 c   Saves statistics to sta###### file
-        call jcstadata(EVTH,EVTE,
-     +      NPROTO,NPROTB,NNEUTR,NNEUTB,NPHOTO,NELECT,NPOSIT,
-     +      NNU   ,NMUM  ,NMUP  ,NPI0  ,NPIM  ,NPIP  ,NK0L  ,
-     +      NK0S  ,NKMI  ,NKPL  ,NHYP  ,NDEUT ,NTRIT ,NALPHA,
-     +      NOTHER,IFINNU,IFINPI,IFINET,IFINKA,IFINHY,
-     +      CERELE,CERHAD,PLONG,LPCT1,NSTEP,THSTEP)
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C        call jcstadata(EVTH,EVTE,
+C     +      NPROTO,NPROTB,NNEUTR,NNEUTB,NPHOTO,NELECT,NPOSIT,
+C     +      NNU   ,NMUM  ,NMUP  ,NPI0  ,NPIM  ,NPIP  ,NK0L  ,
+C     +      NK0S  ,NKMI  ,NKPL  ,NHYP  ,NDEUT ,NTRIT ,NALPHA,
+C     +      NOTHER,IFINNU,IFINPI,IFINET,IFINKA,IFINHY,
+C     +      CERELE,CERHAD,PLONG,LPCT1,NSTEP,THSTEP)
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 C  WRITE SHOWER END TO OUTPUT BUFFER
-c        CALL TOBUF( EVTE,0 )
-        CALL TOBUF( EVTE,1 )
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Cc        CALL TOBUF( EVTE,0 )
+C        CALL TOBUF( EVTE,1 )
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C        IF ( LCERFI ) THEN
+C          CALL OUTND2
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Cc          CALL TOBUFC( EVTE,0 )
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C        ENDIF
+
+C
+C  WRITE SHOWER END TO OUTPUT BUFFER
+        CALL TOBUF( EVTE,0 )
         IF ( LCERFI ) THEN
           CALL OUTND2
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-c          CALL TOBUFC( EVTE,0 )
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-        ENDIF
+          CALL TOBUFC( EVTE,0 )
+        ENDIF
+
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
  
         IF ( FPRINT .OR. DEBUG ) WRITE(MONIOU,*)
@@ -1259,6 +1304,8 @@
           JHBIN(J) = JHBIN(J) + IHBIN(J)
   19    CONTINUE
- 
+
+
   2   CONTINUE
+
 C  END OF SHOWER LOOP
  
@@ -1271,8 +1318,24 @@
       RUNE(3) = REAL(ISHW)
 C  WRITE RUN END TO OUTPUT BUFFER AND FINISH OUTPUT
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-c      CALL TOBUF ( RUNE,1 )
-      call jcendrun(rune)
-c      IF ( LCERFI ) CALL TOBUFC( RUNE,1 )
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
+C     Modified by C. Bigongiari 2001 Jan 16 
+C
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Cc      CALL TOBUF ( RUNE,1 )
+C      call jcendrun(rune)
+Cc      IF ( LCERFI ) CALL TOBUFC( RUNE,1 )
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+C- write Run End      
+C
+
+      CALL TOBUF ( RUNE,1 )
+      IF ( LCERFI ) CALL TOBUFC( RUNE,1)
+
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C   
 c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 C  TIME SINCE BEGINNING
@@ -1308,5 +1371,5 @@
  209  FORMAT(//' ENERGY - MULTIPLICITY MATRIX FOR ALL SHOWERS'/
      *       ' ENERGY RUNS VERTICALLY, MULTIPLICITY HORIZONTALLY'//,
-     *       ' ',6X,5I9,3I8,5I7,'   ENERGY RANGE (GEV)'/
+     *       ' ',6X,5I9,3I8,5I7'   ENERGY RANGE (GEV)'/
      *       37(/' ',I4,1X,I10,4I9,3I8,5I7,1X,1P,2E10.1,0P)//
      *       ' MULT. ',5I9,3I8,5I7,4X,'LOWER BIN LIMIT'/
@@ -1580,8 +1643,15 @@
       ENDIF
  
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-      call jcenddata(runh,rune)
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-
+C
+CBC+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
+C     Modified by C. Bigongiari 2001 Jan 16 
+C
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C      call jcenddata(runh,rune)
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 
       WRITE(MONIOU,*)' '
       CALL PRTIME(TTIME)
@@ -1593,8 +1663,25 @@
       IF ( MDEBUG .NE. 6 ) CLOSE( MDEBUG )
       CLOSE( EXST )
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-c      CLOSE( PATAPE )
-c      IF ( LCERFI ) CLOSE( CETAPE )
-c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C
+C     Modified by C. Bigongiari 2001 Jan 16 
+C
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+Cc      CLOSE( PATAPE )
+Cc      IF ( LCERFI ) CLOSE( CETAPE )
+Cc>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+C
+C- close files       
+C
+      
+      CLOSE( PATAPE )
+      IF ( LCERFI ) CLOSE( CETAPE )
+C      CALL JCENDRUN( RUNE ) 
+
+C
+CBC++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+C    
  
       STOP
